Rapid Programming Language Prototypes with Ruby RACC
summary
Argues that RACC (the Ruby RACC pass generator) lets you prototype compilers faster than yak/bison by keeping everything in Ruby. Demonstrates a hand-written scanner→parser→codegen pipeline: a lexer emitting token pairs, a RACC grammar producing a simple AST, and a C backend that writes source and invokes outputs C and compiles with GCC. Builds a tiny “sucklang”, runs the compiled binary, and iterates live — it works end to end for quick experiments.
AI-written summary · about
chapters (17)
- 0:00Introduction
- 1:20Presentation Outline
- 3:07What is a Compiler
- 7:48Pipeline Diagram
- 8:14About RACC
- 8:50Why RACC
- 10:56Element sequences
- 12:18Scanner
- 13:19Scanning Tokens
- 18:41Parser
- 22:01Commandline invocation
- 29:58Code Generator
- 40:19Tools
- 43:01Testing
- 44:26Bridges
- 45:02Grammar
- 45:51Summary
related talks
37mStanding on the Shoulders of Giants
32mParsing Ruby
49mA Raku API to Raku programs the journey so far
33mRuby: A Family History
28mRuby for your two internal programmers
46mTowards a Ruby compiler
45mUsing Ruby to Generate Faster Ruby Code through Partial Evaluation
45mLanguage-Oriented Programming with Racket
