Note: In order to develop in Roc, you need to install the Roc CLI, which includes the Roc compiler and various helpful utilities.
- Download Latest nightly Roc (find assets here)
Or use jq and curl
for seamless copy/paste
curl -s https://api.github.com/repos/roc-lang/roc/releases|jq -r '.[0].assets [0].browser_download_url'|xargs -n1 -I % curl -L % --output roc_nightly.tar.gz
- Unpack
tar xf roc_nightly.tar.gz --one-top-level
Note: In order to compile Roc apps (either in examples/ or in your own projects), you need to install one or more of these platform language compilers, too.
Install the Rust compiler, for apps with Rust-based platforms:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Install the Zig compiler, for apps with Zig-based platforms:
- Download zig
curl -Ls https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz -o zig-0.9.1.tar.xz
- Unpack
tar xf zig-0.9.1.tar.xz
- Move To Path
cp zig-linux-x86_64-0.9.1/zig /usr/local/bin/zig
Install a C compiler, for apps with C-based platforms:
sudo apt update && sudo apt install build-essential clang
sudo dnf check-update && sudo dnf install clang
Note: If you installed Rust in this terminal session, you'll need to open a new one first!
./roc examples/platform-switching/rocLovesRust.roc
./roc examples/platform-switching/rocLovesZig.roc
./roc examples/platform-switching/rocLovesC.roc