Attila's Blog

About writing your own programming language in C, Go and Swift

Boolean expressions - extending the grammar

Feb 11, 2019 Comments

Categories: aspl

We have a fully working ASPL VM now, although its current functionality is rather limited. Right now it is nothing more than a simple arithmetic calculator. Today we’ll start extending its capabilities to work towards a fully capable programming language implementation. We start by adding support for boolean expressions. But before we can do that, we have to revisit ASPL’s grammar rules and make some important changes.

A minimal virtual machine - part 2

Jan 22, 2019 Comments

Categories: aspl

Last time we started working on the VM, we implemented the basic framework for executing bytecode, integrated the compiler into the VM, paved the way for our VM to execute bytecode. We added some helpers to read opcodes and constants from the bytecode and finally implemented a debugger / disassembler feature as well. Today we will finish up the work, and implement the necessary bytecode–executing functions so our VM will be able to execute all promised arithmetic operations.