Expand description
The calls compiled code makes into the runtime, exported unmangled as nf_*.
Ownership follows one rule: a call takes ownership of the values passed to it unless
its parameter is a borrowed Slot, documented as such, and gives ownership of the
values it returns, except getters, whose results are borrowed from their container.
A call that can fail returns false after recording why in the context; compiled code
then returns false itself, up to the runtime.
Every pointer passed in must be valid for the access the call makes, every Slot must
hold a value of the type the call expects, and every context must be the one the
runtime passed into the compiled code making the call. nf build upholds this for the
code it emits, which nifty_rt_mainβs caller vouches for.
ModulesΒ§
- lists π
- Lists: building, reading, and changing them in place.
- numbers π
- Arithmetic Cranelift has no instruction for.
- state π
- The appβs state, calls between functions, and failures compiled code detects itself.
- strings π
- Strings, and building interpolated strings.
- structs π
- Structs: building, reading fields, and changing them in place.
- values π
- Owning, comparing and storing values of any type.
FunctionsΒ§
- borrow_
context π β - Safety
- count π
- A listβs length, or a stringβs, as an
int. Allocations never exceedisize::MAXbytes, so the length always fits.