avidscript lives!

As I’ve mentioned on some recent posts, I’ve been working on developing my own compiler and virtual machine lately. And finally, it lives! It’s taken 5 months, with some language revisions along the way, but I have set out what I intended to achieve: a custom programming language, compiled down to bytecode, running in a virtual machine. All of it was built myself from scratch in C++ using only the standard library. Admittedly it’s not yet complete, and I’m sure there are many bugs. For now though, it’s working. :)
Read more avidscript lives!

Compiling simple loops

I program weird stuff to unwind. Lately, my pet project has been a custom programming language which I’m calling “avidscript”. It is a somewhat C-style procedural language which compiles down to bytecode. My intention is that it will execute in a stack-based Virtual Machine (VM) which is integrated into a game framework. In the long term, I have drawn up some specifications to develop it into a concurrent state/event-based language which will hopefully be useful for programming game AIs.

At the moment, I’m working on the low-level code generation. This is part of the compiler ‘back-end‘. The front-end parses the source code, turning it into an Intermediate Representation (IR) of the program. The back-end then turns the IR into final compiled code. In this case, bytecode for a VM-target. However, it could equally be native machine code. I found the bytecode representation of simple loops quite interesting, particularly from an optimisation standpoint, so I thought I’d share my findings here.
Read more Compiling simple loops