Want to learn and master Roc?

Join Exercism’s Roc Track for access to 105 exercises with automatic analysis of your code and personal mentoring, all 100% free.

Explore exercises

About Roc

app [main] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.17.0/lZFLstMUCUvd5bjnnpYromZJXkQUrdhbva4xdBInicE.tar.br" }
import pf.Stdout

factorial = \number ->
    when number is
        1 -> 1
        n -> n * factorial (n - 1)

expect factorial 5 == 1 * 2 * 3 * 4 * 5

main =
    result = factorial 20 |> Num.toStr
    Stdout.line! "factorial 20 = $(result)"

105 coding exercises for Roc on Exercism. From Isogram to Minesweeper.


Get better at programming through fun, rewarding coding exercises that test your understanding of concepts with Exercism.

See all Roc exercises on Exercism

Key Features of Roc


Roc

Fast

Roc code is designed to build fast and run fast. It compiles to machine code or WebAssembly.

Functional

Roc has a small number of simple language primitives. It's a single-paradigm functional language.

Friendly

Roc's syntax, semantics, and included toolset all prioritize user-friendliness.

Safe

Roc's powerful type system and immutability lead to more predictable and maintainable code.

Interoperable

Roc works well with other languages, making it easier to integrate into existing projects.

Evolving

Roc is a young language, and it is evolving fast.

Get mentored the Roc way

Every language has its own way of doing things. Roc is no different. Our mentors will help you learn to think like a Roc developer and how to write idiomatic code in Roc. Once you've solved an exercise, submit it to our volunteer team, and they'll give you hints, ideas, and feedback on how to make it feel more like what you'd normally see in Roc - they'll help you discover the things you don't know that you don't know.

Learn more about mentoring

Community-sourced Roc exercises

The Roc track on Exercism has 105 exercises to help you write better code. Discover new exercises as you progress and get engrossed in learning new concepts and improving the way you currently write.

See all Roc exercises
Roc

Get started with the Roc track

The best part, it’s 100% free for everyone.