Hi all!
I'm just dipping my toes into Roc and wanted to try the basic "Building an Application" example in the tutorial:
app [main!] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.20.0/X73hGh05nNTkDHU06FHC0YfFaQB1pimX7gncRcao5mU.tar.br" }
import pf.Stdout
main! = |_args|
Stdout.line!("Hi there, from inside a Roc app. 🎉")
Unfortunately, when I try to compile it, it's giving me an error:
# roc src/main.roc
-- DOWNLOAD FAILED -------------------------------
Failed to download from https://github.com/roc-lang/basic-cli/releases/download/0.20.0/X73hGh05nNTkDHU06FHC0YfFaQB1pimX7gncRcao5mU.tar.br
Error: InvalidHash
I'm not sure, it looks like you're doing everything right to me
This is issue #9242. For basic-cli 0.20, you need to use roc alpha 4
Ah, thanks! That is very old though... If I'm building roc locally, should I just do the same with basic-cli?
No basic-cli is not ready yet for the new compiler, it is a high priority though!
@Thomas Järvstrand The Roc compiler is being rewritten from Rust to Zig (for good reason, not just for fun!) and with that comes a host of changes to the language as well. The platform you're looking at works with the "old" Rust compiler (alpha-4), but not with the new Zig one.
You essentially have three options right now:
A) Use the new Zig compiler and its platforms. You'll likely run into a few sharp corners and bugs, but you'll be learning the new Roc which will stabilize over time. Don't rely on the docs on the website as they're for option B. Instead, use this: https://github.com/roc-lang/roc/blob/main/docs/mini-tutorial-new-compiler.md and this https://github.com/roc-lang/roc/tree/main/docs/langref
B) Use the "old" Rust compiler and its platforms. That'll be alpha-4 and basic-cli, and basic-webserver. This'll mostly work, but when you do run into a bug you'll need to work around it since it's not going to be fixed. Refer to docs on the website for Roc and its platforms.
C) Hold off until the Zig compiler is more stable and you'll have an easier time.
I'd recommend A for most people (with the added benefit that you can report any bugs and they'll be addressed!) but I'm doing B myself because I've got a bunch of code written for the Rust compiler. I can report that it works really well once you get to understand the workarounds and it's an awesome language. But that'll be true for option A too!
Option C is probably good if you're strapped for time or your tolerance for bugs is low at the moment. The other options are not for the faint of heart as you will run in to missing features, bugs, missing packages etc. For me that's part of the fun, but it's not for everyone!
Last updated: Apr 10 2026 at 12:38 UTC