Expand description
Which runtime module runs which script language.
A script host is a runtime module like any other. What makes it a host is
a descriptor beside it, lumen-language.toml, which names the language it
runs, the file extensions that language owns, and the form it runs a
program in:
[language]
name = "candela"
extensions = ["cdl"]
form = "bytecode" # or "source"
default = true # the language an inline `<script>` block is read asOne language can have two providers: one that runs source, with a compiler and hot reload, for the edit loop, and one that runs bytecode compiled ahead of time, for a shipped app. A language with a single source-form provider runs from source everywhere.
The descriptors are found where bundled modules are: modules/<name>/
under the directories a toolchain ships them in, and the crate under
std/ of a source checkout. Nothing here names a language.
Structs§
- Grouped
Script - One language’s whole program.
- Language
Provider - One module’s claim to run a language.
- Language
Table - Every language provider in reach, and the questions an app assembly asks of them.
- Script
File - One external script file an app’s markup names.
- Script
Grouping - Which language each part of an app’s script belongs to.
Enums§
- Form
- The form a provider runs a program in.
Constants§
- BUNDLED_
MODULE_ DIR - The directory a toolchain keeps its bundled modules’ files in, beside its binaries.
- DESCRIPTOR
- The descriptor’s file name, in a module’s directory.
Functions§
- parse_
descriptor - Read the descriptor
textof the modulemodule. - with_
implied depswith a bundled entry added for each module inmodulesit does not already declare: the host modules an app needs, loaded the way a declared module is.
Type Aliases§
- Grouped
Scripts - An app’s scripts split by the language that runs them: one entry per language, each holding that language’s whole program, sorted by language name. Empty when the app ships no script.