I was using TypeScript all through 2019. Went back to plain old JavaScript at the beginning of 2020. Still using plain old JavaScript by default, and break out React when I _really_ have to. No regrets, many benefits.
I Switched from TypeScript to ReScript
41–49 of 49 posts
Re: I Switched from TypeScript to ReScript
#42Earlier quoted context omitted.
typescript is liteally a superset of js. what are your benefits
I'm not op, but here's my opinion: I'm willing to accept the basic hypothesis that's static typing makes for less runtime errors. The type system in well thought out languages like elm or rust makes coding in them pretty simple. I don't think that typescript's type system is good enough to actually deliver on this promise. It's very easy, in my experience, to spend 5 minutes writing a function that I am 100% sure wil…
Re: I Switched from TypeScript to ReScript
#43I think the best point in the article is this: > ReScript, as with other statically typed functional languages, aims at changing the way code is approached at a fundamental level. We currently have a project written in ReScript and it's an absolute nightmare. Most of our stack is JavaScript/TypeScript/Flow, so no one can just jump in and work on it very easily - they first have to learn ReScript and all of it's diffe…
- a more solid type system - and a much faster compilation speed (a growing pain in TS projects) - to write mainstream code - for products (as opposed to a focus on intermediate FP libraries)
The fact that it leverages some FP concepts here and there is just a mean, not the end.
The marketing of this is really hard, because FP usually attracts the crowd you'd expect, at the expense of several of the above emphasis. But we're still working toward it.
Having seen some ReScript codebases in the wild, I definitely know where your team comes from. We do try to approach it with the "different TypeScript" angle, but understandably userland doesn't always write code the way we'd like to recommend.
In the spirit of https://news.ycombinator.com/item?id=25846479, we’re trying to become a boring technology. Unfortunately boring technology had to have gone through a hype period.
Re: I Switched from TypeScript to ReScript
#44Earlier quoted context omitted.
A couple of years ago I was a big advocate of ReasonML and went so far as to run a meet up. I honestly believed in the technical value of it and saw it as a better alternative to Typescript. At the time, the waters were muddy enough with Reason, Bucklescript and OCaml but you could explain it away. The rebrand and change of syntax that came with Rescript was the end of the line for me. Issues like async await have go…
Tablecloth uses Belt for JS targets
Re: I Switched from TypeScript to ReScript
#45> ReScript is not just a rebranding: it’s a ReasonML which freed itself of the yoke of the OCaml ecosystem. By doing so, it forfeited compilation to native code and OCaml library interop, but gained a freer syntax which further resembles JavaScript See also BuckleScript & Reason are now called ReScript : https://rescript-lang.org/bucklescript-rebranding
There are 3 categories of code I’m interested in writing:
- Client code, must compile to JS.
- Server code, ideally would compile to native.
- Tooling code (e.g. Webpack / Babel replacements), ideally would compile to native.
I would like to write these things in one language.ReasonML could do this, ReScript cannot.
Re: I Switched from TypeScript to ReScript
#46> Simply renaming the file extension won’t work, as the compiler stops completely at type errors. Why did the author think that this would work exactly?
This works which most language supersets. My point was that it was a trial and error way of discovering that this was not so.
Seeing it as a separate language, I agree that the statement doesn't really makes sense.
Re: I Switched from TypeScript to ReScript
#47I'm actually a fan of JavaScript. Even though TypeScript/ReScript might add some cool features, I don't feel the urge to switch...
It's a statically-typed functional language from the ML family, which is a huge deal. It implements a completely different approach to code, even if it looks similar.
It's currently academical, "ivory tower," but in my opinion it will trickle into industry. Someone described ReScript as ECMAScript 2030.
Re: I Switched from TypeScript to ReScript
#48Earlier quoted context omitted.
Ok well that is true and may happen sometimes. Personally, I have just dabbled with type definitions, configs etc much more than I ever had those kinds of problems in javascript. I just feel typescript usually gets in the way, sometimes in a good way, but all too often in a bad way. Plus my main gripe with typescript is that microsoft owns and controls it so I won't use it just because of that.
Recently I think Microsoft is a very good open source supporter. So it isn't a problem for me. I also feel Typescript is good, but sometimes it is hard to use because of so many typing. It needs VScode always for auto complete helper. I remember javascript as an old good days...
Re: I Switched from TypeScript to ReScript
#49Earlier quoted context omitted.
Ok well that is true and may happen sometimes. Personally, I have just dabbled with type definitions, configs etc much more than I ever had those kinds of problems in javascript. I just feel typescript usually gets in the way, sometimes in a good way, but all too often in a bad way. Plus my main gripe with typescript is that microsoft owns and controls it so I won't use it just because of that.
I made this discovery just yesterday. I tried converting a tiny side project from vanilla JS to Typescript because I wanted to see what all the hype was about. I had this idea in my head(perhaps naively) that I would catch an edge case/silent error or two in my application that I did not know existed prior to implementing static typing. Instead, I spent a whole bunch of time wrestling with the tooling and configs in…
People go in this trap again and again, including myself.
"Oh this FAANG uses this, it must be great and suitible for us" - no, it's suitible for them because they have completely different problems than you and have to do stuff in a much more complicated way than you need to.