Skip to content

Natsume-Neko/astro

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Implementation of Lox Language Using ASTro Interpreter Optimizer

This is the experiment repository for Implementation of Lox Language Using ASTro Interpreter Optimizer paper, which is submitted to PPL workshop 2026.

Repo Structure

This repository is forked from ASTro repository, the Lox programming language is implemented as a sample of ASTro, which is in sample/lox. The project is managed by nix and devenv, checkout devenv.nix for dependencies.

Build the interpreter

To build the Lox on ASTro interpreter, first enter the sample/lox directory:

cd sample/lox

To build a interpreter compiled with Clang, run:

make clang_lox_release

Then it will build a clang_lox_release executable in this directory, along with files generated by ASTro framework. Then you can run a Lox script by:

./clang_lox_release some_script.lox

It will run the script, as well as generate a node_specialized.c file, which is the specialized dispatchers of this script.

Then build clang_lox_release again, it will generate the specialized interpreter:

make clang_lox_release

For non-Nix user:

You may encounter problem for building tree-sitter parser. Please refer to the Makefile:

# It works for nix-devenv managed system, if you use normal system, install tree-sitter first, and change the
# ../../../.devenv/state/cargo-install/bin/tree-sitter to the path of your tree-sitter executable.

Run benchmarks

To get the result of Lox on ASTro compiled with Clang, run:

lua run_benchmarks-release.lua

To get the result of Lox on ASTro compiled with GCC, run:

lua run_benchmarks-release-gcc.lua

To get the result of Clox, first build the crafting interpreters:

cd craftinginterpreters
make get
make
cd ..

Then run the following script to get the benchmark result of Clox:

lua ./test_bench.lua ./craftinginterpreters/clox ./loxcraft/res/benchmarks/

About

ASTro: AST-based Reusable Optimization framework

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Ruby 100.0%