Avail Builder
An AvailBuilder compiles and installs into an Avail runtime a target module and each of its dependencies.
Author
Todd L Smith
Leslie Schultz
Mark van Gulik
Parameters
The AvailRuntime in which to load modules and execute commands.
Types
An EntryPoint represents a compiled command. It is used to disambiguate commands.
A LoadedModule holds state about what the builder knows about a currently loaded Avail module.
Properties
How to handle problems during a build.
A Graph of ResolvedModuleNames, representing the relationships between all modules currently loaded or involved in the current build action. Modules are only added here after they have been locally traced successfully.
A function for polling for abort requests.
true iff the current build should stop, false otherwise.
The reason why the current build should stop, or null if a stop is not currently requested.
The text interface for the builder and downstream components.
Functions
Attempt to unambiguously parse a command. Each currently loaded module that defines at least one entry point takes a shot at parsing the command. If more than one is successful, report the ambiguity via the onFailure continuation. If none are successful, report the failure. If there was exactly one, compile it into a function and invoke it in a new fiber. If the function evaluation succeeds, run the onSuccess continuation with the function's result, except that if the function has static type ⊤ always pass nil instead of the actual value returned by the function. If the function evaluation failed, report the failure.
Build the target and its dependencies.
Check any invariants of the builder that should hold when it is idle.
Generate Stacks documentation for the target and its dependencies.
Generate a graph.
Look up the currently loaded module with the specified resolved module name. Return null if the module is not currently loaded.
Return a list of modules that are currently loaded. The returned list is a snapshot of the state and does not change due to subsequent loads or unloads.
Record a new party to notify about module loading and unloading.
Scan all module files in all visible source directories, passing each ResolvedModuleName and corresponding ModuleVersion to the provided function.
Unload the target module and its dependents. If null is provided, unload all modules.
No longer notify the specified party about module loading and unloading.