mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-10 18:08:55 +03:00
1.4 KiB
1.4 KiB
- Download the latest nightly from the assets here.
- Untar the archive:
tar -xf roc_nightly-linux_x86_64-<VERSION>.tar.gz
- Some fresh installs require executing
sudo apt update
, it is not needed to executesudo apt upgrade
after this. - To be able to run examples:
- for the Rust example:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- for the zig example:
wget https://ziglang.org/download/0.8.1/zig-linux-x86_64-0.8.1.tar.xz tar -xf zig-linux-x86_64-0.8.1.tar.xz sudo ln -s $(pwd)/zig-linux-x86_64-0.8.1/zig /usr/local/bin/zig
- for the C example:
sudo apt install build-essential clang
- Run examples with:
# Rust. If you installed rust in this terminal you'll need to open a new one first! ./roc examples/hello-world/rust-platform/helloRust.roc # Zig ./roc examples/hello-world/zig-platform/helloZig.roc --linker=legacy # C ./roc examples/hello-world/c-platform/helloC.roc --linker=legacy
- See here for the other examples.
Tip: when programming in roc, we recommend to execute ./roc check myproject/Foo.roc
before ./roc myproject/Foo.roc
or ./roc build myproject/Foo.roc
. ./roc check
can produce clear error messages in cases where building/running may panic.