Software:ReScript

From HandWiki

ReScript is a high-level programming language that transpiles to JavaScript.[1] Its syntax is descended from the Reason programming language, which is an alternate syntax for OCaml.

Language characteristics

ReScript shares characteristics with its ancestors Reason and OCaml. It is a statically typed language with a sound type system, and it emphasizes functional programming.[1]

However, ReScript’s syntax has started to evolve away from OCaml and closer to JavaScript. For example, it uses the same arithmetic operators for integers and floating point numbers (like JavaScript),[2] while OCaml[3] and Reason[4] use separate operators.

Since ReScript transpiles to JavaScript, it can access the entire JavaScript ecosystem. It can both call JavaScript functions and have its functions called from JavaScript.[5] It has direct language support for the React front-end web library, including JSX.[1]

History

ReScript traces its roots back to BuckleScript, a compiler that compiled OCaml to JavaScript, which was first released in 2016 by Bloomberg L.P.[6][7] In the same year, the Reason programming language was released, which was an alternate syntax for OCaml that was more similar to JavaScript. As both projects were influenced by JavaScript, Reason and BuckleScript soon became an integrated toolchain.[1][8]

However, the BuckleScript team and the Reason team had different priorities. The Reason team wanted to maintain compatibility with the OCaml ecosystem, while the BuckleScript team wanted to be able to change the syntax to give the best developer experience to JavaScript programmers.[8]

In 2020, BuckleScript introduced a new syntax that started to diverge from Reason.[9] A month later, the BuckleScript team rebranded its toolchain to ReScript, to focus solely on the JavaScript ecosystem and essentially becoming its own language, distinct from Reason.[1][10] ReScript’s support for compiling OCaml ended with version 12,[11] released in 2025.[2]

References

  1. 1.0 1.1 1.2 1.3 1.4 Yang, Danny (December 2022). "Introduction". Introducing ReScript: Functional Programming for Web Applications. Apress. https://learning.oreilly.com/library/view/introducing-rescript-functional/9781484288887/. 
  2. 2.0 2.1 Curtis, Daniel (2025-12-31). "ReScript 12.0 Released with New Build System". InfoQ (C4Media). https://www.infoq.com/news/2025/12/rescript-12-release/. 
  3. Madhavapeddy, Anil; Minsky, Yaron (October 2022). Real World OCaml (2nd ed.). Cambridge University Press. https://dev.realworldocaml.org/guided-tour.html. 
  4. Eisenberg, J. David (2019-04-09). Web Development with ReasonML. Pragmatic Bookshelf. pp. 5–8. https://learning.oreilly.com/library/view/web-development-with/9781680506884/. 
  5. Yang 2022, pp. 203–210.
  6. "BuckleScript: The 1.0 release has arrived!". 2016-09-08. https://www.bloomberg.com/company/stories/bucklescript-1-0-release-arrived/. 
  7. "Open Source at Bloomberg: Introducing BuckleScript". Bloomberg. 2015-05-12. https://www.bloomberg.com/company/press/open-source-at-bloomberg-introducing-bucklescript/. 
  8. 8.0 8.1 Zhang, Hongbo (2021-02-07). "A Short History of ReScript (BuckleScript)". https://discuss.ocaml.org/t/a-short-history-of-rescript-bucklescript/7222. 
  9. Cite error: Invalid <ref> tag; no text was provided for refs named bucklescript-8-1
  10. ReScript Team (2020-08-10). "BuckleScript & Reason Rebranding". https://rescript-lang.org/blog/bucklescript-is-rebranding. 
  11. "Migrate to v12: Language & syntax". https://rescript-lang.org/docs/manual/migrate-to-v12#language--syntax. 
  • No URL found. Please specify a URL here or add one to Wikidata.
  • on GitHub