News for hackers. Stuff that matters.
Re:ReScript 10.0 by andsoitis on Thursday September 29, 2022 @03:09AM (#33017401)
Competitor to TypeScript? Any insights into advantages / disadvantages?
Re:ReScript 10.0 by unodgs on Thursday September 29, 2022 @03:35AM (#33017555)
I wrote whole frontend with its predecessor ReasonML. Once you get used to ocaml type sytem it's a great experience especially that compiler is incredibly fast. The biggest surprise - no need of any importing commands (a lot clearer source files). Rescript split unfortunately caused ReasonML to stopped evolving and changes they introduced in the syntax were not convincing to me to switch to it.
Re:ReScript 10.0 by fbn79 on Thursday September 29, 2022 @03:48AM (#33017634)
IT's a META project based/fork of ReasonML (https://reasonml.github.io/). They are ocalm dialects thats compile to Javascript. Advantage vs Typescript is a strict type system.
Re:ReScript 10.0 by cardanome on Thursday September 29, 2022 @03:32AM (#33017532)
It is OCaml with an alternative syntax.

So very different semantics to JS/TS but you gain a sound type system and great compile speed.

Re:ReScript 10.0 by martypitt on Thursday September 29, 2022 @03:19AM (#33017467)
They discuss this in their docs.

https://rescript-lang.org/docs/manual/latest/introduction#di...

Seems like a type system for Javascript, built with a differing set of opinions than Typescript.

Looks like they also offer some form of TS interop:

https://rescript-lang.org/docs/gentype/latest/introduction

Re:ReScript 10.0 by edf13 on Thursday September 29, 2022 @03:27AM (#33017511)
That comes across very much as a “we fixed all these nasty issues with Typescript” comparison
Re:ReScript 10.0 by codeptualize on Thursday September 29, 2022 @03:58AM (#33017699)
I think they describe well that Typescript needs a lot of complexity by supporting all of JS. That's both a strength and a weakness, easy to get started for people who know JS, but typings can get crazy complex.

Rescript has a different approach which has lots of benefits, it is much better in terms of type inference, it's much faster, and I think it's fair to say safer. The tradeoff is that it's not JS, making it harder to adopt.

I do think they are doing a great job in taking steps to present the ocaml origins in more JS friendly patterns and syntax, but it still requires learning some new concepts.

I think a somewhat good comparison is; If Typescript is like C# for JS, Rescript is like F#/ocaml for JS. Different technologies have different tradeoffs.

Re:ReScript 10.0 by Semaphor on Thursday September 29, 2022 @03:49AM (#33017641)
I would say literally the first 2 sentences of the first bullet point say something very different:

> TypeScript's (admittedly noble) goal is to cover the entire JavaScript feature set and more. ReScript covers only a curated subset of JavaScript.

Re:ReScript 10.0 by iddan on Thursday September 29, 2022 @03:34AM (#33017552)
The Reason team is not motivated by hate, rather they have a different POV than the TypeScript team. They are focused on full soundness instead of full JS ergonomics.
Re:ReScript 10.0 by somecommit on Thursday September 29, 2022 @04:02AM (#33017717)
No need to look at google trend, Typescript is too big by now, many libraries client and server use it out of the box, and the possible advantages of this competitor look very small in comparison.

I even don't understand why browser don't start to work on supporting it directly, maybe google/chrome have something in mind and slowing down its integration, or it's because of performance issues.

Re:ReScript 10.0 by azangru on Thursday September 29, 2022 @04:11AM (#33017757)
> I even don't understand why browser don't start to work on supporting it directly

https://github.com/tc39/proposal-type-annotations

Re:ReScript 10.0 by norman784 on Thursday September 29, 2022 @09:11AM (#33020122)
It will take a while, I even doubt it will make to a stage were it will be worth implementing, don't get me wrong, I like the idea, ditch more tools (transpilers mostly) and work with plain new JS will make my life easier.
Re:ReScript 10.0 by nesarkvechnep on Thursday September 29, 2022 @03:30AM (#33017526)
The main advantage is that the type system is sound. The compiler does full type inference.
Re:ReScript 10.0 by pharmakom on Thursday September 29, 2022 @05:24AM (#33018183)
Functional programming is far far better in ReScript. The type system is more “correct”. The community is smaller.