TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: ETscript – An experimental interpreter for Salesforce's AMPscript

2 pointsby mgomezalmost 2 years ago
I wanted to take a break from JavaScript and learn a lower-level language. I&#x27;ve always been into musical instruments, so I thought I&#x27;d be knee-deep in C++ and building VST plugins by now. But for whatever reason, I ended up going through Robert Nystrom&#x27;s excellent book, <i>Crafting Interpreters</i> instead.<p>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.<p>I didn&#x27;t stop there, though. Instead of implementing <i>clox</i> (the main subject in the book&#x27;s second half), I implemented a subset of AMPscript — a DSL I had used back when I worked at ExactTarget&#x2F;Salesforce. Its domain is primarily email message personalization.<p>Does this interpreter, that doesn&#x27;t have a domain to operate in, have any use in the real world? No, not really (and it&#x27;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&#x27;t offer trial accounts for their Marketing Cloud product).<p>Also, I&#x27;m really bad at bringing hobby projects to any type of conclusion. So as a final challenge, I decided my first &quot;Show HN&quot; would be that for this project. Feedback appreciated!

no comments

no comments