lesson 14 / 15
Entry points and embedding
main is only a convention used by this tutorial. An embedding project can choose another entrypoint, such as build, prepare, or package.
The reference interpreter follows this general flow:
- Tokenize the source.
- Parse tokens into an abstract syntax tree.
- Create an execution context.
- Load variables and functions into that context.
- Execute the selected function.
The execution context contains variables, functions, the current directory, and optional hooks. Hooks let a project provide behavior that should not be part of the language itself, such as process execution, macros, logging, or a virtual filesystem.
This separation is what lets the same language work in kpkg, Jumpstart, and a browser tutorial with different capabilities.
