The Language
How to learn the language
Instructions for building and using Bramble and Thorn.
Bramble is written in Rust and to build the compiler you will need Rust and Cargo installed. The easiest way to setup Rust is to get rustup and install the latest stable toolchain.
Bramble uses LLVM as a compiler backend, so you will need to install the LLVM libraries on your machine. Bramble has been tested against LLVM 11 and 13.
Using Homebrew:
brew install llvm
Using DNF:
dnf install llvm-devel
Follow the instructions provided on this site.
The Bramble make script, make.sh
, uses GCC as a linker between compiled binaries.
After Rust has been installed.
cargo test
. This will build Bramble and execute
all the unit tests.cargo build --release
./tests
directory and run ./tests.sh
. This will
execute all the integration tests for Bramble and will validate that both the compiler
and LLVM are functioning properly../make.sh
to compile and run your own projects../tests/scratch/
directory create a file named hello.br
.hello.br
in a text editor and write the following:fn my_main() -> i64 {
project::std::io::write("Hello World\n");
return 0;
}
./tests/
and run ./make.sh -i ./scratch/hello.br
. This will compile
and execute hello.br
Thorn insights consists of two components: the thorns
server and the
viewer
. You run the thorns
server from the root of your project directory
and then start the viewer
which will connect to thorns
and let you
explore your insight data.
To install Thorns, clone the GitHub repository and go to the repo directory.
From there run the following:
cd thorns
cargo install --path .
This will create a release build of thorns
and install it into the Rust
binaries set.
Then go to your Bramble project root and run thorns
. This will automatically
host the insights data that has been output to ./target
.
After the you have started the thorns
server. Go to the Thorns repository
directory and:
cd viewer
npm start
This will start the React based Thorn Viewer, which will connect to thorns
and let you interact with the insights data.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.