A hobby of mine for the past few years has been writing virtual machines and interpreters. Or should I say – starting to write them, then abandoning them. Regardless, the siren song of “make your own language with all your strongly held beliefs about programming baked in” continues to be alluring to me. And damn it, I’ve decided to cannibalise a recent interpreter attempt and have another go.
Web Apps are Convenient
Let’s assume you’re a programmer. You’re fairly open minded, you’ve tried a few languages, and your response to seeing a new programming language isn’t “ugh, why do we need another programming language?”, but “cool, I wonder if this language is something I’d like”.
Great! You’re the primary audience for people who make their own programming languages. So, how likely are you to download, compile and test some guys prototype interpreter/compiler?
Probably not likely.
If the interpreter is a browser app though, it lowers the effort significantly. You can point your browser and start playing with it straight away. And that’s all the effort you’ll ever have to expend, even as the language continues to be updated and refined.
The performance of an unstable language isn’t important
Unless you’re Apple or Google or even Mozilla, no one is going to bother writing anything remotely useful in your unstable language. The most you can really hope for is that people try it out and implement some known algorithms or toy examples. You want to get as many people doing that kind of thing as possible. Can they do that without experiencing too much difficulty from a slow implementation? Great, you’re fast enough. Feedback on your semantics is the key here.
The tools you use for prototyping don’t need to be the same tools you use when things get more serious. I figure once the semantics are defined, writing a faster implementation is going to involve more translation and less exploration. Writing for a moving target in C or C++ is not ideal – but doing a re-write after the fact, with your path laid out a ahead of you, makes things a lot easier.
Of course there is the small matter of needing to write your own garbage collector, but we’ll cross that bridge when we come to it.