silk.platform.native.start_sync.
A minimal start code for a native program whose main is an i32 effect that requires &mut
HostInput.
When to use#
Select this runtime explicitly when you want no execution and no diagnostics. The default
runtime, silk.platform.native.start, accepts more kinds of main and prints a report for an
unhandled error.
Details#
The runtime copies the arguments and the environment, gives them to main as an OsHostInput,
and releases them after main returns. Your code provides every other requirement, such as the
Allocator that HostInput lookups need. An error during start or an unhandled error of main
returns status 1, without a report.
Gotchas#
mainmust be an effect that returnsi32and requires&mut HostInput. A plaini32,(), other requirements, or parking need another runtime.A trap does not unwind, so cleanup code does not run.
The runtime exists on Windows x86_64, Darwin x86_64 or aarch64, GNU/Linux x86_64 or aarch64, and WASI, where it exports
_startand exits throughproc_exit.
Public declarations: 0.
This module declares no public items.
Category: Native platform.
Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.