pub struct CompilerConfig {
pub external_builtins: Vec<ExternalBuiltin>,
pub library_paths: Vec<String>,
pub libraries: Vec<String>,
pub ffi_manifest_paths: Vec<PathBuf>,
pub pure_inline_test: bool,
pub optimization_level: OptimizationLevel,
pub instrument: bool,
}Expand description
Configuration for the Seq compiler
Allows external projects to extend the compiler with additional builtins and configuration options.
Fields§
§external_builtins: Vec<ExternalBuiltin>External builtins to include in compilation
library_paths: Vec<String>Additional library paths for linking
libraries: Vec<String>Additional libraries to link
ffi_manifest_paths: Vec<PathBuf>External FFI manifest paths to load
These manifests are loaded in addition to any include ffi:* statements
in the source code. Use this to provide custom FFI bindings without
embedding them in the compiler.
pure_inline_test: boolPure inline test mode: bypass scheduler, return top of stack as exit code. Only supports inline operations (integers, arithmetic, stack ops). Used for testing and benchmarking pure computation without FFI overhead.
optimization_level: OptimizationLevelOptimization level for clang compilation
instrument: boolBake per-word atomic call counters into the binary.
When true, each word entry point gets an atomicrmw add counter.
Use with SEQ_REPORT=words to see call counts at exit.
Implementations§
Source§impl CompilerConfig
impl CompilerConfig
Sourcepub fn with_builtin(self, builtin: ExternalBuiltin) -> Self
pub fn with_builtin(self, builtin: ExternalBuiltin) -> Self
Add an external builtin (builder pattern)
Sourcepub fn with_builtins(
self,
builtins: impl IntoIterator<Item = ExternalBuiltin>,
) -> Self
pub fn with_builtins( self, builtins: impl IntoIterator<Item = ExternalBuiltin>, ) -> Self
Add multiple external builtins
Sourcepub fn with_library_path(self, path: impl Into<String>) -> Self
pub fn with_library_path(self, path: impl Into<String>) -> Self
Add a library path for linking
Sourcepub fn with_library(self, lib: impl Into<String>) -> Self
pub fn with_library(self, lib: impl Into<String>) -> Self
Add a library to link
Sourcepub fn with_ffi_manifest(self, path: impl Into<PathBuf>) -> Self
pub fn with_ffi_manifest(self, path: impl Into<PathBuf>) -> Self
Add an external FFI manifest path
The manifest will be loaded and its functions made available
during compilation, in addition to any include ffi:* statements.
Sourcepub fn with_ffi_manifests(
self,
paths: impl IntoIterator<Item = PathBuf>,
) -> Self
pub fn with_ffi_manifests( self, paths: impl IntoIterator<Item = PathBuf>, ) -> Self
Add multiple external FFI manifest paths
Sourcepub fn with_optimization_level(self, level: OptimizationLevel) -> Self
pub fn with_optimization_level(self, level: OptimizationLevel) -> Self
Set the optimization level for compilation
Sourcepub fn external_names(&self) -> Vec<&str>
pub fn external_names(&self) -> Vec<&str>
Get seq names of all external builtins (for AST validation)
Trait Implementations§
Source§impl Clone for CompilerConfig
impl Clone for CompilerConfig
Source§fn clone(&self) -> CompilerConfig
fn clone(&self) -> CompilerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more