rename crates/ to engrams/; add el-compiler el package with bootstrap artifact
- crates/ → engrams/ (Rust engrams live here)
- el-compiler/ added: el self-hosting compiler as an el package
- src/{compiler,lexer,parser,codegen}.el
- bootstrap/el-compiler.elc (114KB, Rust-compiled seed)
- el.toml Cargo.toml workspace paths updated
- neuron-rs cross-repo path deps fixed (were pointing to products/ instead of foundation/)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
// compiler.el — el self-hosting compiler pipeline
|
||||
//
|
||||
// Wires lexer -> parser -> codegen into a single compile() function.
|
||||
// This is the bootstrap entry point: compiled once by the Rust el-compiler,
|
||||
// then self-hosted from that point forward.
|
||||
//
|
||||
// The returned JSON is an array of bytecode instruction objects matching
|
||||
// the serde serialisation format of el-compiler's Bytecode enum.
|
||||
|
||||
import "lexer.el"
|
||||
import "parser.el"
|
||||
import "codegen.el"
|
||||
|
||||
// compile — full pipeline: source string -> JSON bytecode string
|
||||
fn compile(source: String) -> String {
|
||||
let tokens: [Map<String, Any>] = lex(source)
|
||||
let stmts: [Map<String, Any>] = parse(tokens)
|
||||
codegen(stmts, source)
|
||||
}
|
||||
Reference in New Issue
Block a user