Roc
Functional language that compiles to native code or WebAssembly
Replaces —
Who it's for
Roc is designed to be an approachable entry point into pure functional programming. Its minimal language surface means a learner can understand the full language rather than a useful subset, and the friendly toolset reduces the setup friction that typically discourages beginners. The tutorial and example code run with the same compiler used for the official site.
You already have FP experience and want a language with a mature ecosystem and production track record. Roc's pre-1.0 status makes it a poor fit for production workloads where breaking changes are costly.
Roc compiles to WebAssembly and is designed for performance at that target. For teams building browser-embedded tools, edge compute functions, or sandboxed execution environments, Roc's functional model and native WebAssembly output offer a typed, predictable option alongside the more common TypeScript-to-Wasm path.
Your WebAssembly target requires mature ecosystem libraries (HTTP, crypto, storage) that do not yet exist in Roc's early-stage package ecosystem.
Roc is an open source language in active design, with a stated goal of combining approachability with native performance. Contributors interested in functional language design, compiler engineering in Zig, or advancing the state of accessible FP have direct access to a project that welcomes participation and maintains an active community on Zulip.
You want a research platform for advanced type theory or complex effects systems. Roc prioritizes simplicity and approachability over type system expressiveness.
The problem
Pure functional programming eliminates a category of bugs that imperative code must guard against: without mutable state and without hidden side effects, functions are predictable and composable by construction. The challenge for teams that want these properties is that most functional languages are difficult to adopt. Haskell, the most prominent pure functional language, requires months of study to learn its advanced type system and navigate a fragmented tooling ecosystem. Elm keeps the learning curve low but limits you to browser applications. For developers who want to build native binaries or WebAssembly targets using a purely functional approach, the options narrow quickly. There is no well-established functional language that combines native compilation, a friendly syntax, and a runtime built for WebAssembly without requiring years of prior FP knowledge.
How it works
Roc compiles source files to native machine code for performance-critical applications and to WebAssembly for browser and edge environments. The compiler targets both backends from the same language, so a program's logic does not change based on its deployment target. This makes Roc usable for both server-side tools and browser-embedded applications.
Roc is purely functional with no imperative escape hatches: all values are immutable, all effects are explicit, and the language has one paradigm rather than mixing functional and object-oriented styles. The surface area of the language is deliberately small, which means the full language specification is learnable in a reasonable timeframe rather than incrementally over years.
Roc's syntax and semantics are designed to minimize cognitive friction for developers coming from other languages. The included toolset covers the most common development needs without requiring separate tool configuration. The official site documents user-friendliness as a primary design goal, covering syntax, semantics, and the toolset together.
Roc's compiler can run directly in the browser without a backend server. The official site uses this to host interactive examples tested with the actual production compiler, not a simplified emulator. Developers can try the language without installing anything locally, lowering the barrier to evaluating it.
The standard library is documented at roc-lang.org/docs. The language ships with a mini-tutorial and a collection of runnable examples that are tested by the same compiler used to build the official site. A Zulip community chat provides help and discussion for learners and contributors.
Features
- Native machine code and WebAssembly compilation
- Single-paradigm design with minimal language primitives
- User-friendly syntax and integrated toolset
- Full compiler runs in the browser
- Standard library, tutorial, and runnable examples
How to install
Download pre-built binaries for your platform from GitHub Releases: https://github.com/roc-lang/roc/releases/latest
Recommended for this setup
Strengths
- UPL-1.0: permissive license for commercial use: Roc's UPL-1.0 license is a permissive OSI-approved open source license that allows commercial use, modification, distribution, and sublicensing without fee. There are no copyleft requirements: teams can use Roc to build proprietary applications or modify the compiler for internal use without triggering any source disclosure obligations.
- Compiles to native machine code with no runtime overhead: Roc programs compile to native binaries rather than bytecode or interpreted scripts, producing executables that start quickly and run without a separate runtime environment. The official site describes fast builds and fast execution as core design properties, not aspirational goals.
- Pure functional model with explicit effects: Every Roc program is composed of pure functions with no hidden side effects. Effects are explicit at the program boundary, so a function's behavior is fully determined by its inputs. This makes individual functions straightforward to test and reason about without setting up mutable state or mocking shared resources.
- Active development with corporate sponsors: Roc has been under continuous development since its repository was created in January 2019, with active commits as of the date of this writing. The project is backed by corporate sponsors including Lambda Class, ohne-makler, and Decem, and runs a fundraising effort to fund a full-time core contributor. The Zulip community is active for questions and contributions.
Trade-offs
- Pre-1.0 language: spec and API may change: The official README states that Roc is not ready for a 0.1 release. The language specification, standard library, and compiler interfaces are under active development, which means breaking changes are possible between versions. Teams building software that depends on Roc should expect to update their code as the language evolves and should not rely on stability for production workloads.
- Early-stage package ecosystem with limited third-party libraries: Roc is a young language, and the third-party package ecosystem reflects that. Teams that need libraries for common tasks such as HTTP clients, database drivers, or cryptography may find them absent or incomplete. This is a consequence of the pre-1.0 status and will improve as the community grows, but it is a real constraint for projects beyond learning and experimentation.
Tech stack
FAQ
No. The official README states that Roc is not yet ready for a 0.1 release. The language specification and standard library are under active development, and breaking changes should be expected between versions. Roc is suitable for learning, experimentation, and contributing to the project, but not for production workloads where language stability is required.
UPL-1.0 (Universal Permissive License 1.0) is an OSI-approved open source license with minimal restrictions, comparable to MIT. You can use Roc to build commercial applications, modify the compiler, distribute your changes, and sublicense your work without fee. There are no copyleft or source disclosure requirements triggered by using Roc in a commercial or team context.
Roc targets approachability as a primary design goal, keeping the language to a small set of primitives and a single paradigm. Haskell is a powerful language with a much larger ecosystem and a richer type system, but it carries a well-known steep learning curve. Roc is a better starting point for developers new to functional programming; Haskell is the better choice when you need a production-grade ecosystem with decades of accumulated libraries.
The official installation guide is at roc-lang.org/install. Pre-built binaries for common platforms are available from the GitHub Releases page at github.com/roc-lang/roc/releases. The README also links to examples that can be run directly in the browser without a local installation, which is a good way to try the language before installing anything.
Roc uses Zulip for community discussion. The group chat at roc.zulipchat.com is the primary venue for questions, help for new learners, and contributor discussions. The project README links directly to the chat and describes it as the place to ask for help. The project's GitHub issues are also open for bug reports and language design discussions.