2.2 KiB
Roc installation guide for x86_64 MacOS systems
How to install Roc
In order to develop in Roc, you need to install the Roc CLI, which includes the Roc compiler and some helpful utilities.
-
Download the latest roc nightly using the terminal:
curl -OL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-macos_x86_64-latest.tar.gz
-
Untar the archive:
tar xf roc_nightly-macos_x86_64-latest.tar.gz cd roc_night<TAB TO AUTOCOMPLETE>
-
Install required dependencies:
brew install z3 zstd
-
To be able to run the
roc
command anywhere on your system; add the line below to your shell startup script (.profile, .zshrc, ...):export PATH=$PATH:~/path/to/roc_nightly-macos_x86_64-<VERSION>
-
Check everything worked by executing
roc version
How to install Roc platform dependencies
This step is not necessary if you only want to use the basic-cli platform, like in the tutorial.
But, if you want to compile Roc apps with other platforms (either in examples/
or in your own projects),
you'll need to install one or more of these platform languages too.
-
Install the Rust compiler, for apps with Rust-based platforms:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
If you'd like to use Zig-based platforms: download zig 0.11.0, extract the archive and add
export PATH=$PATH:~/path/to/zig
to your shell startup script (.profile, .zshrc, …). Note: zig 0.11.0 is not available on homebrew. -
Run examples:
# 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