Engine Lang is an open, unowned, statically typed systems programming language that unifies computation, persistent memory (Single-Level Store), and distributed causal replication into a single compilation unit. Released under the Apache 2.0 License as a sovereign digital public good for human developers and AI agents alike.
π Official Book: Read From the Silicon Island to the Causal Cosmos by Lysander Vance β exploring software from a single-node memory ledger to global causal mesh networks.
For five decades, enterprise software architecture has been trapped in the Von Neumann memory-storage duality. In the 1970s, RAM was microscopic, volatile, and expensive, while magnetic disk drives were slow, mechanical, and block-oriented. This historical limitation forced computing to bifurcate into two decoupled worlds: volatile runtime code and external persistent storage.
To bridge this synthetic divide in modern distributed systems, the software industry invented what we designate as the Cloud Fragmentation Tax:
THE LEGACY FRAGMENTED ENTERPRISE STACK
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. Application Process (FastAPI / Node / Go / Spring / Rust)β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 2. Reverse Proxy / Ingress Gateway (Nginx / Envoy / Traefik)β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 3. Object-Relational Mapper (Hibernate / Prisma / SQLAlchemyβ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 4. Relational Database (PostgreSQL / MySQL / Oracle RAC) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 5. Ephemeral In-Memory Cache (Redis / KeyDB / Memcached) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 6. Message Broker / Streaming Queue (Kafka / RabbitMQ / SQS)β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 7. Specialized Vector Database (Pinecone / Milvus / Qdrant) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 8. Consensus & Service Discovery (Consul / Zookeeper / Raft)β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 9. Distributed Orchestration (Kubernetes / Helm / Istio) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 10. Proprietary Hyperscaler Cloud Billing (AWS / GCP / Azure)β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Every single boundary between these 10 layers incurs:
- Massive Latency Overhead: Up to 30% of total CPU cycles in microservices are burned serializing and deserializing JSON, Protobuf, and SQL strings.
- Cross-AZ Transit Fees: Corporations pay hundreds of thousands of dollars each month simply transmitting identical payloads back and forth between virtual machines within the same physical data center.
- Cascading Failure Modes: If any one service suffers a connection pool exhaustion, deadlock, or network partition, the entire application collapses.
- Anti-Competitive Lock-In: Proprietary managed database triggers, Lambdas, and serverless queues artificially lock enterprises into hyperscaler clouds.
With the arrival of Byte-Addressable Non-Volatile RAM (NVRAM), Compute Express Link (CXL) buses, multi-hundred-gigabit network fabrics, and advanced SMT solvers (Z3), the separation between memory and database is an obsolete historical accident.
Engine Lang collapses the entire operational stack into the compiled binary itself:
THE ENGINE LANG ARCHITECTURE: UNIFIED SILICON COMPUTATION
[ Edge Client / Traffic ]
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ENGINE LANG COMPILED BINARY (`enginec`) β
β β
β βββββββββββββββββββββββββ βββββββββββββββββββββββββββ β
β β HTTP/gRPC `@boundary` β β P2P Causal Mesh (QUIC) β β
β ββββββββββββ¬βββββββββββββ ββββββββββββββ¬βββββββββββββ β
β β β β
β βΌ βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Deterministic LL(1) Operator Matrix & Pipeline (`|>`, `?!`)β β
β ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Compile-Time SMT Invariants & Refinement Proofs (`where`) β β
β ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Single-Level Store (SLS) on NVRAM / CXL.mem (`@persistent`)β β
β β (Direct Access DAX, Cache-Line Flush `clwb` + `sfence`) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
(Raw Linux VPS / Bare Metal / Edge)
No external database. No Redis cache. No Kafka broker. No ORM. Memory is storage.
| Pillar | Mechanism | Silicon & Runtime Mapping |
|---|---|---|
| 1. Single-Level Store (SLS) | @persistent entity declarations live directly in a unified 64-bit virtual address space backed by NVRAM/CXL. |
Direct Access (DAX) without kernel page cache copy. Atomic commits compile to hardware clwb + sfence instructions. |
| 2. Deterministic Operator Matrix | Closed, strictly ordered 14-level precedence table (ENG-SPEC-03.1). Zero dynamic syntax, zero LL(1) backtracking. |
SIMD vector math (@*, <=>), pipeline composition (` |
| 3. Formal SMT Refinements | Compile-time semantic verification using integrated Z3 SMT solver. Type refinement bounds (where) are mathematical theorems. |
If an invariant can be broken by any execution path, compilation halts with a formal counterexample. |
| 4. Zero-Downtime LSE-CRC | Lazy Structural Evolution with Causal Redirection. Schemas evolve without stopping or re-indexing physical memory. | Old layout nodes coexist with new layouts. Fields synthesize defaults in CPU registers on read; writes reallocate. |
| 5. Distributed Causal Mesh | Conflict-Free Replicated Data Types (CRDTs) and causal vector timestamps replicated peer-to-peer. | Native QUIC/RDMA transport with automatic partition recovery and zero central master nodes. |
module Logistics::Fleet;
// Type Refinement verified at compile time via Z3 SMT
type PlateNumber = Text where len(value) == 7 && is_alphanumeric(value);
type Money = Decimal(18, 4) where value >= 0.0000;
// Persistent entity mapped directly to NVRAM
@persistent
@TenantGuard(strict: true)
entity Vehicle {
id: UUIDv7,
plate: PlateNumber,
model: Text,
year: Int where value >= 1900 && value <= 2100,
market_value: Money,
ipva_records: List<TaxAssessment>,
embedding: Vector(1536),
// Domain invariant proven by SMT solver
invariant {
self.market_value >= 0.0000 &&
len(self.plate) == 7
}
}
// Atomic transaction with hardware persistence
action register_tax(vehicle: &mut Vehicle, assessment: TaxAssessment) -> Result<(), Error> {
atomic {
vehicle.ipva_records.push(assessment);
vehicle.market_value = assessment.depreciated_value?!;
// Emits CLWB and SFENCE automatically at block boundary
}
return Ok(());
}
action find_similar_vehicles(query_vector: Vector(1536)) -> List<Vehicle> {
return Vehicle.query()
.filter(v => (v.embedding <=> query_vector) >= 0.8500)
|> order_by_descending(v => v.embedding <=> query_vector)
|> limit(10);
}
engine-lang/
βββ .github/
β βββ ISSUE_TEMPLATE/
β β βββ bug_report.md
β β βββ rfc_proposal.md
β βββ workflows/
β βββ ci.yml # Automated compiler build and container verification
β βββ release.yml # Cross-compilation & artifact release pipeline
βββ book/ # The Book of Engine Lang by Lysander Vance (14 Chapters & Appendices)
β βββ SUMMARY.md # Complete Table of Contents
β βββ src/ # 14 authoritative engineering chapters & appendices
βββ docs/
β βββ SPECIFICATION.md # EBNF grammar, directives, ADTs, boundary FFI
β βββ OPERATORS.md # 14-level operator matrix & SMT algebraic contracts
β βββ ENGINE_DB_SLS_LAYOUT.md# Binary specification of .db SLS containers (CRC64-NVME)
β βββ ENG_SILICON_CODEGEN_SPEC.md # Direct silicon codegen & Zero-UB ABI specification (ENG-CG-01.1)
β βββ BARE_METAL_UNIKERNEL_SPEC.md# Sovereign bare-metal OS & UEFI unikernel spec (ENG-OS-01.1)
β βββ CONFRONTING_THE_LISP_TRAP.md# Rebuttal of the Lisp Trap: empirical codebase confrontation (ENG-TRAP-01.1)
β βββ SCHEMA_EVOLUTION.md # Lazy structural evolution protocol (LSE-CRC)
β βββ MEMORY_MODEL.md # Causal memory consistency model & hardware flushes
β βββ DISTRIBUTED_MESH_WIRE.md# P2P wire protocol (engine-wire) & Delta-CRDT sync
β βββ MODULES_AND_PACKAGES.md# Package manager (engine-pkg) & 4-tier visibility
β βββ REFINEMENT_TYPES_SMT.md# SMT refinement theory, VC generation & timeouts
β βββ FFI_AND_SYSTEM_BRIDGE.md# POSIX C FFI & embedded PostgreSQL wire bridge
β βββ ENGINE_VS_RUST_PARADIGM.md# Comprehensive architectural confrontation with Rust
β βββ USE_CASES.md # Killer use cases, business domains & cost analysis
β βββ BRANDING_AND_IP.md # Official branding, nomenclature and patent guidelines
β βββ ROADMAP.md # Full lifecycle engineering roadmap (Phases 1 through 7)
βββ compiler/ # Reference bootstrap compiler (enginec) in Rust
β βββ Cargo.toml
β βββ src/
β βββ main.rs # CLI entry point (check, run, inspect, build, fmt, mesh, etc.)
β βββ ast.rs # Complete Abstract Syntax Tree definitions
β βββ lexer.rs # Deterministic LL(1) tokenization engine
β βββ parser.rs # Recursive-descent LL(1) parser
β βββ smt.rs # Symbolic translation & Z3 SMT-LIB2 verification layer
β βββ memory.rs # Raw Engine DB superblock, journal, and entity layouts
β βββ interpreter.rs # Runtime evaluation & causal simulation engine
β βββ bridge.rs # Embedded PostgreSQL v3.0 wire protocol responder
β βββ web.rs # Embedded HTTP boundary runtime & SLS visualizer
β βββ codegen.rs # Target-native LLVM IR & silicon assembly emitter with SIMD
β βββ tooling.rs # Developer tooling: formatter, static linter & LSP daemon
β βββ mesh.rs # Planetary causal mesh & Delta-CRDT vector clocks
β βββ unikernel.rs # UEFI PE32+ bare-metal bootloader image builder
βββ examples/ # Standard library of 13 canonical .eng examples
β βββ 01_hello_causal.eng # Basic atomic mutation and causal logging
β βββ 02_persistent_vehicle_fleet.eng # Fleet management with SMT refinement invariants
β βββ 03_vector_ai_search.eng# Native 1536-dim vector cosine search (<=>)
β βββ 04_causal_blog.eng # Complete transactional blog engine with auth
β βββ 05_polyglot_industrial_iot.eng # Dual-layer SLS write-through caching
β βββ 06_industrial_plc_mmio.eng # Hardware MMIO (@mmio) with hard real-time bounds
β βββ 12_c_cpp_assembly_confrontation.eng # Zero-UB confrontation example
βββ Engine.toml # Workspace manifest & memory engine configuration
βββ msr.json # MSR JSON 2.1 open protocol metadata manifest
βββ CHANGELOG.md # Keep a Changelog 1.1.0 specification history
βββ BACKLOG.md # Production readiness gates & defect registry
βββ RELEASING.md # Systems-grade release engineering handbook
βββ CONTRIBUTING.md # RFC process, proof guidelines & coding standards
βββ CODE_OF_CONDUCT.md # Contributor Covenant v2.1 code of conduct
βββ SECURITY.md # Responsible security disclosure policy
βββ LICENSE # Apache License 2.0
βββ docker-compose.yml # Genesis multi-service cluster definition
βββ Dockerfile # Multi-stage release compiler & runtime container
βββ README.md # This engineering manifesto
For developers exploring or contributing to the codebase, Engine Lang is systematically partitioned into five distinct, decoupled layers:
| Layer | System Domain | Key Source Components | Primary Specifications |
|---|---|---|---|
| Layer 1 | Deterministic Syntax & Formal SMT Invariants | compiler/src/lexer.rscompiler/src/parser.rscompiler/src/smt.rsexamples/*.eng |
docs/SPECIFICATION.mddocs/OPERATORS.mddocs/REFINEMENT_TYPES_SMT.md |
| Layer 2 | Single-Level Store (SLS) Memory Engine | compiler/src/memory.rsdata/engine.db |
docs/ENGINE_DB_SLS_LAYOUT.mddocs/MEMORY_MODEL.mddocs/SCHEMA_EVOLUTION.md |
| Layer 3 | Causal Wire Mesh & Polyglot Protocols | compiler/src/mesh.rscompiler/src/bridge.rscompiler/src/web.rs |
docs/DISTRIBUTED_MESH_WIRE.mddocs/FFI_AND_SYSTEM_BRIDGE.md |
| Layer 4 | Direct Silicon Codegen & Sovereign Unikernel | compiler/src/codegen.rscompiler/src/unikernel.rs |
docs/ENG_SILICON_CODEGEN_SPEC.mddocs/BARE_METAL_UNIKERNEL_SPEC.md |
| Layer 5 | Genesis Toolchain & Developer Experience | compiler/src/main.rscompiler/src/tooling.rsDockerfiledocker-compose.yml |
CONTRIBUTING.mdRELEASING.mdmsr.json |
Developers can build and run Engine Lang immediately using either the Host Rust Toolchain or the Docker Genesis Container.
The Genesis Node container encapsulates the reference compiler, Z3 theorem prover headers, persistent storage, and exposed network bridges.
# 1. Clone the repository
git clone https://github.com/msrjson/engine-lang.git
cd engine-lang
# 2. Launch the genesis node service
docker compose up -d
# 3. Verify toolchain diagnostics & formal proof of canonical blog
docker exec engine-genesis-node sh -lc 'enginec version && enginec check /app/examples/04_causal_blog.eng'
# 4. Inspect the running Single-Level Store (.db)
docker exec engine-genesis-node sh -lc 'enginec inspect /app/data/engine.db'
# 5. Access the embedded services
# - Web Gateway & SLS Visualizer: http://localhost:8090
# - PostgreSQL Wire Bridge: localhost:5442 (user: engine, db: engine_sls)
# - Causal Mesh Wire Protocol: localhost:9443Requires Rust 1.80+ and Z3 Theorem Prover 4.12+ (z3, libz3-dev).
# Debian / Ubuntu prerequisite installation:
sudo apt-get update && sudo apt-get install -y z3 libz3-dev pkg-config build-essential
# Build the release compiler binary:
cd compiler
cargo build --release
# Symlink or install binary onto your PATH:
sudo ln -sf $(pwd)/target/release/enginec /usr/local/bin/enginec
# Verify compilation:
enginec version
enginec check ../examples/01_hello_causal.engThis repository includes a fully configured .devcontainer/devcontainer.json. Simply open this folder in VS Code with the Remote - Containers extension or launch a GitHub Codespace to receive a pre-configured environment with rust-analyzer, z3, and automated formatting on save.
| Command | Purpose | Lifecycle Phase |
|---|---|---|
enginec version [--json] |
Displays comprehensive version, SMT prover, and specification diagnostics | Toolchain Standard |
enginec check <file.eng> |
Deterministic LL(1) parse and compile-time Z3 SMT formal verification | Phase 2 (SMT) |
enginec run <file.eng> [--db <path>] |
Executes application logic bound to persistent Single-Level Store | Phase 2 (Runtime) |
enginec inspect <path.db> |
Validates physical binary layout, Superblock, and CRC-64/NVME checksum | Phase 1 (SLS) |
enginec init-db [--path <path>] |
Formats a crash-consistent 64-byte aligned SLS container (.db) |
Phase 1 (SLS) |
enginec bridge [--port 5432] |
Starts embedded PostgreSQL v3.0 protocol responder for DBeaver/psql | Phase 2 (Bridge) |
enginec serve [--http-port 8090] |
Concurrently launches Web visualizer gateway and PostgreSQL bridge | Phase 2 (Serve) |
enginec emit-ir <file.eng> |
Emits target-independent LLVM IR with clwb and sfence intrinsics |
Phase 4 (Codegen) |
enginec emit-asm <file.eng> |
Synthesizes pure native assembly (.s) with AVX2 SIMD <=> acceleration |
Phase 4 (Codegen) |
enginec build <file.eng> |
Ahead-of-time (AOT) builds a native standalone silicon binary | Phase 4 (AOT) |
enginec fmt <file.eng> [--write] |
Deterministically formats .eng source code into canonical styling |
Phase 3 (DX) |
enginec lint <file.eng> |
Static linter checking refinement bounds, durability, and style rules | Phase 3 (DX) |
enginec lsp |
Runs Language Server Protocol (LSP 3.17) daemon over stdio | Phase 3 (DX) |
enginec mesh [--node-id <id>] |
Connects to Planetary Causal Mesh node with Delta-CRDT vector clocks | Phase 6 (Mesh) |
enginec boot-image [--output <efi>] |
Generates freestanding UEFI 2.10 PE32+ image (engine-boot.efi) |
Phase 7 (Unikernel) |
Engine Lang is not another framework; it is an open-specification movement to reclaim sovereign, hyper-efficient computing. We invite:
- Compiler Engineers: Help expand LLVM code-generation backends targeting native x86-64
clwb/sfenceand ARM64DC CVAP. - Distributed Systems Researchers: Refine our P2P causal mesh, CRDT delta synchronizers, and RDMA zero-copy network transports.
- Formal Verification Mathematicians: Broaden our SMT translation layer (
compiler/src/smt.rs) to support automated termination analysis and inductive invariants. - Systems Programmers: Stress-test the Single-Level Store file format against abrupt power failures and kernel panic simulations.
Review our CONTRIBUTING.md and submit your first RFC today.
Licensed under the Apache License, Version 2.0 (LICENSE). You may reproduce, distribute, and modify this work in compliance with the License.