brain
tamnd's digital brain — notes, problems, research
42734 notes
A single binary that is simultaneously a valid ELF, Mach-O, PE, and BSD a.out.
The Glasgow Haskell Compiler's native code generator: hand-written, x86_64 / aarch64 / risc-v, alongside an LLVM alternative.
The universal Unix object/executable format: Linux, *BSD, Solaris, Haiku, embedded.
Meta's typed Python subset that can be AOT-aware, the Cinder JIT, and CPython 3.13+'s experimental copy-and-patch JIT.
Single-page roll-up of every (target ISA x OS) combination Mochi MEP-42 could ship, with status and engineering complexity recommendations.
The .wasm container, plus the component model binary and WAT text format.
The most actively researched mid-tier compiler backend of the 2020s. ISLE for instruction selection, proof-carrying code for Wasm-sandbox memory accesses, and VeriISLE for verified instruction-lowering rules.
Apple's Swift in two modes: full LLVM-driven AOT for app platforms, and a stripped Embedded Swift mode for microcontrollers and freestanding binaries.
The cross-platform binary debug format, its current standard, and where the next version is going.
The Triton dialect (OpenAI, GPU codegen), the IREE dialect (Google, ML compiler), Mojo's MLIR-based KGEN compiler, and the broader trend of language frontends as MLIR dialects. The "if we wanted to be ambitious" backend story for Mochi.
Recent foundational work from POPL and its co-located CPP (Certified Programs and Proofs) workshop on verified compilation, secure calling conventions, and packet-filter codegen.
"How small can a useful native backend be?"
The lowest-cognitive-load path: emit C, let GCC/Clang do the rest.
"Mochi → Wasm → wasmtime compile → native": skip the backend, use the wasm ecosystem.
Multi-Level IR, dialect framework, the foundation under Mojo, IREE, and OpenXLA.
Recent work from the flagship PL conference on lightweight backends, baseline JIT design, superoptimization for stack bytecode, and library composition that sidesteps heavyweight compilation.
Direct syscalls on Linux, why this is impossible on macOS, and the APE alternative.
Static, GC-by-default systems language that emits C (or C++, JavaScript, LLVM) and inherits the host toolchain's optimiser.
JIT-first scientific language adding a real AOT path via juliac and a trimming-based static binary mechanism.
Tiny systems language built on QBE, deliberately constrained, BSD/Linux-only, manual memory.
cgo, c-shared, c-archive: keep vm3 in Go and call into it from native code.
One binary, six operating systems, two ISAs. The APE format and cosmocc toolchain.
Statically-typed Go-influenced language that defaults to emitting C, with experimental native and LLVM backends and a multi-mode memory model.
A 14k-LOC SSA compiler backend by Quentin Carbonneaux that targets x86-64, arm64, and riscv64 from a textual SSA IR. The "70% of LLVM in 10% of the code" pitch. The natural fallback if writing our own emitter feels too risky.
Go's internal assembler exported as a library, already used by Mochi's vm2jit.
Rui Ueyama's ~10k LOC C compiler that emits x86-64 GAS assembly directly from a recursive-descent parser. The clearest published example of a single-pass codegen pipeline that produces correct code with no IR, no SSA, no register allocator.
Mike Pall's preprocessor-driven assembler with runtime patching; LuaJIT's secret weapon.
GCC as a shared library, used by Emacs native compilation, GCC Rust, GDC, Cython.
Stencil-based binary stitching from OOPSLA 2021, now shipping in CPython 3.13/3.14.
The default Linux libc, and the reasons "fully static linking" is officially unsupported.
The general-purpose 64-bit RISC-V baseline plus vector and recent extensions.
The general pattern that Sparkplug, Liftoff, JSC Baseline, and the HotSpot template interpreter all instantiate. Per-op native template, fixed register convention, stub calls for slow paths, optional inline caches as patchable code regions.
The static-friendly C library that makes "build once, ship anywhere" actually work on Linux.
A converged design pattern across three independent implementations: per-opcode template emission, a virtual operand stack with lazy register promotion, no IR, no global optimization. The current state of the art in "fast and simple" Wasm code generation.
Wasm 3.0 (2025) as the stable target, plus WASI Preview 2/3 and the component model.
Survey of niche or specialized architectures that MEP-42 should be aware of but probably defer.
Windows 11 on Snapdragon X / X2 Elite, Surface Pro X lineage, and ARM64EC interop.
Emitting a self-contained executable from the compiler, no external linker required.
Systems language rebuilding its compiler around its own native backends, with LLVM demoted to an optional path.
Ruby-syntax statically-typed language with global type inference, LLVM backend, and Boehm GC.
Closed-world AOT compilation that turns a managed JVM application into a self-contained native executable.
Microsoft's production successor to CoreRT: trimmed CoreCLR plus RyuJIT-as-AOT, shipping single-file native binaries.
Tree-walk to tuples to native assembly. The textbook recipe from the Dragon Book and Cooper/Torczon, still the right starting point when you want correctness before performance.
Stencil-driven code generation that harvests pre-compiled opcode snippets at build time and stitches them into native code at runtime via relocation patches. No IR, no register allocator, no instruction selector. The technique CPython 3.13+ ships in production.
The historical Linux workhorse and its dying sibling.
The workhorse SSA infrastructure, version 20 era, evaluated for MEP-42.
Vladimir Makarov's lightweight JIT+AOT, fast compile times, lazy basic-block versioning.
Bytecode Alliance's Rust-native SSA backend, ISLE-driven, ~10x faster compile than LLVM.
Quentin Carbonneaux's deliberately tiny SSA backend, "70% of LLVM in 10% of the code."
The closed-source Mach-O linker that ships in Xcode 15 and later.
The default 64-bit Unix ABI: Linux, macOS, FreeBSD, OpenBSD, NetBSD, illumos.
The base 64-bit Arm calling standard, with Apple and Microsoft deltas called out.
The 4-register fast-call convention used by every Windows-on-AMD64 binary.
A single-pass, IR-free transpiler from Ignition bytecode to native machine code, designed to add a fast tier between an interpreter and an optimizer with minimal engineering cost.
Apple WebKit's original template-style baseline compiler, the longest-running production baseline JIT for a dynamic language, and the design template for every modern four-tier VM.
The fastest production ELF linker, single-author, MIT licensed.
One binary, four object formats, cross-link from any host.
Chrome Security's published per-quarter memory-safety data for 2024-2026, the JSON / PNG / fonts Rust rollouts, and the V8 sandbox.
MTE in a Managed Runtime
Single ownership with deterministic destruction, multiple simultaneous borrows allowed, runtime borrow-count enforcement. No GC, no compile-time borrow checker, no lifetime variables. Concurrency uses `uni T` (unique values) for safe inter-process transfer.
A Rust-like ownership system with simpler call-site syntax, taped onto a Python-shaped surface, sitting on MLIR, headed to open source in fall 2026.
A pragmatic language by Wouter van Oortmerssen that elides 95% of refcount ops at compile time through flow-typed lifetime analysis. Cycles handled by a cleanup at program exit.
The state of Rust's borrow checker as the Polonius "alpha" lands behind a nightly feature gate, and what a non-ownership language can still steal from it.
The voluntary US federal pledge that has set the de-facto industry baseline for memory-safety roadmaps.
What every shipping JIT must do on day 1 to be production-grade: never have a code page that is both writable and executable to the same thread at the same time.
The 2024-2026 industry picture on temporal memory safety, kernel mitigations, and the convergence of UAF defences.
Microsoft Research's SMT-backed Rust verifier, the leading tool for verified systems software at scale in 2025-2026.
The production-grade formally verified C compiler, the CompCertO / Owlang line, and why it matters for JIT verification.
Foundational separation-logic verification of Rust's safe / unsafe core, and its 2024-2026 RefinedRust successor.
Native GC primitives in a portable bytecode. Ratified in Wasm 3.0 (Sep 2025), shipped in all major browsers by Dec 2024. Dart, Kotlin, OCaml, Java/Scala/Scheme can now compile to Wasm without bundling a GC.
CHERIoT
MEP-41 Research Substrate: Memory Safety Advances 2023–May 2026
Linearity attached to function arrows, not to types. Backwards-compatible: ordinary code continues to type-check unchanged. Experimental since GHC 9.0; still labelled experimental in 9.12 / 9.15 (2024–2026).
A purely software in-process sandbox for the V8 JS heap. Ban raw pointers, replace with offsets into a 1 TB sandbox region and indices into out-of-sandbox pointer tables. About 1% perf cost, enabled by default in Chrome 123. Every modern JIT is moving this direction.
The White House Office of the National Cyber Director's memory-safety report and the C/C++-adverse federal stance.
Chrome's two cooperating collectors. Orinoco runs V8's young-generation JS heap in parallel; Oilpan is Blink's traced C++ GC, recently hosted inside V8 as a library, learning to do generational collection with conservative stack scanning.
Google's published 2022-2026 data on memory-safety progress — Android's 76% → <20% trajectory, the CVE-2025-48530 near-miss, the V8 sandbox.
MarkUs and quarantine-style UAF prevention
Speculative-execution attacks haven't gone away. As of May 2026, every shipping JIT either implements index masking + bounds-check hardening, or relies on process-level Site Isolation, or both.
Rust verification by functional translation: compile Rust to a pure lambda calculus, verify there.
The canonical industry data point on memory-safety vulnerability prevalence, and every follow-up through 2026.
The NSA's formal language-level guidance, the named-language list, and the joint CISA reissue.
Orthogonal modes layered onto OCaml's type system. Mode is a property of a value, separate from its type, tracked through inference. Production in Jane Street; open-sourced as OxCaml in 2025.
Stacked Borrows, the 2025 Tree Borrows replacement, and the trajectory of NLL / two-phase formalisation.
Intel CET Shadow Stack + IBT
The canonical "secure allocator inside a managed runtime." Scudo is Android's hardened native heap, used for ART's non-managed allocations (JIT code, off-heap buffers, JNI). Pairs with ARM MTE on Armv9 hardware for hardware-checked tagging.
The DoD's evolving acquisition posture on memory-safe languages, the SWFT framework, and aerospace coding standards.
Capability tracking in the type system. Each value's type may carry a capture set listing which capabilities it could reference. Foundation for capability-based effects, separation checking (System Capybara), and ownership for resources.
Iris-based separation logics with space credits, tracing GC, and the 2025 IrisFit + Nextgen-Modality lines.
WebKit's retreating-wavefront concurrent garbage collector. Marks objects while JS runs, throttles allocation when it falls behind, and uses logical versioning to skip clearing bitmaps.
"Garbage-free" precise reference counting with reuse — in-place updates without locks, statically inserted at compile time.
A WebAssembly extension that replaces linear memory with segments and handles. Handles are unforgeable, typed pointers carrying bounds and provenance — closely modelled on CHERI capabilities but pure software.
A research framework that cleanly separates GC plans from policies, plus the LXR collector that proves a stop-the-world RC+mark-region design can beat industrial concurrent GCs on tail latency.
The direct intellectual ancestor of vm3's handle design: a per-allocation generation counter, a per-reference remembered generation, and a check on every dereference. Same idea, different layer.
Arm Morello
Microsoft Research's experimental concurrent-ownership language. Ownership is over **regions** (groups of objects) instead of individual objects. Cowns (concurrent owners) serialise access; behaviours schedule work over multiple cowns atomically.
CHERI (Next Generation)
Strict linear types as the load-bearing primitive for memory and protocol safety, plus capability-based effect control. Spec-and-compiler-small enough to read in a weekend.
Swift 6.x has shipped a complete move-only/noncopyable system layered on top of ARC. Parameter conventions are explicit; the law of exclusivity (Swift's variant from 2017) supplies the static aliasing discipline.
Arm MTE