Skip to main content
Use async def for functions that suspend. Use await to wait for an async operation inside another async context.
The task namespace is available in async Sifr programs for core task operations such as task.sleep, task.scope, task.gather, and task.TaskGroup.
Sifr tracks whether async code performs real suspension. An async function that never reaches a suspension point is rejected because it does not need to be async.

Typed Errors

Async functions can return Result[T, E] just like synchronous functions. raise produces the error value, and callers handle it with try/except.

Awaiting Work

You can await a direct async call, a task handle, or an async API from the standard library.
For async subprocess I/O, use the async process APIs rather than blocking calls.

What Is Different From asyncio

Sifr has no exposed event-loop object. You do not call get_event_loop, mutate loop policy, or detach work into a global registry. Async work belongs to scopes, and the compiler verifies ownership at the boundary.

Blocking And CPU-Heavy Work

Do not run blocking I/O or CPU-heavy functions directly inside async code. Sifr reports this as an async diagnostic because blocking the runtime would prevent other tasks from making progress. Use async APIs for I/O. For CPU-heavy maps over owned data, continue with Parallel Work.

Next Steps

Structured Tasks

Run two or more async operations together inside a scope.

Cancellation and Timeouts

Bound the lifetime of awaited work.