No, that isn’t a typo. As it’s May the Fourth – yes, Star Wars Day – I thought I’d have a little fun and see what I could write using the venerable stack-based programming language, Forth. For those of you who aren’t aware, Forth has a long history with Autodesk and , having been at the core of ATLAST, the Autodesk Threaded Language Application System Toolkit. ATLAST had noble intentions: to allow host applications to expose a common API or macro language that executed efficiently and with very low memory overhead.
By the time I joined Autodesk it was unfortunately no longer a thing, but 30 years later I thought it was probably time to have a crack at writing some Forth code. I found an online Forth interpreter, and started having a go.
Here’s what I came up with – you can open the code and run it yourself, if you’re interested. It’s a very rudimentary representation of a TIE fighter, in case you couldn’t tell.
Forth is a tricky language, in that data needs to be placed on a global stack before being operated upon. So you can create sub-routines, but it’s a gnarly business to maintain and reuse the values on the stack within it. I’m sure there are ways I could have made the above code more maintainable (there’s lots of hardcoded nastiness) but I managed to get something working, at least.
So, with that… May the Forth be with you, always!