4 ms·
This 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
by steinuil 6y ago
This 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 .
- spyder81 6y agoIMO this isn't about whether ReScript wants to upstream their changes, it's a combination of things: - Reason+BuckleScript was confusing at best, having two websites and different release schedules. - Reason's goal is to be a 100% mapped syntax for OCaml. This does not mesh well with the goal of producing readable JS, so ReScript will probably end up as a subset of OCaml features. - Reason syntax changes apparently caused grief when applied to BuckleScript. This one was never very clear, but regardless now that the syntax is in-house the ReScript team can be more responsive with it. The problem with this transition is that it was dropped on the community in an unfinished state and BuckleScript was retired completely. The goals of the change are, I think, mostly reasonable.
- dmkolobov 6y agoI have no skin in the game w.r.t to OCaml/Reason/etc. I do wish compile-to-JS languages would give up on the readable Javascript thing. I think ClojureScript nailed it with their reliance on Google Closure's aggressive optimization mode __because__ it produces obfuscated, highly optimized output. Purescript also shares this goal, and it is a bummer, performance-wise, in older browsers that don't handle currying and various other "readable" representations well. Worse still, if your target output is readable, then someone might start touching the compiled runtime objects with Javascript and then... god help you as you watch the guarantees of your fancy type system unravel before your very eyes.
- spyder81 6y ago"readable output" isn't really about being human-readable, except in unrealistic example cases. The bigger benefit is shared data types; this helps immensely with JS interop. https://rescript-lang.org/docs/manual/latest/shared-data-types https://rescript-lang.org/docs/manual/latest/shared-data-typ...
- testcross 6y agoI feel like the dev team is using "readable output" to mean both "human-readable" and "shared data types" depending on the situation. And it creates a lot of confusion.
- yawaramin 6y ago> it's kind of sad to see FB going off on their own with ReScript ReScript is not a Facebook project. The compiler is licensed by Bloomberg LLP: https://github.com/rescript-lang/rescript-compiler/blob/60a1c04ecccc8186f380d15c0848af95e8848ad9/LICENSE#L1 https://github.com/rescript-lang/rescript-compiler/blob/60a1... And the syntax is licensed by the ReScript team: https://github.com/rescript-lang/syntax/blob/72d9b7034fc28f317672c94994b322bee520acca/LICENSE#L3 https://github.com/rescript-lang/syntax/blob/72d9b7034fc28f3... The ReScript team is comprised of both Facebook and folks outside Facebook.