awesome-repositories.com
Blog
awesome-repositories.com

Découvrez les meilleurs dépôts open-source grâce à notre recherche par IA.

ExplorerRecherches sélectionnéesAlternatives open sourceLogiciels auto-hébergésBlogPlan du site
ProjetÀ proposNotre méthodologiePresseServeur MCP
Mentions légalesConfidentialitéConditions d'utilisation
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
roc-lang avatar

roc-lang/roc

0
View on GitHub↗
5,723 stars·384 forks·Zig·UPL-1.0·7 vuesroc-lang.org↗

Roc

Roc is a statically typed, functional programming language built around immutable-by-default semantics, exhaustive pattern matching on tag unions, and a type system that combines optional explicit annotations with full compile-time type inference. Its core identity centers on correctness and expressiveness, using tagged unions for error handling with a question-mark operator for early error propagation, and a trailing-bang naming convention that makes side-effect boundaries syntactically visible at every call site.

The language distinguishes itself through a platform-based I/O abstraction that separates pure computation from side effects, routing all external operations through a declared platform that provides the runtime's primitives. Its block-based expression composition groups statements and a final expression inside curly braces, while compile-time debug and crash primitives work even inside pure functions. The type system supports nominal tag union types, parameterized types, constrained type variables, and custom tag wrapping, all verified through exhaustive pattern matching that warns about unhandled cases.

Roc provides a standard library with collection processing and string operations, along with control flow constructs including block expressions, if expressions, and imperative loops over collections with mutable variable reassignment. The language supports record construction and update, numeric operations, text encoding and decoding, and method-call syntax that resolves dot notation to the corresponding module function. Command-line tooling includes automatic source formatting with no configuration and an interactive REPL for evaluating expressions without source files.

Features

  • Platform and Package Declarations - Declares platforms and package dependencies in a header to provide all I/O primitives for executables.
  • Pure Computation I/O Abstractions - Separates pure computation from side effects by routing all I/O through a declared platform.
  • Block Expression Evaluations - Provides block expressions that group statements and evaluate to the last expression's value.
  • Functional Programming Languages - Implements a functional programming language with immutable-by-default semantics and exhaustive pattern matching.
  • Immutable Constant Definitions - Enforces immutable-by-default bindings that cannot be reassigned or shadowed in the same scope.
  • Immutable Variables - Binds names to immutable values by default, with a special mutable prefix for local reassignment only.
  • Exhaustive Pattern Matches - Enforces exhaustive pattern matching on tag unions with compile-time warnings for unhandled cases.
  • Compile-Time Type Inference - Infers all types automatically while allowing optional explicit annotations verified by the compiler.
  • Pattern Matching - Provides exhaustive pattern matching on tagged unions and records for safe data destructuring.
  • Statically Typed Languages - Ships a statically typed language with full compile-time type inference and optional annotations.
  • Effectful Function Distinctions - Distinguishes pure from effectful functions using a trailing-bang naming convention for visible side-effect boundaries.
  • Nominal Tag Union Types - Core language feature using nominal tag unions for exhaustive pattern matching and error handling.
  • Question Mark Error Propagation - Unwraps success values or returns errors early using a single question-mark operator.
  • Success and Failure Wrapping - Represents operations that can succeed or fail using Ok and Err tags with pattern matching and no null values.
  • Type-Safe Development - Builds reliable programs with optional type annotations, exhaustive pattern matching, and compile-time error handling.
  • Source Code Formatters - Applies standard style rules to all source files with a single command and no configuration options.
  • Compile-Time Debug Primitives - Ships debug and crash primitives that work inside pure functions for compile-time and runtime diagnostics.
  • Scripting Entrypoints - Supports creating executable programs with entrypoints, mutable variables, and imperative loops for side effects.
  • Interactive REPLs - Provides an interactive REPL for evaluating expressions and definitions without needing a source file.
  • Early Return Patterns - Supports early return from functions with compile-time warnings for unreachable code.
  • Custom Tag Wrapping - Allows wrapping values in user-defined tags for type distinction and pattern matching.
  • Block Expressions - Implements block expressions that group statements and evaluate to the final expression's value.
  • Mutable Local Variables - Provides mutable local variables with a leading dollar sign for controlled reassignment.
  • Imperative For Loops - Ships imperative for loops that iterate over collections with mutable variable reassignment.
  • Data & Text Processing - Manipulates strings, parses numbers, encodes text formats, and processes collections with built-in functions.
  • Array Folding Functions - Offers functional folds to reduce collections to single values without mutating outer scope.
  • Record Construction and Updates - Provides record construction and non-destructive update operations for immutable data structures.
  • Standard Library Collections - Ships a standard library with built-in collection processing functions like map, filter, and reduce.
  • String Concatenation Operations - Provides string concatenation, splitting, and searching operations through the standard library.
  • String Manipulation - Ships string manipulation operations including concatenation, splitting, trimming, and replacement.
  • Type Annotations - Supports optional explicit type annotations that the compiler verifies against inferred types.
  • Method Call Syntax - Resolves dot notation method calls to the corresponding module function at compile time.
  • Parameterized Types - Supports parameterized types like List and Try for generic data structures.
  • Unrecoverable Error Management - Halts execution using the crash keyword for unrecoverable errors where graceful handling is infeasible.
  • Constrained Type Variables - Supports constrained type variables for generic functions that require specific capabilities.
  • Code Evaluation Sessions - Evaluates expressions and tests code in a REPL session without needing a source file.
  • Conditional Expression Returns - Provides if expressions that evaluate conditions and return values from branches.
  • Trailing-Bang Effect Markers - Marks effectful functions with a trailing exclamation mark for syntactic visibility of side-effect boundaries.
  • Lightweight Assertions - Ships lightweight assertions with the expect keyword that are skipped in optimized production builds.
  • Language Implementations - Functional language compiling to machine code or Wasm.
  • Inspired By Elm - Language targeting WebAssembly inspired by Elm.
  • Elm Inspired Projects - Language targeting WebAssembly inspired by Elm.

