4 ms·
If static typing is the selling point of Scala.js you might as well use TypeScript, which would be familiar to JavaScript developers.
by nawitus 11y ago
If static typing is the selling point of Scala.js you might as well use TypeScript, which would be familiar to JavaScript developers.
- lomnakkus 11y agoNo. Static typing in TS is very very far from what Scala can do[1]. Just as an example: Scala can do type inference (albeit local) which TS cannot do in any meaningful sense. There's a huge difference and you owe it to yourself to try it out for a real project! [1] My company started out with TS, but after converting about 10% of our app from TS to Scala.JS + scala.js-react we just decided to convert the rest in a mad sprint over a few weeks. It has paid off in spades. We still struggle with the abomination that is CSS and separating styles from components, but it is what it is.
- nawitus 11y agoYou're incorrect. TypeScript can do a lot of type inference. I've used TypeScript full-time for about two years, I don't have experience with Scala.js though.
- airless_bar 11y agoI think most types for which you would care about type inference in Scala can't even be expressed in Typescript ...
- lomnakkus 11y agoYeah. HKTs are one particular instance, though even Scala doesn't necessarily do particularly well on those compared to e.g. Haskell (well, GHC, really). (It seems subtyping and higher-order reasoning just don't mix well. Undecidability abounds, unfortunately. I tend to prefer higher-order reasoning over subtyping.)