Builds out Awesome:

class Awesome:
    def name:
        "I'm Awesome"

    def awesomeness:

awesome = Awesome.new

... a mix of Ruby and Python, as an interpreter. "A couple of rules for our language:

Book moves pretty fast; at 78 pages, with multi-page listings, it really doesn't dive too deep into details. Feels like a pretty decent starting-off point for further self-exploration.


Demonstrates the use of lex (with links to Rex and JFlex) to build out lexer. Uses rexical to actually build out the lexer. Uses Ragel to build out the scanner. "It’s described as a State Machine Compiler: lexers, like regular expressions, are state machines." Goes into building a lexer by hand (in Ruby), using regular expressions to help with the parsing. Also demonstrates how to lex/parse significant indentation, which I haven't seen before.


Then goes into parsing, discussing Bison/yacc, Lemon, ANTLR, and PEGs.

Runtime Model

Discusses briefly a prototype-based runtime, with a link to this paper on the subject.



LLVM from Ruby

Virtual Machine

Bytecode, VM types, prototyping a VM in Ruby.


Homoiconicity. Self-hosting. Resources. Solutions to the self-homework posed along the way.

Tags: reading   language   antlr   ruby   python   langdev  

Last modified 16 December 2022