Programming language based on the synchronous and constraint paradigms
Switch branches/tags
Nothing to show
Clone or download
ptal [runtime][compiler] add a single time declaration and tests. Factoriz…
…e single_space and single_time into VarDecl.
Latest commit 4a0aff3 Nov 14, 2018
Permalink
Failed to load latest commit information.
benchmark [bonsai] Generate the module and process UID for variables. Remove Ex… Apr 21, 2017
data/test [runtime][compiler] add a single time declaration and tests. Factoriz… Nov 14, 2018
examples/bonsai [runtime][compiler] Link the compiler and runtime, remove dependency … Nov 9, 2018
libstd [bonsai] Generate the module and process UID for variables. Remove Ex… Apr 21, 2017
runtime-sugarcubes/sugarcubes [runtime][synchronous] Update the synchronous engine to push and pop … May 7, 2018
runtime [runtime][compiler] add a single time declaration and tests. Factoriz… Nov 14, 2018
src [runtime][compiler] add a single time declaration and tests. Factoriz… Nov 14, 2018
tests [runtime][compiler] Factorize pause, pause up and stop in a same Dela… Nov 14, 2018
.gitignore Initial commit Aug 16, 2016
.travis.yml [Bonsai][Architecture] Add Travis support. Oct 12, 2016
Cargo.toml [runtime][stmt] Add the single space variable declaration, and modify… Nov 12, 2018
LICENSE [Import] Project previously in PCP, renamed to bonsai. Sep 8, 2016
README.md [runtime][compiler] Link the compiler and runtime, remove dependency … Nov 9, 2018
manual-installation.md [runtime][stmt] Add the single space variable declaration, and modify… Nov 12, 2018
setup.py [runtime][stmt] Add the single space variable declaration, and modify… Nov 12, 2018
update.sh [runtime][compiler] Link the compiler and runtime, remove dependency … Nov 9, 2018

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 the external libraries such as Choco):

.\update.sh

Uninstallation

cargo uninstall bonsai
# Remove runtime in the Maven local database
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>.