Is rescript damaging Ocaml ecosystem?

Hello.
It is not my intention to criticize anyone or blame people about any decission.
It is just that this idea crosses my mind every time I want to start a pet-project in ocaml, or I read a new announce about rescript.

Also, I’m asking here because I’m almost an “outsider” of the Ocaml community and my perspective may be wrong looking from the outside. To put you an example, I’m a JS developer and I am tired of reading about the JS fatigue. Seems to be a problem for people that wants to get into the ecosystem, but once you are on it, you just use whatever you like and forget about the rest. I guess if this is a similar case.

The point of my thinking, and what brings me to make this question is that, when I discovered Ocaml through reason I was very happy. Reason was very familiar for me, and it was equivalent to Ocaml, so I could learn Reason, then transition to Ocaml. When I learnt more about Ocaml, Reason was still making sense for building the UI parts using the React integration. I decided to let the ecosystem mature a bit and come back when Reason were more mature (better IDE support, more bindings, etc). Meanwhile I just used ocaml for some CLIs.

For me, the toolchain was already confusing enough when rescript appeared, and the feeling that I had is that is that it was like starting from the ground up again. The worst part is that I could not just ignore it and continue using Reason and Ocaml because now Rescript is the official way to go for web. This is taking out attention out of my favorite syntax (Ocaml) and it’s taking advantage of the Reason name to position itself.
Every decision I read about the language seems to move it further away from the Ocaml mindset and put it closer to JS. I have the feeling that this is not anymore a toolchain on top of Ocaml but just a new language limited to the web, just like Elm is, and like Elm, decisions seems to be leaded by a very small set of people. I don’t think the web needs a new language, people is tired of frameworks coming out, and the same probably applies to languages.

Being an Ocaml enthusiast and a web developer I don’t like the idea of having to learn a third language just for the times I have to write an UI, or having to use the very weird %% things that you have to do if you want to use the Ocaml syntax, which who knows when they will decide to change again.

This is (from my react dev perspective) a very small community, which seems to split every few years into smaller and smaller ones. Everytime it splits it makes things harder to newcomers. Sure, it may be easy for the involved ones to understand where all this three flavours are coming from, but I had a very hard time understanding the difference between Ocaml and Reason when I started, I can’t imagine how confusing will look now.

What I want is to read opinions and feelings from the people who is inside the community. Maybe I see things wrong from the outside.

6 Likes

I will not debate the interest of rescript there is already plenty of threads about it.
I answer with a similar journey : entered in OCaml world 4 years ago thanks to ReasonML. I do Javascript, OCaml (native and with jsoo), ReasonML (with ReasonReact), Rust and i’m not interest in rescript-lang.

I think Rescript mainly damaged ReasonML : except on the amazing Revery project, there is few advantage to do ReasonML over OCaml.
What hurts is that OCaml community was defiant reagarding ReasonML (do we really need a syntax pivot) and Buckelscript (why not use the battle tested Js_of_ocaml) at the begining of ReasonML.
Last 2yrs lot of works were done to ease the use of ReasonML/OCaml regarding your preference (double documentation, etc), most of the works rather came from former OCaml devs than ReasonML ones.
When Buckelscript team announced the switch to rescript + rescript-lang the community discover how it is managed by a closed community. The way Facebook manage open source is not the way it is managed in OCaml community. The rescript team clearly decided to do a ML Elm/Purescript like ; no more make ReasonML alternative to F#/Fable or Kotlin Multiplatform.

If you like OCaml / ReasonML, you can still target javascript.
With js_of_ocaml + gen_js_api the experience is quite similar of what you known with buckelscript.
Even better cause your not lock to a specific version of OCaml because it compile bytecode to js.
Sure it lacks lot of plug and play libs like we had under the umbrella of redex … but it’s up to us to improve the ecosystem :slight_smile:
Except for react components (still in ReasonReact … but may change), we start our new js projects with OCaml + jsoo + gen_js_api at work.
In react perspective you can play with jsoo-react GitHub - jchavarri/jsoo-react: js_of_ocaml bindings for ReactJS. Based on ReasonReact. since it’s flagged “beta”, it’s quite usable.
If you don’t target react there is really good frontend frameworks like ocaml-vdom or incr_dom.

4 Likes

I’ve never used Reason, so I’m speaking purely as an OCaml user. (Also, I’m a nobody.)

