15 ms·
ReScript 8.4
- bgorman 6y agoI'm pretty disappointed with the way this has unfolded. For those now familiar with ReScript, ReScript started as "reason" an alternative syntax for Ocaml. Recently ReScript was created with a sytnax more similar to TypeScript than "Reason". In addition, there is a fork of OCaml for compiling to javascript that used to be branded as "Bucklescript", but now it is called "ReScript" as well. So now as of 12/14/2020 there are three Ocaml syntax versions in use: Ocaml, Reason (Reason 3.6, last version available for native code) ReScript, (~Reason 4, only available for javascript compiler fork, some sytax present in Ocaml/Reason has actually been removed with no equivilant in the grammar) I am not sure who benefits from this, Ocaml is a serious language that will never be as simple as a dynamically typed language. I am not sure who this is supposed to be helping. It seems to me that things were more clear a year ago when there were just two syntaxes available. In addition, it now takes a relative subject matter expert to disipher what is going on, which i think is the exact outcome ReScript was trying to avoid.
- giantDinosaur 6y agoI'm rather confused: what is ReasonML ? is ReasonML now ReScript, or is it still its own thing? A quick google suggests ReasonML is for targeting native platforms? But I used it for the web at one point? Anyway, there was already a problem with like three different standard libraries (which had super annoying differences like swapping parameter orders, presumably in an attempt to be friendlier etc.) or something when I first messed around with ReasonML (Bucklescript? Whatever the Facebook one was in 2019? I dunno.) and I hope this isn't also increasing that problem ?
- ezrast 6y agoReasonML is merely an "alternate syntax" to OCaml, meaning it's a separate language that parses to the same AST. Traditionally it's been used along with Bucklescript, an OCaml-to-Javascript compiler developed by the same people, to do web work, but it's well-supported in the native OCaml compiler ecosystem as well. Now that ReScript has superseded ReasonML+Bucklescript, the only niche remaining for non-legacy ReasonML is native development work by folks who just don't like the normal OCaml syntax, or want to target both runtimes with the same code. Basically, the permutations are like this, with "ReScript (backend)" referring to the thing formerly known as BuckleScript: OCaml/native: What normal people think of when they hear "OCaml". ReasonML/native: Uncommon, but supported for folks who've bought into the Reason syntax. ReScript (frontend)/native: Nobody does this since ReScript is strictly worse than ReasonML when targeting native. I don't even know if it's possible. OCaml/ReScript (backend): Should be possible, but nobody does this. ReasonML/ReScript (backend): Sort-of-deprecated in favor of the new syntax, but still supported, and most pre-existing projects are probably still using this. ReScript (frontend)/ReScript (backend): Now collectively known as "ReScript" and the focus of the team going forward. New web projects are expected to use this.
- giantDinosaur 6y agoThanks. That makes it very clear (to me), although definitely a harder sell to have to explain all these possibilities to others.
- d3nj4l 6y agoAFAIK there isn't a ReScript to Native compiler. The way to do server-side ReScript is to use Node.
- scns 6y agoPaul Biggar of Darklang started a stdlibrary called tablecloth which offers the same API on frontend (Bucklescript/Reason) and backend (OCaml).
- rienbdj 6y agoYet he too gave up on ocaml
- frou_dh 6y agoYet another standard library for OCaml? You sure it wasn't a parody? :) I can think of: TheActualStdlib, Base/Core_kernel/Core, Batteries, Containers, Belt, ...
- pbiggar 6y agoIt has different goals from them: https://github.com/darklang/tablecloth https://github.com/darklang/tablecloth
- steinuil 6y agoThis feels a lot like what happened to Hack, which at first was compatible with PHP and could be compiled to it, but later became its own language to better fit FB's needs, and it seems like they're giving OCaml the same treatment here with ReScript. There was actually some effort being made to keep OCaml tooling compatible with ReasonML (which is supported by dune[0] with no additional configuration) and BuckleScript integration with dune, which was being worked on before this rebrand, so it's kind of sad to see FB going off on their own with ReScript because they don't wanna do the work to upstream the changes they need. By the way, regular OCaml also has its own JS backend[1] which is of course completely incompatible with BuckleScript. 0: https://dune.build/ https://dune.build/ 1: https://github.com/ocsigen/js_of_ocaml https://github.com/ocsigen/js_of_ocaml
- swuecho 6y agonot sure if it's FB's decision or the project maintainer's. I am rather disappointed and think F# 's Fable is a better alternative.
- xfer 6y agoSorry to say, it's not. F# is nowhere near the wonderful type-sytem of Ocaml(although it's intentional). I would stick with js_of_ocaml for my js needs.
- swuecho 6y agolast time I check, did not find a way to integrate jsoo easily with existing js code. is it any tutorial on how to write a js lib using jsoo?
- xfer 6y agoYou have to write binding glue code. Last i saw reason also required binding code to work. Here is a react binding for jsoo: https://github.com/jchavarri/jsoo-react https://github.com/jchavarri/jsoo-react .
- 6y ago
- RobertKerans 6y agoFeeling the same about this. Things were far clearer prior to this year -- I can no longer really see the point of the project and I'm just a bit sad about how it's all evolved. I've been following it since just before FB came in with ReasonML. I'd just started playing around with OCaml, found Bucklescript (which I still think is a marvel). Reason seemed like a way [albeit via that syntax] to get some traction for a very good language that imo seriously lacks in community, libraries and documentation. It felt slightly like Elixir, filling in a few holes in the underlying language and adding a layer of consistency. And it seeed a very good alternative to TS. But instead of coalescing into something, it seems to have just fragmented things further I hope something good does coalesce, but it's currently very confusing. Maybe just me but the opportunity feels like it's slipping away. As say, been following things very closely so I fully appreciate some the issues & understand some hidden things are based on internal needs of that part of FB
- xfer 6y agoMoreover it's hard to figure out which Ocaml version is Rescript on? Last i checked it was on 4.06, Do they backport any features, bugfixes? Now it seems like it's a complete fork with a new syntax. Maybe it serves the interest of people at facebook, but Ocaml users are unlikely to be using this instead of js_of_ocaml.
- swuecho 6y agowell. rescript still compile pure ocaml code just fine.
- xfer 6y agoOcaml is a moving target, new features are added. Bucklescript was 4.02 for a long time before moving to 4.06. It is unclear what the current status of Rescript is.
- spyder81 6y agoIt's still on 4.06, I think in 2021 they're targeting an upgrade (they haven't said how far forward they will upgrade to)
- banjomet 6y agoI think the only cool project using ReasonML that is native is revery[0], which is being used for onivim[1]. [0]: https://github.com/revery-ui/revery https://github.com/revery-ui/revery [1]: https://onivim.io/ https://onivim.io/
- n42 6y agoI am very disappointed by this as well. I am worried ReScript may have killed the momentum ReasonML had been gaining. This is how I understand this: 1996 - OCaml is born. 2016 - ReasonML, an alternative syntax that compiles to OCaml, is launched by Facebook. 2016 - A couple of months later, BuckleScript, an OCaml -> JS compiler is launched. 201X - Collaboration happens, BuckleScript couples tightly to ReasonML. 2020 - BuckleScript forks the ReasonML syntax and rebrands the compiler and the new syntax together under ReScript. 2020 - ReasonML still exists? Ok, fine. What is not clear to me is how the Facebook team behind ReasonML fits into ReScript. Are they aligned on the direction to take this community? What is the future of ReasonML? What was the goal? If it was to ease adoption by newcomers, as a newcomer, it has made this more difficult. As someone VERY EAGER to enter this family of languages today, I ended up giving up on all of that and decided to just learn OCaml. Now I'm dealing with Dune, Esy, OPAM, two competing async libraries and a community that is split between Jane Street libraries and the others.. but I really, really like OCaml!
- d3nj4l 6y ago> If it was to ease adoption by newcomers, as a newcomer, it has made this more difficult. As someone VERY EAGER to enter this family of languages today, I ended up giving up on all of that and decided to just learn OCaml. This was my exact path. A friend and I wanted to make a small SaaS using Reason for the backend, because it smoothed out a bunch of what we considered were "rough edges" in OCaml. Then the ReScript split happened, and we realised that Reason was dead for all intents and purposes. It's hard to imagine the Reason team will continue updating Reason when they're focusing hard on ReScript instead.
- vijaybritto 6y agoI know Reason/Rescript was to make OCaml's type system available to the JS devs and is an excellent alternative to typescript but its quite hard to follow. I'm a JS developer with no experience in statically typed languages. I'm not able to figure out what exactly is the way to do things we usually do in JS ecosystem. I mean things like a package manager, build system. These things are confusing. I'm pretty sure that there are tons of people turned away from Reason for this very same reason. Also OCaml in Windows was hard to configure and get right. The barrier to entry into the ecosystem is huge and it has to be resolved. The language is beautiful but anyone needs to be able to get productive in it very quickly.
- jitl 6y agoI want to write my front end and back end in the same language - Reason - and compile the backend to native code. So, ReScript doesn’t work for me? Are people still using or working on Reason, or is it dead? I feel like this fork might make sense inside Bloomberg, but it’s killed my enthusiasm for this language family.
- merlinsbrain 6y agoTheoretically, ReScript will support ReasonML syntax, and theoretically ReasonML can still be used for native development. The messaging isn't clear on ReasonML's future at ALL though. Is it essentially deprecated until the full switch to ReScript happens? The Rescript FAQ mentions changes will be additive in supporting ReasonML, and they will track new features to OCaml, but will they track new features to Reason? Will anyone actively develop Reason anymore?
- spyder81 6y agoReasonML is, as it has always been, a 100% syntax map to OCaml. It will always be that, but moving forward it will be nothing more than that. Compiling future ReasonML versions to JS will require js_of_ocaml. The success of BuckleScript meant that a _lot_ of people used what they thought was ReasonML but it was really ReasonML+BuckleScript. This lead to a ton of confusion the moment newcomers realised they needed a second website to look up APIs. ReScript includes a snapshot version of ReasonML for backwards compatibility, but it will never be upgraded. The future of ReasonML is likely slow and steady progress, potentially fading into obscurity as the target audience is now very small (OCaml developers who don't like OCaml syntax).
- deleted 6y ago[deleted]
- spyder81 6y agoYou might have been able to use the same syntax before, but writing code for Reason native was already very different to writing Reason+BuckleScript for the browser. This just formalises the split. To write the same code for both front and back end js_of_ocaml has been the standard since long before Reason came along, and it works just fine with Reason native.
- chubot 6y agoAre there any good examples of open source projects written with ReScript? I was searching for this recently and came up short... Is it mainly being used inside Facebook? Kind of a shame as the ideas look good. I would like something like Elm, but Elm doesn't interoperate with JS.
- testcross 6y agoactually I think that it is basically not used inside facebook anymore. But it is used in a bunch of other companies.
- vijaybritto 6y agoNot in Messenger too?
- testcross 6y agofrom the feedback I got, they migrated to something else
- chubot 6y agoHm so what does Facebook use? I saw a talk that was marketing Reason as "React as a language"? Is that true for ReScript, or no? Presumably Facebook still uses React? But they use it via regular JS and not Reason or Rescript? I do have to concur with some of the comments -- the situation seems pretty confusing, and spending a bunch of time looking at docs didn't enlighten me.
- testcross 6y agofrom what I heard, they use typescript instead of reason for some time already. I don't know if they use react or not. I also heard that they weren't always using reasonreact even when they were using reason. So they've never been 100% on the same stack than what was advertised by the reason team. It probably explain why fb dedicates so little resources to reason too.
- lnyan 6y agoJust realized that https://reasonml.org https://reasonml.org is deprecated.
- spyder81 6y agoIt was never official, and the people behind it folded into the new ReScript team.
- testcross 6y agoBtw for people who want to use js_of_ocaml instead of rescript but still like react, there is https://github.com/jchavarri/jsoo-react https://github.com/jchavarri/jsoo-react. It's obviously not as polished. But it's interesting to see how much work it requires to bind a large lib like react.
- davesnx 6y agoThat's a project that we all wished was in a perfect shape in order to make Reason more approchable with jsoo.
- jesperlang 6y agohttps://github.com/facebook/reason/issues/2634 https://github.com/facebook/reason/issues/2634 This issue is trying asking for some explanation regarding the future of ReasonML. Maybe comment/react/subscribe to stay up to date on this issue!