ArkScript is an interpreted/compiled language since it runs on a VM. For a long time, runtime error messages looked like garbage, presenting the user with an error string like “type error: expected Number got Nil” and some internal VM info (instruction, page, and stack pointers). Then, you had to guess where the error occurred.

I have wondered for a long time how that could be improved, and I only started working on that a few weeks ago. This post is about how I added source tracking to the generated bytecode, to enhance my error messages.