Browse the docs

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#

  • main must be an effect that returns i32 and requires &mut HostInput. A plain i32, (), other requirements, or parking need another runtime.

  • A trap does not unwind, so cleanup code does not run.

  • The runtime exists only on Darwin on aarch64, and Linux with GNU libc on x86_64 or aarch64.

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.

View the source of this page