Expand description
The native runner of effects: the Rust twin
of the loop in fjs/effects/module.mjs, over nanvm-lib’s own values.
An effect is what fjs/effects builds, and the program’s own VM values stay
as they are: a Pure, a function that takes nothing and answers a Result,
or a Do, an object with the command to perform, its payload and the
continuation that takes the answer to the next effect. There is no native
copy of any of it: the loop reads three properties, calls two kinds of
function and hands values on, so identity survives. Only a Native host,
the perform over std, reads a request out of VM values, and writes its
answer back.
nanvm-effects-node depends on nanvm-lib, never the reverse.
Structs§
- Dirent
- An entry of a directory, as Node’s
Dirent. - File
Module - The module a specifier names: the real path of its file and its identity,
a
file:URL. - IoError
- A failed operation as the error channel carries it: the Node error code where there is one, and a message.
- Native
- A host over
std, reading console input fromRand writing console output toOandE.
Constants§
- MAX_
FILE_ SIZE_ BYTES - The most a file may hold to be read: one
Vec, which the language caps at 2^17 bytes (maxLengthBytesinfjs/types/bit_vec). Metadata can refuse a larger file before reading; the read also checks the bytes actually returned.
Functions§
- normalize
normalizeoffjs/path, for the paths a directory read answers:\is/, empty and.segments vanish,..cancels the segment before it or is kept where nothing is left to cancel, and a root,/,//or a drive’sC:/, stays and absorbs the..that would climb past it. A bareC:and the drive-relativeC:aare ordinary segments, as they are there.- resolve_
file_ module - The module
namenames, from the fileparent’s identity, or from the working directory where there is none: the real path and its identity. - run
- Performs
effectto its result.