Built-in primitives for asynchronous programming and concurrency.
1async protocol fetch_data(id):2 declare("Fetching data for", id)3 sleep(100) # Simulated delay4 yield "User " + text(id)56# Call implementation7u := await fetch_data(42)8declare("Result:", u)1# Resolve immediately2p := resolve("value")3v := await p45# Create promise from async function6p_fetch := fetch_data(1) 7# Now execute concurrently...8another_task()9# ...and await later10res := await p_fetchSchedule code execution for later without blocking.
1defer(1000, declare, "Executed after 1s")2declare("This prints first")