On keeping the Ocaml syntax alive

The blog post explains very well why and how you want to bet on one consolidate platform instead keeping lots of different parts together. This makes absolute sense and from what I’ve seen of Rescript so far, I like it, especially its JS integration.
But could you eventually consider giving a little bit more love to the old Ocaml/Bucklescript syntax? Because I as much as I like Rescript as a language, I’m not only interested in the Javascript platform. And since Rescript is limited to Javascript, I would have to switch between Ocaml backend and Rescript frontend, which I don’t like. The old Ocaml syntax solved that issue, even if it was not very elegant and clean. So please - buckle up and keep your grandfather alive …


That’s not really within the scope of this project anymore, as far as I know. ReScript is focused purely on transpiling to JS, the native aspect stayed with ReasonML. These tools are still available here here and here. That being said, you can absolutely run your backend on ReScript using node.js! So full stack applications in ReScript are definitely still possible, and arguably better, since now you can keep everything transpiled to the same language. That’s not to say that node.js is the best option for every backend (it’s not), but for a lot of cases its good enough.


I find it encouraging that Rescript makes this strong difference between compiler and syntax. This maybe an opportunity to “plug” the Rescript syntax in front of the traditional Ocaml compiler pipeline one day.
But that’s not an expectation or a demand that I have. The thing I was trying to say, please don’t treat “old” Bucklescript/Ocaml syntax like a burden. There are still people (like me) who prefer bucklescript (aka rescript) to js_of_ocaml even if they like the Ocaml tooling better.

The direct translation between the Ocaml/Reasonml/Rescript semantics and javascript is a very interesting feature, no matter how polished or not the syntax is. I know a lot of Ocaml folks prefer js_of_ocaml because of the better tooling, but personally I like the way Rescript integrates Js much better.

Personally I don’t particulary like the fragmentation between of Rescript and Reasonml, because the differences and subtle syntax incompatibilities can cause confusion. And I think getting rid of the whole Reasonml past could be deliberating. But I dont see this problem with the Ocaml syntax.


please don’t treat “old” Bucklescript/Ocaml syntax like a burden

Well, maintaining any project is a burden. It doesn’t mean it’s bad, but there is only so much time the ReScript team has, and the more any project gets spread out, the worse the quality of any individual part becomes. When BuckleScript became ReScript, it went from tooling and a library to a separate language. They are still maintaining interoperability with ReasonML and/or OCaml syntax (and I don’t think they’re planning on dropping it any time soon), but I doubt it’s going to be a priority. I’m not on the team though, so I’ve no clue.

Essentially: ReScript is its own language now. If you want to still write your code in OCaml, you certainly still can, but the ergonomics of such code is unlikely to be the focus. My advice is to either write your frontend and backend in different languages (which is not uncommon), or use Node.js to write the entire thing in ReScript.

1 Like