future
Translation status: English reader-locale proof. Term names and code fences follow the en pack; supporting prose may still be English.
Compatibility annotation for asynchronous posture.
Syntax: @ future
Category#
async
Related#
- futura
- annotation-sugar
Examples#
radix/corpus/annotation-sugar/futura-braced.fab (canonical · annotation)#
Braced canonical @ future unit marker.
@ future { }
fn f() → void {
return
}
main {
print "futura-braced"
}Expected output:
futura-braced
radix/corpus/futura/futura.fab (canonical · annotation)#
Compatibility annotation for asynchronous posture.
# =============================================================================
# future — Compatibility annotation for asynchronous posture
# =============================================================================
#
# What this teaches:
# • Preferred async posture — write `async` for a finite async function.
# • Compatibility annotation — `@ future` remains accepted and preserved as
# the legacy spelling for async posture.
# • Related keywords: cursor, await_const, await
#
# Common mistakes:
# • Calling an async function and forgetting to consume the promise with
# `await_const`, `await_var`, `return_await`, or `await`.
#
# See also: cursor, await_const, await
# =============================================================================
# @ future — compatibility async function annotation
#
# @ future
# fn name(…) → type { … }
#
# GRAMMAR:
# annotatedFunc :← '@' 'future' funcDecl
# callablePosture :← 'async'
#
# EXPECTED OUTPUT:
# none — Rust async runtime whitelist (compile-only in harness)
#
# BACKEND:
# Rust async runtime not linked in exempla harness (whitelist: future/futura.fab).
@ future { }
fn responde() → int {
return 42
}
async_main {
# await_const awaits the promise and binds the resolved value
await_const int responsum ← responde()
print responsum
}Expected output:
42