Programming language based on the synchronous and constraint paradigms
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
benchmark
data/test
examples/bonsai/NQueens
libstd
runtime-sugarcubes/sugarcubes
runtime
src
tests
.gitignore
.travis.yml
Cargo.toml
LICENSE
README.md
manual-installation.md
setup.py
update.sh

README.md

bonsai

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

Prerequisites

  • rustup: 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:
    1. MacOSX: sudo brew install maven
    2. Linux Ubuntu: sudo apt-get install maven

Installation

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

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

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

.\update.sh

Uninstallation

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

Example

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 <argument>--lib=...</argument>.