Skip to main content

Module language

Module language 

Source
Expand description

Script languages as host modules register them, and the table that reaches an installed host. See language::ScriptLanguage. Script languages, as the app sees them: a registry each host fills in.

The engine runs scripts without knowing any language. A host lives in a runtime module of its own; installing that module registers a ScriptLanguage here, under the language’s name, and the app assembly reaches the host only through the entries of that record: install a program, swap it on a hot reload, check or compile one ahead of time, read the markup blocks a script writes, and reach the installed host’s signals and functions.

Which module provides which language, and for which file extensions, is the module’s own descriptor (lumen-language.toml), read by lumen_modules::language. Nothing here, and nothing in the engine, names a language.

Structs§

MarkupBlock
One markup block a script writes: a fragment of markup a script instantiates by key, read out of the script before anything runs.
MarkupBlockError
A markup block the language could not read.
ScriptCompile
What an ahead-of-time check or compile is done against: the same things a run hands the host, plus the functions and sources the app’s modules register, declared but never called.
ScriptHostAccess
Reaching an installed host, in the terms a caller asks in.
ScriptLanguage
One script language, as a host module registers it.
ScriptLanguages
The languages the app’s host modules registered, in registration order.
ScriptProgram
One program, handed to a host to run.
UnknownLanguage
No host is registered for the language a program names.

Traits§

ScriptLanguageAppExt
Registering a script language on an App.

Functions§

install_program
Install the host registered for language over program, and return the table that reaches it.
line_col
The 1-based line and column of byte offset in src.

Type Aliases§

CheckFn
Compile-check a program without running it: (source, against).
CompileFn
Compile a program to bytecode: (source, against), giving the image and the compiler’s warnings, one line each.
ImageExportsFn
The names a bytecode image can be called by, with fns bound beside the builtins and none of them called.
InstallFn
Install a host over a program. multi_host is true when the app runs more than one language, which a host needs to keep its signal mirror current with the others.
MarkupBlocksFn
Read the markup blocks a script writes.
ReloadFn
Swap a live host’s program for a hot reload: (world, source, uri, map), map saying where each piece of source was read from. None when the host is not installed.