exec
Convenience helpers for the common “compile if needed, cache, then execute” workflow.
Functions
run path :app? :prelude? :inject?
Compile path in script mode if needed, cache the bytecode, and execute it.
app scopes the cache directory under fs.cache_dir(). When omitted, the
scope defaults from shell.program.
prelude is passed through to compile.compile.
inject supplies globally scoped symbol/value bindings during compilation
and execution.
Example
import exec
exec.run "./tool.dol"
exec.run "./tool.dol" app: "my-tool"
exec.run "./tool.dol" inject: {answer: 42}
module path :name? :app? :prelude? :inject?
Compile path in module mode if needed, cache the bytecode, and return the
loaded module object.
name defaults to the source file stem when omitted.
app scopes the cache directory under fs.cache_dir(). When omitted, the
scope defaults from shell.program.
prelude is passed through to compile.compile.
inject supplies globally scoped symbol/value bindings during compilation
and execution.