Historique des stars

Graphique de l'historique des stars pour roc-lang/rocGraphique de l'historique des stars pour roc-lang/roc

Recherche par IA

Explorez plus de dépôts awesome

Décrivez vos besoins en langage naturel — l'IA classe des milliers de projets open source sélectionnés par pertinence.

Start searching with AI

Alternatives open source à Roc

Projets open source similaires, classés selon le nombre de fonctionnalités partagées avec Roc.
  • crystal-lang/crystalAvatar de crystal-lang

    crystal-lang/crystal

    20,299Voir sur GitHub↗

    Crystal is a statically typed, compiled programming language designed for high performance and memory safety. It leverages an LLVM-based compiler to translate source code into optimized machine-executable binaries, while its type-inference-based static analysis enforces strict safety rules during the build process. The language distinguishes itself through a fiber-based concurrent runtime that manages lightweight execution units for asynchronous input and output without blocking the main process. It also features a powerful compile-time macro system that allows for the inspection and transfor

    Crystalcompilercrystalcrystal-language
    Voir sur GitHub↗20,299
  • kaisery/trpl-zh-cnAvatar de KaiserY

    KaiserY/trpl-zh-cn

    5,501Voir sur GitHub↗

    This project is a localized educational resource for learning the Rust programming language, providing a comprehensive guide and technical specifications translated into Simplified Chinese. It serves as an instructional tool for studying language idioms, memory management, and type systems. The repository focuses on software documentation localization, converting official guides into Simplified Chinese to increase accessibility for non-English speakers. It utilizes a markdown-based system to organize content and supports multi-format export to static HTML, PDF, and EPUB formats for both web a

    Markdownpdfrust-booktypst
    Voir sur GitHub↗5,501
  • reasonml/reasonAvatar de reasonml

    reasonml/reason

    10,313Voir sur GitHub↗

    Reason is a strongly typed functional language and multi-target compiler designed to produce either JavaScript for web environments or native machine code for operating systems. It serves as an OCaml-compatible language that shares an abstract syntax tree with OCaml, providing a practical syntax for the OCaml ecosystem. The project functions as a type-safe frontend language, incorporating JSX support to build user interfaces through structural elements that translate into type-safe function calls. It enables deep integration with the JavaScript ecosystem, allowing the use of existing librarie

    OCamljavascriptocamlprogramming-language
    Voir sur GitHub↗10,313
  • rust-lang/rust-by-exampleAvatar de rust-lang

    rust-lang/rust-by-example

    8,026Voir sur GitHub↗

    This project is an interactive programming education resource and tutorial designed for learning the Rust programming language and systems programming concepts. It provides a collection of runnable and editable code examples that serve as a practical reference for language syntax and implementation. The resource features an interactive code sandbox that allows users to execute and test code snippets in real time. It emphasizes the verification of technical accuracy by executing embedded code blocks during the build process to ensure all examples remain functional. The content covers a compre

    Handlebars
    Voir sur GitHub↗8,026
Voir les 30 alternatives à Roc→

Questions fréquentes

Que fait roc-lang/roc ?

Roc is a statically typed, functional programming language built around immutable-by-default semantics, exhaustive pattern matching on tag unions, and a type system that combines optional explicit annotations with full compile-time type inference. Its core identity centers on correctness and expressiveness, using tagged unions for error handling with a question-mark operator for early error propagation, and a trailing-bang naming convention that makes side-effect boundaries…

Quelles sont les fonctionnalités principales de roc-lang/roc ?

Les fonctionnalités principales de roc-lang/roc sont : Platform and Package Declarations, Pure Computation I/O Abstractions, Block Expression Evaluations, Functional Programming Languages, Immutable Constant Definitions, Immutable Variables, Exhaustive Pattern Matches, Compile-Time Type Inference.

Quelles sont les alternatives open-source à roc-lang/roc ?

Les alternatives open-source à roc-lang/roc incluent : crystal-lang/crystal — Crystal is a statically typed, compiled programming language designed for high performance and memory safety. It… kaisery/trpl-zh-cn — This project is a localized educational resource for learning the Rust programming language, providing a comprehensive… reasonml/reason — Reason is a strongly typed functional language and multi-target compiler designed to produce either JavaScript for web… rust-lang/rust-by-example — This project is an interactive programming education resource and tutorial designed for learning the Rust programming… oi-wiki/oi-wiki — This project is a comprehensive, community-maintained knowledge base and toolkit designed for competitive programming.… evhub/coconut — Coconut is a functional programming language that compiles to Python. It functions as a source-to-source compiler,…