In my view, the principle forces behind OCaml’s development have done an extraordinarily good job at:

  • Cleaving to, and deepening, the core principles of the language (modularity, reasonability, readability, performance, safety)
  • Experimenting with, and expanding, the language in ways that open up new possibilities, without compromising those principles.
  • Thoughtfully, gradually, and experimentally evolving a toolset to support the ecosystem.

As a result, OCaml has remained sustainable (reasonably backwards compatible, focused on a coherent vision) without giving up flexibility (new, genuinely useful, language features and tooling entering into the ecosystem in a steady stream).

IMO, none of this is damaged by Reason/Rescript. afaict, compared with the deep currents of OCaml’s development, all the perturbations around Reason are like ripples on the surface. Reason is fundamentally concerned with permutations of surface syntax. This is even the rationale for Bucklescript. When we reflect on the motivation behind Bucklescript, it’s not at all surprising that Reason has been characterized (at least in part) by volatile and fractious changes to surface syntax. I think Reason brought some added attention to OCaml. That may have been a boon for the things I care about. But I don’t think any damage has been done.

Now, a separate question is whether Rescript is damaging the Reason ecosystem. I am an outsider, and while I’ve definitely noticed the number of disgruntled notes on that topic, I am not in any position to evaluate “damage”. But I wish the Reason/Rescript communit(y/ies) the best, and hope that they are able find a healthy and satisfying way forward.

IMO, the OCaml ecosystem is well and good! The community around it is also welcoming and helpful! I hope that anyone who finds themselves disconcerted by the turbulence in Reason/Rescript will be able to find a welcoming and stable home in OCaml, should they wish it.

Jsoo is fantastic. A number of nice higher-level libraries are available on top of Jsoo, including bonsai, the aforementioned ocaml-vdom, or the recently discussed Brr. Backend support is also coming along.

If you haven’t seen it, I recommend the 2020 update on the State of the OCaml Platform.

[edited: to remove an unjustified and unhelpful opinion offered about Reacript’s effect on the Reason community.]

6 Likes

Hi I don’t understand why you have such attitude towards Rescript. But I do have great respect for OCaml community so it makes sense to have a clarification.

ReScript is never intended to compete against JSOO, if you are happy with JSOO, you should continue using it. They are for different audience, ReScript is for JS users, while JSOO is for OCaml users. And if you do want to play with JS libraries and JS ecosystem, your knowledge of OCaml still makes sense in ReScript, so I believe we are still doing good to OCaml users (maybe in a small style).

ReScript and ReasonML used to be branded as ReasonML. The fact is that ReScript does the majority of the work but most of the credits are all given to ReasonML. This is not a big deal. The separation is because we have different visions. We want to keep improving the quality of ReScript, and it is not aligned with the goal of ReasonML. The ReasonML parser alone is as large as ReScript the whole compiler. I hope it is a peaceful separation that ReasonML can keep its own goal, and we keep our original goal.

My vision is consistent over the years: we want to make the best language for JS users, and I deeply appreciate that we can reuse the best pieces of OCaml: the OCaml type system.

12 Likes

There’s absolutely no doubt that rescript has impacted the Reason/ReasonML community (not sure what to call them in aggregate, or if they should be aggregated, which suggests the problem already). Of course, there was/is much consternation in online fora about what rescript’s introduction means, but it’s not just online drama; e.g., a friend’s team (~10 staff) was about to start a fairly sizable project using Reason for both front- and back-end when the first announcement hit. The uncertainty it introduced (not to mention the incredibly poor messaging around it that continues to this day IMO) caused them to back off, and they eventually downshifted to Typescript.

I think it’s really hard to say how much of this washes into OCaml-land. Some things that seem sort of obvious IMO:

  1. Many people have discovered/adopted OCaml via Reason in the past (myself included to some small extent), a dynamic that will probably dwindle.
  2. Compared to when ReasonML was first announced, OCaml’s position is vastly improved on every axis, from fundamental capabilities to library ecosystem to tooling. I suspect and hope that this means that many more people will find their way to OCaml itself, even absent any more familiar on-ramps like what Reason once represented.

