Est. 2019 Intermediate

Roc

A fast, friendly, functional programming language designed for application development with no runtime exceptions, fast compilation, and friendly error messages.

Created by Richard Feldman

Paradigm Functional
Typing Static, Strong, Inferred
First Appeared 2019
Latest Version Pre-release (alpha4, August 2024)

Roc is a fast, friendly, functional programming language created by Richard Feldman, the author of “Elm in Action.” Designed as a direct descendant of Elm, Roc extends Elm’s ideas beyond frontend web development into general-purpose application development. The language emphasizes fast compilation, no runtime exceptions, and friendly error messages.

History & Origins

Roc’s development began in 2018 when Richard Feldman, who had spent years working with Elm at NoRedInk, envisioned a language that could bring Elm’s philosophy of correctness and developer experience to a broader range of applications. While Elm focused on frontend web UIs, Feldman wanted a functional language suitable for command-line tools, backend services, and embedded applications.

The GitHub repository was created in January 2019, and Roc was first publicly presented at an online meetup in 2020. The name “Roc” was chosen partly to enable a short three-letter file extension (.roc), and the language’s logo is a purple origami bird, a homage to Elm’s tangram symbol.

Funding and Foundation

In April 2022, NoRedInk began funding full-time Roc development. Around 2022-2023, the Roc Foundation was established as a nonprofit to ensure the language’s long-term sustainability. Corporate sponsors including Lambda Class and ohne-makler have supported the project.

Design Philosophy

Platform/Application Architecture

Roc’s most distinctive feature is its separation of applications from platforms. A platform handles memory management and I/O (networking, file access, etc.), while an application written in Roc remains purely functional. This means the same Roc application code could potentially run on different platforms without modification.

Purity by Default

All functions in Roc are pure by default. Functions that perform side effects (I/O, networking, etc.) are explicitly marked with a ! suffix, making it visually clear where effects occur in the code.

No Runtime Exceptions

Roc has no try/catch mechanism. Errors are handled through Result types, and the compiler ensures exhaustive pattern matching so all error cases must be handled. If an unexpected crash occurs, the program terminates immediately rather than continuing in a potentially corrupted state.

100% Type Inference

Type annotations are optional everywhere in Roc. The compiler always infers the most general possible type, using decidable principal type inference. There is no null or Maybe/Option type; instead, tagged unions and Result types handle absence and failure.

Key Features

  1. Fast compilation - roc check is designed to complete quickly, reportedly under a second for typical projects
  2. Friendly error messages - Inspired by Elm’s approach to compiler diagnostics
  3. Automatic memory management - Reference counting with opportunistic mutation optimization
  4. No null - Uses tagged unions and Result types instead
  5. Exhaustive pattern matching - The compiler ensures all cases are handled
  6. String interpolation - "Hello, ${name}!" syntax
  7. Embeddable - Can be called from Go, .NET, C, and other host languages

Compiler Rewrite

The Roc compiler was originally written in Rust. In early 2025, the team announced a rewrite of the compiler in Zig, prioritizing faster compilation speed. The first numbered release (0.1.0) is expected to coincide with the completion of this new compiler.

Current State

As of early 2026, Roc remains pre-1.0 and is in alpha status. The latest tagged release is alpha4 (August 2024). The alpha2 release introduced significant syntax changes including parenthesized function calls, snake_case conventions, and the ! sigil for effectful functions. While Roc is not yet recommended for production use, early adopters have successfully used it in real applications. The language continues to evolve rapidly with an active community.

Timeline

2018
Richard Feldman begins development of Roc
2019
Roc GitHub repository created (January)
2020
Roc publicly announced at online meetup
2022
NoRedInk funds full-time Roc development (April)
2022
Roc Foundation established as a nonprofit (tax-exempt status granted 2023)
2024
Alpha releases begin (alpha1 through alpha4)
2025
Compiler rewrite from Rust to Zig announced (February)

Notable Uses & Legacy

Vendr

A SaaS purchasing platform that incrementally adopted Roc in production, calling Roc functions from their Node.js backend.

Roc Foundation

A nonprofit foundation supporting Roc's development, with corporate sponsors including Lambda Class and ohne-makler.

Embeddable Applications

Roc can be called from Go, .NET, C, and other languages, enabling use as an embedded scripting or logic layer.

Language Influence

Influenced By

Running Today

Run examples using the official Docker image:

docker pull roclang/nightly-ubuntu-2204:latest

Example usage:

docker run --rm -v $(pwd):/app -w /app roclang/nightly-ubuntu-2204:latest roc main.roc

Topics Covered

Last updated: