2 ms·
If no other reason, compilers are just great fun and really satisfying to write. Watching your compiler take a simple expression and spit out a bunch of code re
by whartung 3y ago
If no other reason, compilers are just great fun and really satisfying to write. Watching your compiler take a simple expression and spit out a bunch of code referencing locals, referencing globals, type conversions and coercions, function calls, managing precedence. This little thing created all this code.
It’s exciting. Especially the first time, it’s magic. It’s a lot of fun.
Once I wrote a DSL for a rule system, compiled down into Java source. Later, I wrote another higher level rule system that generated the DSL.
At one point I think there was a USENET .sig line that read “Will write code that writes code that writes code for food.” Indeed.