Skip to content

Overview

csl++ is CSL with the extensions listed on this page. Every CSL program is a csl++ program. csl-pp translates csl++ to vanilla CSL, so the extensions need no support from cslc.

Syntax Meaning Page
async fn f(...) T { ... } A function that can suspend. Async functions and tasks
async task t() void { ... } A task that can suspend. Async functions and tasks
suspend; Ends the current run of the task; the next activation continues after it. Async functions and tasks
fn f(...) max_recursion_depth(N) T Bounds the recursion of f for stack sizing. Stacks
fn f(...) stack_size(N) T Declares the stack use of f in bytes. Stacks

async and suspend are only keywords in these positions; elsewhere they are ordinary identifiers.

Builtin Result Page
@await(f(...)) The result of f Calling async functions
@await_parallel(f(...), g(...), ...) A tuple of the results Calling async functions
@current_task() local_task_id Async functions and tasks
@coro_runtime_init() void Async functions and tasks
@claim_color() color Claims
@claim_local_task() local_task_id Claims
@claim_data_task() data_task_id Claims
@claim_control_task() control_task_id Claims
@claim_input_queue() input_queue Claims
@claim_output_queue() output_queue Claims
@release_color(id) and the other @release_* void Claims
@count_free(T) u16 Claims
Builtin Change Page
@bind_local_task, @bind_data_task, @bind_control_task Can be called at runtime. Binding tasks at runtime