An implementation of the Lox language written in go.
-
Multiline comments
/* This is a multiline comment */
-
Anonymous functions
Anonymous functions for use cases like passing functions as arguments.
fun thrice(fn) { for (var i = 1; i <= 3; i = i + 1) { fn(i); } } thrice(fun (a) { print a; }); // "1". // "2". // "3".
Make sure you have golang installed.
$ git clone https://github.com/AnshVM/golox.git
$ cd ./golox
$ go build
$ ./golox
This will fire up the lox REPl
For running a lox file -
$ ./golox filepath.lox