News for hackers. Stuff that matters.
Re:10 Years of Scala.js by pubg on Sunday February 05, 2023 @10:33AM (#34665673)
What functional overlap is there between TypeScript and Scala.js?
Re:10 Years of Scala.js by sjrd on Sunday February 05, 2023 @10:48AM (#34665804)
TypeScript provides static types for JavaScript. Not just the language, but its idioms, its way of writing programs.

Scala.js is first Scala. That means you favor a style with immutable data, work with the great collection library of Scala all the time, and in general follow the idioms and way of writing programs that Scala offers.

Speaking in very broad terms, I could say TypeScript stays more in the "imperative" paradigm, while Scala goes more "functional". But of course in both languages, you will find people everywhere on the imperative<->pure FP spectrum. The center of gravity of TypeScript will be more on the imperative side and that of Scala, more on the FP side.

Also, Scala aims to have a sound type system. If your code compiles, it won't run into certain categories of bugs. TypeScript, by design, does not give any such guarantee.