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.
curl https://sh.rustup.rs -sSf | sh(do not forget to source your profile).
- Maven, it is usually available in the package manager of your distribution:
sudo brew install maven
- Linux Ubuntu:
sudo apt-get install maven
You need to install both the compiler and the runtime using the
git clone https://github.com/ptal/bonsai.git cd bonsai python3 setup.py
We provide a manual installation procedure in case the script did not work.
Update the compiler and runtime (without the external libraries such as Choco):
cargo uninstall bonsai # Remove runtime in the Maven local database rm ~/.m2/repository/bonsai
The following command will compile and execute the NQueens problem as described in the file NQueens.bonsai.java:
cd examples/bonsai/NQueens mvn compile mvn exec:java -Dexec.mainClass="bonsai.examples.NQueens"
Copy this project and create as much bonsai file (
.bonsai.java) 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