As @shonfeder said, one of the best qualities of OCaml is its stability, something that the rescript episode has helpfully underlined the importance of. And to @bobzhang’s point, rescript’s objectives being made manifest (i.e. not an OCaml with “more familiar syntax”, but strictly a Javascript [or Elm, if you like] alternative) should be very clarifying to questions that used to be quite ambiguous or up to interpretation (i.e. any prior debate around “should I use OCaml or Reason”).

Net-net, I think the developments are fundamentally positive for OCaml.

3 Likes

In 2018 my company was looking for a single expressive language to rewrite our client and server sides with. Using ReasonML as a means to convince my company that we’ll find help when we need to from JS developers, BuckleScript introduced me to OCaml as the winner (JSOO isn’t appropriate for some of our needs). So for the OCaml ecosystem, BS got us into OCaml, clearly positive.

The separation of ReasonML and ReScript, I see as a growing pain for the “typed JavaScript, better than TypeScript” crowd, not really surprising nor harmful. One of the two will eventually emerge and stabilize as the one “gateway drug” for JS developers to experience ML typing. :wink:

That said, the one detriment of ReScript to the OCaml ecosystem is that OCaml syntax support has been dropped* while it remains the most future-stable syntax available until ReScript itself stabilizes. It’s also still, I think, the best bet for a common syntax on client and server sides, JSOO aside. (*The compiler still supports it, but it’s not documented.)

So my hope is that ReScript will embrace its OCaml origin and resume documenting for that syntax in addition to its own, as it used to, as long as the compiler supports it. That would help introduce people in the situation I was in, who need the compiler and not the alternate syntaxes, to the OCaml ecosystem.

3 Likes

This thread makes me quite sad, I don’t demand anything from open source users or receive financial support from them. In the end I got complaint that I did not serve them very well.

16 Likes

In my case, let’s turn this around: would you be open to contributions to the documentation? I was under impression that OCaml syntax documentation was removed by choice, but I could be mistaken. I’m not fluent with all the intricacies of the FFI, but I’d be happy to get the ball rolling if it’s something you’d be interested in. :smiley:

1 Like

I don’t directly care about Reason, but as a gateway to OCaml, I do think it has been damaged. There happened to be a confluence of factors that made Reason gather massive momentum:

  1. A fairly famous person from a dominant company created this new syntax for OCaml that provides a strong value proposition: use the same typed language for backend and frontend.
  2. A compiler fork (Bucklescript) that could leverage this new syntax to produce readable Javascript and relatively easy interop with JS.

The second part of this combination decided that they weren’t happy with the arrangement, and decided to rebrand. As a result, they’ve added major confusion and uncertainty to the whole project. All you need to do is look at hackernews to see the result.

However, I think many people in the ReasonML ecosystem have learned a valuable lesson about the dangers of new, unstable tech. People who were pushing for ‘new stuff’ just for the sake of newness, having been burned, are now coming to appreciate the reliability and stability of OCaml. Hopefully the momentum can be rebuilt/maintained, but the name confusion alone that the rebranding caused is a major hindrance to future success.

3 Likes

The feeling that I have is that I had the opportunity to try something I liked and then that was taken away from me.
I am a JS developer, so taking advantage of the big, big, js ecosystem is something I really appreciate. Writing Bucklescript bindings was easy, and I invested some amount of time learning how to properly do them.
Everything was perfect for me: I can write most of my logic in Ocaml, the UI-react parts in ReasonML, do whatever binding I may need from any random JS library I like and quickly iterate on a fully typed language and then compile everything up with the same toolchain. Also, the REPL really helped me to learn Ocaml. When I was not sure about how to do something, I just write it on Reason, go to the Repl and get and idea of what I should be doing. It was amazing.
Additionally there was the easy selling point of Reason, and I had the impression that I can use Reason to introduce both Ocaml and Reason to someone/some company. It was as simple as say: look, there are react bindings, it is backed by the react team, and outputs very readable and performant js code (important during a transition).

Now almost all that is gone (specially the selling points). Now I have to choose to introduce Ocaml (which looks alien to many), or to introduce rescript (which is too young and feels unstable). That leaves me with a sensation of loss.
Also as a JS developer I’m tired of JS syntax, and I don’t like that one of the best alternatives to JS is getting more and more similar to JS :sweat_smile:

I don’t want to make anyone sad, but I had the impression that the fork of Rescript from what I thought was a unified language experience took away from me several things I really liked about the Ocaml/Reason world.

2 Likes

