Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

µDewy is archived and no longer developed. This is a snapshot of its documentation. → Dewy

D.3 Host Function Intrinsics

Instead of syscalls, the WASM backend provides browser-focused host functions:

IntrinsicArgsDescription
__host_log__(ptr len)2Output text to the browser console
__host_exit__(code)1End the program (does not return)
__host_time__()0Current timestamp in milliseconds
__host_random__()0Random non-negative integer (below 2^53)

__host_exit__ unwinds the module back to the page, which stops calling main. As with an uncaught exception in a script, an exit or a trap leaves the page as it is; the exit code or the error goes to the console.

These are subject to change