Skip to main content

Module standalone

Module standalone 

Source
Expand description

A standalone executable is the warp-runtime stub carrying a program’s machine code: <executable><machine code, deflated><its length, u64 little-endian><TRAILER_MAGIC><zeros to a multiple of 16>, then, in a Mach-O executable, its code signature: the machine code lies inside the __LINKEDIT segment, so the executable signs and verifies cleanly (codesign --verify --strict, macho.rs). At start the executable looks for the trailer where its program would end and runs what it carries.

Enums§

Ran
How a program’s run ended: main returned its results, or the program called exit(code)

Constants§

ENTRY_POINTS
The exported functions a program starts at, in order of preference

Functions§

embedded_machine_code
The machine code the executable at path carries, reading only its load commands and end when it carries none
provided_imports
The imports a standalone executable provides: (module, name); C functions beyond them it carries (c_signatures.rs)
run
Run machine code compiled with warp’s settings (warp build): its host words, libm, libc, print and the C functions it carries are linked, its result is what it printed (build makes the program print its value)
run_carried_program
When this executable carries a program: run it and give the exit code; a page’s site it shows (card build-links)
run_module
Run module with the stub’s host words, libm, libc, print and c_functions linked: from main through the handlers it listens with
running_engine
The standalone engine, ticking when a time limit ends the run
standalone_engine
The engine an executable’s machine code is compiled for (warp build) and run with (the stub): no address map, the table from machine code to wasm offsets (an eighth of the machine code); a trap names the functions without them. An executable counts no fuel; it stops only at a time limit WARP_TIME_LIMIT sets.
stub_calls_export
Whether the stub looks up this export of a program: its entry point, memory, handlers and the constructors of their event. warp build drops every other export, and the functions only those reached (tree shaking, card g_gFs8)
stub_calls_export_with_foreign_calls
The exports the stub looks up of a program calling python or js: those of every program, and what the answers are built with (gc_values.rs)
with_machine_code
runtime (an executable, with or without a program) carrying machine_code instead. A Mach-O executable comes back unsigned: sign it (codesign --sign -, which warp build runs), else macOS refuses to start it.
with_site
runtime carrying a page’s site: an app showing it in the system’s web view (card build-links); sign it as above
without_machine_code
The executable without its code signature and without the program it carries