Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsJul 22, 2026·2 min de lecture

Roc — Fast Friendly Functional Programming Language

A statically typed functional programming language designed for speed, safety, and a friendly developer experience. Compiles to machine code with no runtime overhead.

Prêt pour agents

Installation avec revue préalable

Cet actif nécessite une revue. Le prompt copié demande un dry-run, affiche les écritures, puis continue seulement après confirmation.

Needs Confirmation · 64/100Policy : confirmer
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Roc
Commande avec revue préalable
npx -y tokrepo@latest install 45394c42-85aa-11f1-9bc6-00163e2b0d79 --target codex

Dry-run d'abord, confirmez les écritures, puis lancez cette commande.

Introduction

Roc is a statically typed functional programming language created by Richard Feldman (creator of Elm's architecture). It prioritizes fast compilation, fast execution, and a friendly developer experience with helpful error messages and minimal boilerplate.

What Roc Does

  • Compiles to native machine code for fast execution
  • Provides exhaustive pattern matching and algebraic data types
  • Offers a platform system for separating pure logic from side effects
  • Delivers fast incremental compilation for rapid feedback
  • Produces helpful error messages with suggested fixes

Architecture Overview

Roc uses a unique platform/application split. Applications contain pure business logic while platforms handle I/O and side effects. The compiler is written in Rust and Zig, producing LLVM IR that compiles to native binaries. This architecture enables guaranteed purity in application code while maintaining practical I/O capabilities through the platform layer.

Self-Hosting & Configuration

  • Install via the official installer or build from source
  • Create a new project with roc init
  • Choose a platform (basic-cli, basic-webserver) in your app header
  • No build configuration files needed; the app header declares dependencies
  • Supports cross-compilation for different target architectures

Key Features

  • No runtime exceptions with exhaustive pattern matching
  • Platform system cleanly separates pure and effectful code
  • Fast incremental compilation with sub-second rebuilds
  • Automatic memory management without garbage collection pauses
  • Friendly error messages designed for newcomers

Comparison with Similar Tools

  • Elm — Browser-only functional language; Roc targets general-purpose native applications
  • Haskell — Academic FP language; Roc prioritizes approachability and compilation speed
  • Rust — Systems language with ownership; Roc uses automatic memory management
  • OCaml — Mature ML family language; Roc offers simpler syntax and better error messages

FAQ

Q: Is Roc ready for production? A: Roc is pre-1.0 and under active development. It is usable for personal projects and experimentation.

Q: What platforms are available? A: basic-cli for command-line tools, basic-webserver for HTTP servers, and community platforms for other use cases.

Q: Does Roc have a package manager? A: Roc uses URL-based dependencies declared in the app header. A centralized registry is planned.

Q: How does memory management work? A: Roc uses automatic reference counting with compile-time optimizations to eliminate most overhead.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires