Reason
  • Documentation
  • Essayer
  • API
  • Communauté
  • Blog
  • Languages iconFrançais
    • 日本語
    • English
    • Deutsch
    • Español
    • 한국어
    • Português (Brasil)
    • Русский
    • Українська
    • 中文
    • 繁體中文
    • Aider à la traduction
  • Github

›Intro

Intro

  • Quoi & Pourquoi

Installation

  • Installation
  • Plugins éditeurs

Principes de base du langage

  • Aperçu
  • Let Bindings
  • Primitives
  • Basic Structures
  • Types
  • Records
  • Variants
  • Options and nullability
  • Functions
  • Recursion
  • Destructuring
  • Pattern Matching
  • Mutable Bindings
  • Loops
  • Modules

Advanced Features

  • JSX
  • External
  • Exception
  • Objet

JavaScript

  • Interopérabilité
  • Cheatsheet de la syntaxe
  • Pipe First
  • Promesse
  • Bibliothèques
  • Convertir depuis JavaScript

Extra

  • Foire aux Questions
  • Goodies supplémentaires
Translate

Quoi & Pourquoi

Qu'est-ce que Reason ?

Reason is a programming language powered by OCaml's strong type system, and has a syntax designed to feel familiar to people coming from JavaScript or C-family languages.

Note: Reason can be translated back and forth to OCaml using refmt. Anything possible in Reason is also possible with OCaml and vice versa.

Why Use Reason?

The powerful typesystem underlying Reason will reduce bugs, increase maintainability, and improve the refactorabilty of your code.

Different Environments

There are several projects that allow Reason (and OCaml) to be used in different environments.

  • Native Executables: Using the standard compiler native executables can be built and run directly on your machine.
    • Tools: dune, esy
  • Browsers: There are several projects that will compile Reason to equivalent JavaScript code that can be run in the browser.
    • ReScript (formerly BuckleScript)
    • Js_of_ocaml

Where do I start?

  • For an introduction to most language features check out the overview
  • To start immediately an online REPL is available at Sketch.sh

Alternatives

Here are some alternatives that share similar concepts with Reason:

  • Rust. Inspired by the ML family of languages, but not garbage collected. Has excellent parallelism support.
  • Elm. Another great language in the ML family. Focuses on building web applications. See the widely praised talk on Elm, Let's Be Mainstream.
  • PureScript. Inspired by Haskell, compiles to the JavaScript.
  • Fable. Based on F#, which is closely related to OCaml.
  • ClojureScript. Dynamically typed language that prioritizes simplicity & great interop.
  • Swift. Language built by Apple, and interoperates with Objective-C well.
  • Haxe. Compiles to basically anything with a focus on game development.
Installation →
  • Qu'est-ce que Reason ?
  • Why Use Reason?
  • Different Environments
  • Where do I start?
  • Alternatives