bc (basic calculator) is an arbitrary precision calculator language. This project aims to implement bc using the Truffle library in order to improve its performance.
In order to install the bc component on your own GrallVM, you can just do the following steps.
git clone git@github.com:SnipyJulmy/bc-truffle.git
Note : currently, there is a problem when building the project using a "normal" way
(see this issue). So you would have to use
the package.sh
script.
cd bc-truffle
chmod +x ./package.sh
./package.sh
Make sure that your JAVA_HOME variable is pointing to a GraalVM JVM
(for example JAVA_HOME="/usr/lib/jvm/java-8-graal"
).
Then we need to install the bc component into GraalVM (with or without sudo, depending on your setup) :
sudo gu -L install component/bc-component.jar
If the component is already installed, you just need to remove it before installing the new one :
sudo gu remove bc
At this point, the bc
and bcnative
program are available inside the JAVAHOME/bin/
directory.
bc language/src/test/resources/bc/add_1.bc
bcnative language/src/test/resources/bc/add_1.bc
Both line should give 3
as a result.
TODO
This repository is licensed under the UPL license.