Skip to main content

Module language

Module language 

Source
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 as

One 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§

GroupedScript
One language’s whole program.
LanguageProvider
One module’s claim to run a language.
LanguageTable
Every language provider in reach, and the questions an app assembly asks of them.
ScriptFile
One external script file an app’s markup names.
ScriptGrouping
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 text of the module module.
with_implied
deps with a bundled entry added for each module in modules it does not already declare: the host modules an app needs, loaded the way a declared module is.

Type Aliases§

GroupedScripts
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.