Making EDSLs fly
summary
Implements a typed EDSL in Haskell with both shallow vs deep embedding, builds a deep AST interpreter and an LLVM JIT code generation backend, and measures performance: shallow direct Haskell run ~3.7s, deep-interpreter ~15s, generated machine code ~0.3s on a 3-asset, 10 million-iteration benchmark. Details include straight-line codegen for small asset lookup, handling of typed lifting, conditionals and SSA phi joins, and a working JIT that yields an order-of-magnitude speedup.
AI-written summary · about
chapters (11)
- 0:00Start
- 4:54Observed Functions
- 6:46Shallow Embedding
- 7:32Date and Asset Types
- 8:25Assets
- 8:52Implementation of the Shallow Embedding
- 11:46The Deep Embedding in Haskell
- 23:57Deep Embedding
- 27:47What Is the Llvm
- 38:30Conditionals
- 39:13Conditional Branch Instruction








