pub struct CompileOptions {
pub source_dir: Option<PathBuf>,
pub lib_paths: Vec<PathBuf>,
pub required_outputs: Vec<String>,
pub strict: bool,
pub context: String,
pub cursor_limit: Option<u64>,
pub ledger: Option<Arc<CompileLedger>>,
pub resources: Option<ResourceScope>,
pub engine: Engine,
pub input_variance: InputVariance,
pub inferred_externs: Vec<String>,
}Expand description
The options every entry point compiles under. A host that names none gets the defaults: no source directory, no library paths, every binding an output, lax typing, the default context label, no cursor limit, and the most compiled engine this build has.
strict refuses what lax compilation warns about, on every engine:
an implicit type coercion, a config wire fed from a cycle-time
source, a nondeterministic node no volatile output acknowledges, a
binding nothing reads, an undeclared coordinate, and a positional
module argument. It is also pragma strict at the program’s top
scope (polydat_grammar.md §14): strict value checks, strict type
checks, and strict name checking hold in the program and in every
scope that inherits its pragmas, and a module body follows its own
pragmas alone.
engine is a preference, and the only place a caller expresses
one. Leaving it alone is the normative path: Engine::default is
the most native form the build offers (native code with the jit
feature, the closure tier without), so a host that never mentions
the field still gets compiled code, and gets faster code for free
when a build gains a tier. Naming an engine is for testing,
measurement, and demonstration — a differential test that wants the
interpreter as the reference, a bench that walks the tiers. A
preference the build cannot realize is refused
(crate::KernelError::Refused) rather than silently replaced, and
every kernel reports what it actually runs through
crate::Kernel::engine.
Fields§
§source_dir: Option<PathBuf>The directory relative data-file paths resolve against.
lib_paths: Vec<PathBuf>Library search paths, tried after the source directory and before the embedded standard library.
required_outputs: Vec<String>The outputs to keep; every output when empty.
strict: boolWhether to enforce strict validation, pragma strict at the
program’s top scope included.
context: StringThe diagnostic context label, such as a file name.
cursor_limit: Option<u64>A limit on every cursor’s extent, if any.
ledger: Option<Arc<CompileLedger>>The compile ledger to record this program tree in: a host that
holds one charges the compile to it; None mints a fresh one,
read back through the kernel’s ledger().
resources: Option<ResourceScope>The resource scope of the program tree: a host that holds one,
with or without an accessor installed, hands it here; None
gives the tree a fresh, empty one, read back through the
kernel’s resources() and installable there.
engine: EngineThe engine to build on. Defaults to Engine::default, the
most native form this build has; see the type’s documentation
for when to set it and what happens when it cannot be realized.
input_variance: InputVarianceWhat the compiler does with an input whose type the author did
not declare (input_variance.md §4). The default, Fixed, makes
the inferred type the input’s and refuses a write of another
type.
inferred_externs: Vec<String>Externs whose declared type the caller inferred rather than the
author wrote: the ones a program synthesizer emitted, such as a
scope builder’s result and write-through externs. They are open
to input_variance as an auto-extern is (input_variance.md §3).
Trait Implementations§
Source§impl Clone for CompileOptions
impl Clone for CompileOptions
Source§impl Debug for CompileOptions
impl Debug for CompileOptions
Auto Trait Implementations§
impl !RefUnwindSafe for CompileOptions
impl !UnwindSafe for CompileOptions
impl Freeze for CompileOptions
impl Send for CompileOptions
impl Sync for CompileOptions
impl Unpin for CompileOptions
impl UnsafeUnpin for CompileOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more