Skip to content

Latest commit

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Lox ANSI C Virtual Machine

Virtual machine implementation for the Lox programming language, implemented in ANSI C. Based on the language and design from Crafting Interpreters by Robert Nystrom.

Building

There are a few build flags available

FlagDescriptionDefault value
ENABLE_DEBUGEnables debug information: dissasembling op codes, printing runtime stack, logging garbage collector.OFF
ENABLE_NAN_TAGGINGEnables NaN tagging for value types.ON

You can use these flags in succession with cmake to generate the project. See an example script below:

cmake . -B out -DENABLE_DEBUG=OFF

Lox program

print "Hello, world!";
var x = 10;
for (var i = 0; i < x; i = i + 1) {
print i;
}

Tip

You can find more lox code snippets under the test folder.

About

ANSI C virtual machine for Lox programming language

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages