Skip to content

Instantly share code, notes, and snippets.

@ultrox
Last active October 1, 2022 16:15
Show Gist options
  • Save ultrox/06bd609fd8dc2c070c9c90fb8ccb861c to your computer and use it in GitHub Desktop.
Save ultrox/06bd609fd8dc2c070c9c90fb8ccb861c to your computer and use it in GitHub Desktop.
Download Latest Roc

Roc installation guide for x86 Linux systems

How to install Roc

Note: In order to develop in Roc, you need to install the Roc CLI, which includes the Roc compiler and various helpful utilities.

  1. 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
  1. Unpack
tar xf roc_nightly.tar.gz --one-top-level

How to install Roc platform dependencies

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:
  1. 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
  1. Unpack
tar xf zig-0.9.1.tar.xz
  1. 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:

On a Debian-based distro like Ubuntu

sudo apt update && sudo apt install build-essential clang

On an RPM-based distro like Fedora

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment