Symbolic Assembly: Using Clojure to Meta-program Bytecode
summary
Describes a REPL-driven, functional approach that represents CLR bytecode as data so Clojure code generates and transforms it before a single mutable emit step. Uses Mage as a symbolic MSIL layer and MAGIC as a compiler that compiles Clojure to the CLR for the Arcadia/Unity workflow, cutting about 52 bytes of per-call garbage and eliminating ~26KB per frame in one example. Shows extensible optimizations, intrinsics, and a new Simba LLVM emitter that proves the approach works and produces real, faster machine code.
AI-written summary · about
chapters (35)
- 0:00Introduction
- 0:18Who am I
- 0:34TDD
- 1:27Metaprogram Bytecode
- 3:12Who does Compiler Work
- 3:48This is not a fluke
- 4:18Pain of developing compilers
- 5:01C compiler example
- 6:19Two hard problems
- 6:36General idea
- 7:42Mage
- 9:06Why Clojure
- 9:35Closure
- 10:09Arcadia
- 10:36Proc Skater
- 11:19Real Bytecode
- 13:14Symbolic Bytecode
- 16:17EjectBang
- 17:17Labels
- 19:28State
- 20:38Code Generation
- 22:31Magic
- 23:35Compiler Architecture
- 24:40Analyzer Architecture
- 25:24Symbolism
- 26:32Hashmap
- 28:29Do
- 32:35Optimizations
- 33:30Intrinsic Map
- 34:32Using Closure
- 34:48Using Magic
- 36:10Inner Loop Closure
- 37:05Future Work
- 37:44LLVM Module
- 39:34Outro
related talks
40mBuilding My First Lisp Compiler
33mThe Language of the Language: Comparing compiler construction in Clojure and F#
01h 04mClojure Compilation, Backwards
40mJoy of Meta-Tracing Just-in-Time Compilation: More Than Just a VM Generator
42mClojure Futures
53mFROM SCALA TO ASSEMBLY THE COST OF ABSTACTION REVISITED
37mAssembling
55mNew Bytecodes, New Objects
