BuckleScript Is Rebranding
reasonml.org
reasonml.org
Unfortunately, after reading this blog post I think I'm even more confused than I was before. Are Reason and Rescript separate projects? It seems like there are now _three_ different syntax options: OCaml, Reason, and ReScript? Even if it's a good change in the long run, the lack of clarity is concerning...
Seems like it may be more stable to just stick with OCaml syntax and js_of_ocaml [1] for now...
Also interesting that OCaml is not mentioned a single time on the new website [2]. I guess they're trying to appeal to JS devs and sell it as a new thing, but seems useful to at least be aware that there's a connection to an established language?
[1]: https://ocsigen.org/js_of_ocaml/3.7.0/manual/overview [2]: https://rescript-lang.org/docs/manual/latest/introduction
> ReScript looks like JavaScript, works like JavaScript, works with JavaScript, and outputs to the highest quality of clean, readable and performant JavaScript. The big difference is that ReScript comes with a bulletproof type system, a solid build system, and a couple of extra features that'd make JavaScript users envious.
https://rescript-lang.org/docs/manual/latest/introduction
So you're saying their ecosystem supports other languages too?
That said, there were definitely some rough spots along the way, but I'm hopeful that this re-branding and unification of the infrastructure is a step in the right direction.
Besides that, the compiler becomes a partner in coding. - Refactoring things is no longer something I avoid, because the compiler will point out any unexpected places that interact with a given piece of code. - I can code for an hour without loading the app, and be reasonably certain that the code I'm writing will be more or less be correct. Overall, I feel like the compiler does the double-checking and second-guessing that I was always doing in the back of my head, which gives some peace of mind and frees me up to focus on the actual task.
Is there really a large audience of programmers capable of writing OCaml but not catching on that "BuckleScript" referred to the compiler? (For that matter, is there really a large audience of programmers capable of writing OCaml but only if the syntax superficially resembles JS? Maybe I'm the one out of sync here...)
As a language ages and evolves, I think it's easier for the authors and contributors to forget what it's like approaching it fresh. Many times documentation is written with an unintended assumption of an understanding of the ecosystem. Coming to the OCaml/Reason/BuckleScript ecosystem could definitely be confusing.
Here's what it looks like: a new language for cross platform typed functional programming targeting OCaml (server) and Javascript (browser) ecosystem compatibility, backed by Facebook & marketing to mainstream JS devs
Edit: The "rescript-lang.org" page is clearer -- it's the entire Reason/BuckleScript world is being rebranded into a single unifying thing. Still confusingly though, they call this the "documentation" site.
That might not have the ultimate React integration (guess that's the answer to the question). But on the other hand probably aligns better with the instinct of many developers to reduce (albeit not eliminate) levels of unnecessary layering.
I don't see any reason good React integration couldn't have been built on top of js_of_ocaml.
The whole BuckleScript/Reason project seems like it just made the whole ecosystem messier for very little gain.
From my point of view these are all interesting endeavors to watch from my shovel store, and in 10 years they all be stuck in maintenance projects, porting back to JavaScript.
I thought ReasonML is a language, an alternative to Elm, PureScript, or other FRP-focused compile-to-js languages. When I check projects on GitHub written using ReasonML it says "Reason" as a language name (why is it just Reason, and not ReasonML?). For example, Onivim: https://github.com/onivim/oni2
What's BuckleScript then? How is it related to Reason? If it's related why did it have such a seemingly unrelated name in a first place?
My understanding, is that confusion is part of why they're rebranding everything to ReScript. The language and compiler are now all ReScript.
I think the reasoning for the difference in naming is likely historical. I'm not sure, but I think BuckleScript came before the Reason syntax was developed. But it's not like BuckleScript has any connection to OCaml, either. So I dunno.
Reason is just JS syntax like sugar on top of Ocaml. The creator (of React as well) saw it as a middle ground to bring in the giant JS ecosystem and population which makes some sense.
- ReasonML is a thin syntactical wrapper on top of OCaml
- To compile it down to Javascript you need Bucklescript, an OCaml-toJS compiler developed by Bloomberg (IIRC)
and so on
All the tools need to be installed from different sites, have their own sets of dependencies and conventions etc.
npm install --global bs-platformNow that BuckleScript was rebranded to ReScript, we decided to move and simplify the BuckleScript related docs from reasonml.org to rescript-lang.org
As soon as we migrated all our existing Reason / BuckleScript users over to the new ReScript website (with Reason syntax toggling etc), we will most likely redirect reasonml.org to reasonml.github.io, which will yet again focus on pure ReasonML / Native docs.
More details will follow as we are making further progress.
I'm not sure what to make of:
> This has no impact on the development of the ReasonML language. In contrary, ReasonML can now focus on their goals, as much as we can focus on ours.
Does this mean that ReScript is/will be a language that compiles to js, but not machine code?
And that ReasonML will continue as an ocaml dialect that supports both compiling to machine code (eg for back-end services, native apps) - and to js - using the ReScript compiler? But only interop with ReScript when targeting js?
But the ReScript compiler supports three syntaxi going forward: ReScript(bucklescript), ReasonML and ocaml?
And the ocaml (native) compiler supports ocaml and reasonml - but not ReScript?
Edit: the site is now back
https://reasonml.org/docs/reason-compiler/latest/introductio...
The site is back up though. Next step is to plaster banners on each page directing users to the nee docs.
When it was done, the bucklescript github organization was renamed to rescript-lang, which caused a new github pages population to the edges that caused 404s in different regions. It takes a little bit of time until resources are forwarded correctly within GH.
For us in Europe and SF, it was actually working after we made the changes.
As soon as some community members had broken links, they assumed that the team intentionally didn't care about backwards compat, so someone recreated the BuckleScript github organization with a dummy bucklescript.github.io that made a single redirect to the rescript-lang.org site.
From there on all the carefully curated link forwardings were lost. Ironically this actually broke our backwards compat.
It took us a lot of investigation, contacting github, understanding the technical issues with GH pages until we found a solution to restore the original (working) behavior. People should have waited 1-2 days and everything would have just worked fine.
Well, that was a learning nonetheless. We invested many extra hours to get everything up and running again, but now everything works and it will hopefully continue on doing so.
Hopefully that issue solved by this rebrand - a language should have a unified website for Syntax, Compiler and Standard Lib, and Blog Updates.
reason [mass noun] The power of the mind to think, understand, and form judgements logically
--Alice: What are you using for that project?
Bob: I'm using Reason
It's pretty out of date here too. I can't remember if I tried to install with npm.
But then I remembered Reason exists and there is no argument about taking too long anymore because I can incrementally convert one function at a time if I need to.
I hope someone convinces the guy who shows up on Google under Rescript to use another name or something.
1) bucklescript 2) typescript 3) f# fable 4) scala.js 5) gopher.js 6) clojure 7) elm
That experience is similar to typescript "it's just JS" except that the HM type system feels like MAGIC when you compare it to TS.
When you work with cljs and elm you need to bring in the runtime so the payloads are large. Additionally errors in prod can be opaque as the output is usually minified and barely resembles your original source. I believe there is tooling around this but it is still not the same as regular JS in that regard.
Interop between reasonml and cljs is comparable - typing reasonml can take a bit of getting used to but there are escape hatches and gradual typing to allow you to incrementally type things.
So ELI5:
type system of Elm.
Interop and "impurity" of cljs but immutability encouraged by language
"its just JS" like TypeScript
Haven't used f#, scalajs or gopher
Unfortunately, because there are many many layers of complexity which is not always easy to google or discover it can be hard to get started
[0]: https://reasonml.chat/t/bucklescript-is-rebranding/2460
Guest languages are always fighting for adopting, require FFI, additional debugging tools, tend to create duplicate libraries for everything ('cause their use must be idiomatic in guest language).
Even when FFI is kind of copy-paste compatible with the platform language, eventually the platform language will introduce concepts that aren't that easy to integrate into guest language, or the shiny features from guest language require funnel interfaces to the host language, or aren't exposed at all, thus increasing the divergence.
Then comes the rebranding, which might introduce uncertainty into the ecosystem regarding its future.
So coming back to the platform languages.
C, JavaScript, Java, C#, PHP, Objective-C, Swift might be not be the best, and they have their warts (how I love to hate C), but at the end of the day they own the platform that made them what they are, and will stay around as long as their platforms are relevant.
Future of BuckleScript and Reason now both called ReScript.
It would seem bucklescript (the language/syntax) and bucklescript (the compiler) and the infrastructure for js interop will be named ReScript.
ReasonML (the syntax/language) will continue to work with both the ReScript compiler/framework and with the ocaml compiler.