Aug 10, 2020

BuckleScript & Reason Rebranding

A new unified experience for the platform

ReScript Team
Core Development

We're pleased to announce that BuckleScript is getting a brand new name: ReScript.

History & Summary

  • OCaml is a typed FP language compiling to bytecode and native code.

  • Js_of_ocaml is based on OCaml and compiles to JavaScript for OCaml users.

  • BuckleScript is a fork of OCaml that also outputs JavaScript, optimized (features, JS interoperability, output, build tools) for JS developers rather than OCaml developers.

  • Reason is an alternative, JS-looking syntax layer over OCaml, plus extra tools. Reason used 1. BuckleScript to produce JavaScript output and 2. OCaml to produce native output. Most of the community focused on the former usage.

  • Reason and BuckleScript shared most teammates, who wanted to double down on the JS use-case.

  • ReScript, thus born, is the new branding for BuckleScript that reimplements or cleans up Reason's syntax, tools, ecosystem & docs into a vertically integrated experience.

  • Reason project will continue serving its purpose of a syntax layer for native OCaml. Some folks might use Reason with Js_of_ocaml to output JS code.

Community Situation

BuckleScript started with the idea that JavaScript programmers deserved a great typed language with a fast and lean toolchain. This idea took root and, over the years, we've gradually accomplished feats such as:

  • a state of the art compiled JavaScript output that rivals hand-written JS,

  • a fast & reliable toolchain much needed in front-end and Node development,

  • various JS interop features that spawned an ecosystem of well typed libraries,

  • a production-ready standard library,

  • and recently, a fresh syntax made by a major contributor of Reason's old syntax.

These developments have attracted many people into our community. But one bigger challenge persisted: newcomers dropped out at the sheer amount of extra incongruent tools and learning overhead from having to understand OCaml concepts, Reason concepts, and BuckleScript's concepts. Take, for example, what's required to make a React app using BuckleScript:

  • Knowledge of React.

  • Knowledge of JS.

  • Knowledge of BuckleScript's specific bindings to React (that we've tried hard to keep to a minimum).

  • Knowledge of OCaml idioms, which leaked through BuckleScript.

  • Knowledge of BuckleScript's JS interop and the build system.

  • Knowledge of the Reason syntax.

  • Avoiding the distractions of OCaml and Reason's unrelated, native-oriented build tools, package manager, etc.

Ironically, the more documentation we pile up, the more mental overhead newcomers suffered. During the meetups, we've frequently seen folks' enthusiasm crushed at the sheer prospect of making a web app while keeping 5+ tabs' worth of documentations open. This was discouraging for everyone.

The adoption barrier is real, and it's about time we finally solve it.

The Rebranding

Today, we'll start to truly unify the various BuckleScript-related projects under the ReScript umbrella. This includes:

  • The compiler, build system and the new syntax unified under a single installation.

  • Doubling down on editor tooling for ReScript usage.

  • A single documentation site (this one), which unifies all the docs and greatly trims down on redundant and stale info.

  • Streamlined communication through said website, a forum and a new Twitter.

  • The renaming of various tools, always in a backward-compatible way.

In short, all JS-related concepts previously under disparate Reason and BuckleScript ecosystems are now called ReScript. Previously, due to the messy situation, most real-world BuckleScript adoption came from a few heroic community members suffering through the technical and social risk of spreading our tech to their coworkers. From today onward, you can simply tell to your coworkers: "this is ReScript", and point to them a clear starting point.

It's worth emphasizing that while this rebranding seems disruptive, it's mostly a bunch of name changes for the same tech. The Q&A below addresses some of the worries on existing code.

Q & A

What's that recently released BuckleScript syntax called?

There's no dedicated name for the syntax anymore. It's simply called the ReScript syntax. The extension is .res and .resi. Existing tools operating on .ml, .mli, .re and .rei continue working.

Will there be a migration script to gradually convert our code to the new syntax?

Yes. See our migration page. You can mix and match old and new code for a smoother transition.

Will BuckleScript (now ReScript) break my existing code?

No. The new syntax & tools sit alongside the existing code. We won't remove OCaml and Reason support from ReScript for a long time.

What's the editor tooling story?

Much more streamlined now! See our Editor Plugins page.

Reason-language-server will continue working as-is for existing usage. We as first party don't work on ocaml's language server.

Will I be able to continue writing OCaml/Reason and compile to JS using BuckleScript in the future?

It follows from our previous answer that yes, you will still be able to. Though community-wise, we're encouraging the new syntax and tools.

The compiler will also continue to acquire upstream OCaml features when relevant.

Will the new syntax prompt the move to a non-OCaml AST?

No, since that'd break existing ppxes (e.g. internationalization, graphql). If we feel the need to adopt a new AST in the future, it'll again be purely additive.

Will we have 3 syntaxes to worry about?

The plan is to emphasize the new syntax and focus our tooling around it. It'll be confusing to temporarily have different syntaxes in the same codebase, but that's the cost of a proper migration support. We hope this is transient; it's darkest before the dawn.

How do we address the fragmentation of the community by the new syntax?

Folks who have been in the community for a while know that there have always been opposing philosophies regarding newcomer funneling, tooling emphasis, library preferences, etc., due to differing cultures.

Rather, it's more accurate to say a few pieces of awkwardly shared infrastructure held opposing forces together. This is true when Reason spun off from OCaml's engineering, and true when BuckleScript entered the picture.

We can't realistically always release new features that are a compromise of various philosophies, but that's exactly what we've been trying to do for the past few years. BuckleScript's reimplementation of the Reason syntax is a departure from that (much tighter integration with the compiler, more JavaScript/TypeScript-friendly philosophy, fewer compromises, faster, less buggy). We believe that its quality speaks for said departure.

The ReScript community will comprise of the majority of the old Reason community, most of which focused on the BuckleScript part already. The remainder of the Reason community still exists and will now focus on their existing use-case better.

The new changes make me worried about the future support I'm going to receive from the team.

Retrospective edit, in 2021: suffice to say that we've been doing well =).

Conclusion

Thank you for your support and keep shipping. A brighter future awaits us!

Stay safe,

The ReScript team (Hongbo, Cheng, Cristiano, Maxim, Patrick, Ricky).

Want to read more?
Back to Overview