Colorless async/await in Firefly

ahnfelt

Joakim Ahnfelt-Rønne

Posted on February 16, 2022

Colorless async/await in Firefly

In the last post, we sketched out the high level rules of the async/await inference. This post will show how it works under the hood for a concrete example that reads two files concurrently, and then concatenates the result:

readTwo(system: System, file1: String, file2: String): String {
    let pair = system.tasks.concurrently(
        {system.files.readText(file1)},
        {system.files.readText(file2)}
    )
    pair.first + pair.second
}
Enter fullscreen mode Exit fullscreen mode

Continue reading: https://www.ahnfelt.net/async-await-inference-in-firefly-part-2/

💖 💪 🙅 🚩
ahnfelt
Joakim Ahnfelt-Rønne

Posted on February 16, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Async/await inference in Firefly
programminglanguages Async/await inference in Firefly

February 14, 2022

Colorless async/await in Firefly
programminglanguages Colorless async/await in Firefly

February 16, 2022