Getting Set Up
Prerequisites
To start with, clone the Raven repository to your computer. To use Raven you'll need
- A Julia REPL, to run the compiler,
- Node.js on your system path, to run compiled code, and
- WABT and Binaryen, for optimising WebAssembly output.
MacOS
On MacOS I highly recommend using Homebrew, which makes installation easy:
brew install --cask julia
brew install node wabt binaryen
In a terminal, navigate to the Raven repo and run julia --project
to launch the Julia REPL.
Alternatively, if you already have Node.js and would like to avoid Homebrew, you can install WABT and Binaryen with npm install --global wabt binaryen
Linux
On Linux you need to download the Julia binaries, unzip them, and add the ./bin/julia
binary to your PATH
.
I recommend using Homebrew for the rest:
brew install node wabt binaryen
In a terminal, navigate to the Raven repo and run julia --project
to launch the Julia REPL.
Alternatively, if you already have Node.js and would like to avoid Homebrew, you can install WABT and Binaryen with npm install --global wabt binaryen
The apt
package manager does have a nodejs
package, but the build is ancient. It's best to have a recent version.
Windows
On recent versions, the dependencies can be installed using Windows' built-in package manager, in PowerShell.
winget install JuliaLang.Julia
winget install OpenJS.NodeJS
You may need to restart your terminal before installing WABT and Binaryen.
npm install --global wabt binaryen
Then launch a Julia REPL and activate the Raven project.
Raven also works great within WSL, using the Linux instructions above.
Hello, World!
Create a file called hello.rv
with the following contents.
println("Hello, World!")
Now, from a Julia REPL, call the Raven compiler.
julia> using Raven
julia> Raven.exec("hello.rv")
Hello, World!
Editor Support
Basic syntax highlighting is supported in Atom and VS Code. The instructions should work on MacOS or Linux desktop, but don't support Windows.
Atom
From a shell in the Raven repo:
ln -s $PWD/editor/language-raven ~/.atom/packages/
VS Code
From a shell in the Raven repo:
cd editor/raven-language
npm install
npm run compile
ln -s $PWD ~/.vscode/extensions