How does a compiler work, anyway?
Lexer? Parser?
Consider:
→ token ≅ word
After parsing: semantics
Roughly, instructions for code generation
A (really tough) science and an art
Thankfully trivial for an assembler 🙃
Born in 1997
Pile of 90's-style C code 🐛
Claim to fame: used for some commercial releases!
Very 90's design...
Macro assembler
Unlimited relocation complexity
Human-oriented
| Human-oriented: |
|
| Compiler-oriented: |
|
Sometimes at odds, but possible to marry both with enough effort
Let's witness some design lessons
...primarily negative.
PURGEMetaprogramming facilities
Compile-time variables to store info
Uh-oh, no namespacing!
PURGELet's allow deleting symbols!

EQUS = compile-time eval
Imagine C macros, but there is no preprocessor
Fully text-based, bypassing tokens
→ Can't even lex a line until previous one is processed


RGBASM doesn't support structs
And now it does!
; hello world
bf ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
; echo
bf \,+[-.\,+], HELLO WORLD!\n
(Image missing)
Thank you for listening!