Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
65 lines (43 sloc) 2.1 KB


ptal on Travis CI

Bonsai is a programming language on top of Java inspired by synchronous programming and aims at be used to solve Constraint Satisfaction Problems (CSP). This is a work-in-progress to implement the language formally described in this dissertation.

The project is decomposed into two parts:

  • Bonsai is the compiler of the Java extension and is written in Rust.
  • Bonsai runtime is the Java runtime used by the code compiled by bonsai.

Getting Started


  • rustup: curl -sSf | sh (do not forget to source your profile).
  • Maven, it is usually available in the package manager of your distribution:
    1. MacOSX: sudo brew install maven
    2. Linux Ubuntu: sudo apt-get install maven


You need to install both the compiler and the runtime using the script.

git clone
cd bonsai

We provide a manual installation procedure in case the script did not work.


Update the compiler and runtime (without updating SugarCubes and Choco libraries):



cargo uninstall bonsai
# Remove runtime in the Maven local database
rm ~/.m2/repository/inria
rm ~/.m2/repository/bonsai


The following command will compile and execute the NQueens problem as described in the file

cd examples/bonsai/NQueens
mvn compile
mvn exec:java -Dexec.mainClass="bonsai.examples.NQueens"

Copy this project and create as much bonsai file ( as you want. Do not forget to modify the <id> and the names of the files in the <argument>. Also, note that it includes the Bonsai standard library (in /libstd), you can modify its path in <argument>--lib=...</argument>.