by mgomez on 7/20/23, 5:15 PM with 0 comments
Things started out fine, but I had trouble staying focused since I was just copy-pasting code from the book. Forcing myself to type everything out made things worse. To give myself a challenge, I switched things up by using languages not used by the book. For the tree-walking interpreter, I used Python instead of Java; for the bytecode interpreter, it was Rust instead of C. Doing that made a difference.
I didn't stop there, though. Instead of implementing clox (the main subject in the book's second half), I implemented a subset of AMPscript — a DSL I had used back when I worked at ExactTarget/Salesforce. Its domain is primarily email message personalization.
Does this interpreter, that doesn't have a domain to operate in, have any use in the real world? No, not really (and it's still missing a garbage collector). But I think anyone curious enough to try it out will at least be able to get a feel for writing AMPscript (since Salesforce doesn't offer trial accounts for their Marketing Cloud product).
Also, I'm really bad at bringing hobby projects to any type of conclusion. So as a final challenge, I decided my first "Show HN" would be that for this project. Feedback appreciated!