Migrating millions of lines of code to TypeScript
stripe.com
stripe.com
But recently, I found out about ReasonML, an ML-family language transpiled to JS that, from a distance, looks like something I'd like over TS in every aspect except one (third party typings): much more terse algebraic sum types(tagged unions), more terse code in general, incredible compile times, and named arguments[0].
To top all of that, "reason-react"[1] claims that "Reason syntax and language features are a better match for React programming patterns", and I am very inclined to agree already.
I'd love to hear folks' experience with ReasonML, or pointers to blog posts such as these where companies write up their experience.
[0] https://blog.dubenko.dev/typescript-vs-reason/
[1] https://reasonml.github.io/reason-react/docs/en/what-and-why
The article was using strawman comparisons in some places. The getPhone example should have used optional chaining:
const getPhone = (form: Form) : number | undefined => form?.user?.phoneAnother point in TS's favor.
> strawman's comparisons in some places
Not sure, but this might be because the article was written before/around when the relevant features were merged into TS. For example, optional chaining was added to TS a month after the blog was published[0].
I do thank you for pointing that out though, as it's totally relevant.
So ReasonML is compiled into somewhat obfuscated Javascript that won't be naturally consumable by vanilla Javascript, whereas Typescript transpiles into Javascript with the same API without typings (type erasure).
Now that's crazy! They don't seem to be afraid to do major changes in one shot (yes, probably type checked because of typescript - but still, that's huge!)