When you say Rescript you mean Bucklescript? True, I totally forgot that. I thought it was reason what was rebranding… Yeah, now I remember better. Sorry, this is confusing for an outsider like me :grinning_face_with_smiling_eyes:

1 Like

Having led and participated in nontrivial open source projects, I understand and sympathize with this feeling.

You and the rescript team chose the path you believe to be right. Some will disagree with those choices, and some of those will give voice to that disagreement. I suspect everyone wishes the best for rescript, the team, etc., but surely it’s not surprising that such significant changes of direction would produce controversy, second-guessing, and so on.

8 Likes

I am sure there are many more people who appreciate the work you are doing on rescript/bs-platform than those who don’t.

5 Likes

I’m not clear on how ReScript is damaging OCaml specifically. It seems to me that in the past few years with Reason and now ReScript, there has been a resurgence of interest in leveraging OCaml and that has led many more people back to OCaml, actively contributing e.g. things like Sihl, ocaml-decimal, and others that are not at the top of my head right now.

It seems to me that the only thing ReScript did was wipe out a tiny niche: being able to use Reason on the backend with the opam or esy toolchains, and Reason on the frontend with BuckleScript. I mean ‘wipe out’ in the sense that it still exists, but it’s not the recommended approach going forward.

For people who want fullstack OCaml or Reason or ReScript, the following options are still viable:

  • Opam/dune toolchain with OCaml syntax + ocamlc/ocamlopt backend and jsoo frontend
  • Same as above but with Reason syntax
  • ReScript on backend (with Node) and frontend

Sorry but I don’t see that there is anything here which justifies strong words like ‘damaging the OCaml ecosystem’.

9 Likes

That’s why it’s better to ignore threads like this to maintain your own sanity.

The premise of this thread is a little ridiculous. Did F#, Rust or any other OCaml inspired language damaging to the OCaml ecosystem? Absolutely not. If anything, we should be grateful that such efforts increased the mindshare OCaml gained through these efforts.

28 Likes

I think this response is a more fair reflection of your experience with ReScript than your original take. ReScript does not damage the OCaml community in anyway, but its development does not meet your personal expectations of the project. You envisioned a gateway drug to OCaml that makes it easy to ramp up JS devs, while the authors of ReScript had something else in mind. It’s unfortunate that it happened this way, but if you’re an outsider, you really shouldn’t expect the core team to build consensus with you (and the so called “community”) before pushing it in the direction they see fit.

12 Likes

That’s why I’m here, asking for a different perspective on the topic from people within the community.
I admit that I could have phrased the title of my post better, but thinking about it, I don’t come but much better alternatives that are still short.

1 Like

They were completely separated projects from Ocaml. Rescript is a rebrand of Bucklescript, and some of the resources that were previously available (like having docs in two syntax) are now gone. Also, people trying to try the language for the first time will probably get confused about the history of the three languages. I have been tasting Reason, Ocaml for years (like one project each 6 months or so) and I still find it confusing, and the new instability I perceive (important part, I perceive) does scare me off putting more time and effort into it.
But some of the answers of this thread are proving me wrong, and maybe I should change my perspective on the topic (which is exactly what I was looking for)

2 Likes

I think this thread has also changed my perspective a bit.

ReScript seemed like a confusing rebranding to me, but now I think it’s
clearly a separate language that really has nothing to do with OCaml’s
ecosystem. It just happens to reuse parts of the compiler (parsetree,
typetree, typechecker in general) and associate tooling (ppxes?).

However I’m still not sure what the future of Reason is: is it
maintained? Will it be a valid syntax for native OCaml in 10 years? So
in this sense ReScript might throw doubt about the future of Reason.

If you want stability, clearly sticking to the OCaml syntax is the best
bet, it hasn’t broken in > 20 years :slight_smile:

11 Likes

Previously, ReasonML and OCaml had become quite intertwined; the same interconnectedness and interoperability that allowed one to suggest newcomers to try Reason as a way to get started with OCaml has led plenty of people that understandably don’t grok the differences between all of the components and communities involved to question whether the rescript developments mean that OCaml is somehow less sustainable or more unstable or whatever.

I think it’s very fair to state (and re-state, as needed) the reliable boundaries that never actually went away, and reassure anyone that doesn’t follow every jot and tiddle of inter-project news that these developments fundamentally aren’t material to OCaml or any developer’s relation to it.

1 Like