WAAVScript – The birth of a language
I have the need for an embeddable language runtime that I can include in all my applications. In the past, I’ve been a big user of LuaJIT, as it was the best, smallest, fastest, easiest to use. Most recently, I’ve been doing a lot of work with graphics, and created a nice SVG renderer, to deal with static vector graphics. Although very useful, as there’s a lot of .svg content and editors in the world, it’s limited in terms of it’s automation capabilities. I need more dynamics, being able to calculate, and perform other algorithmics. So what to do?
I considered lua, JavaScript, Python, mostly. In the end, I did what all good programmers do, and I decided to roll my own. Thus WAAVScript was born. WAAVScript follows closely the PostScript language reference. I wanted to render graphics for sure, but I wanted a general purpose language that I could use for all sorts of things. WAAVScript is primarily meant to be glue code. Although, you could certainly write an entire app using it, the style (infix notation, rewritable functions), would make it quite cumbersome on a large scale. WAAVScript is meant to be useful in the tiny nooks and crannies of programming, such as graphics effects, layout engine, glue to foreign libraries, etc.
Developing WAAVScript has been an interesting learning process. This is now the second time I’ve implemented a PostScript interpreter. This time it’s more complete, faster, and easier to integrate. Here I am going to write a multi-part series on how the thing is constructed, from the ground up, pointing out some of the more interesting aspects, and things that I learned along the way.
This is the starting point. The series will roughly be: First principles, tokenizing, data structures, runtimes, features. The one interesting aspect of the development is that I was fairly interactive with ChatGPT during the development of the code, so I’ll sprinkle in some commentary about what that was like, what it lead to, what was misleading, and the overall general usefulness of using such a tool in the development process.
So, buckle up, get ready to ride this WAAV.