Hacker News new | past | comments | ask | show | jobs | submit login

You want Typescript because you want to write JS with type ascribtions that will catch some errors (but give you a false sense of security in more complex code). You also prefer to use JS idioms and using hundreds of npm packages, so you want the most frictionless integration for that.

You want PureScript because you want the safety of Haskell style functional programming on the frontend, with strict types, effects tracking, category theory, and all.

You want Scala.js because neither of these extremes are appealing to you. You've been burned by Typescript, you're interested in functional programming but don't want to completely give up the good parts of OOP just yet (or ever).

I'm here to sell Scala.js (of course). You can use it with React or with one of Scala.js UI libraries. It's very nice.




Random interesting factoid: the guy behind Scala.js (and lots of other awesome Scala libraries) is actually the son of the prime minister of Singapore. I discovered this when talking to some Singaporeans who were quite surprised to hear the name in the context of programming language libraries. This means that if like his father and grandfather he eventually becomes prime minister, it'll be the first to-Javascript compiler maintained by a head of state.


I do find it interesting. I can't speak for Singapore's rules of succession, but I will nitpick however that Li Haoyi does not maintain the Scala.js compiler, that would be Sebastien and Tobias. He is nevertheless an exceptional, foundation-building creator in the Scala.js ecosystem, and has been at it from the start.

https://github.com/com-lihaoyi

https://github.com/lihaoyi?tab=repositories

https://www.lihaoyi.com/


Thanks for clarifying! I assumed he was the maintainer because he's put a lot of effort into publicising it.


I remember when the PM's wife very leisurely but thoroughly calculated the duration for a missile from NK to reach sg. https://www.facebook.com/permalink.php?story_fbid=8576844644...


So that puts Scala in the same corner as ReasonML and ReScript: FP with OO. Maybe Kotlin(JS) may also join, while that is OO with some FP.

Of all these languages I find Scala the "biggest" language: most syntax to learn, most quirks, least notion of what is idiomatic.

I'm not here to sell Scala, more warning people to stay away from it.


I dunno what's the problem with Scala's syntax, it's pretty standard and uniform.

The language, like any other, does have some quirks, but Scala 3 takes care of many long standing problems (in RC1 already).

It's true that there is no single idiom for Scala code. That's because unlike other languages, it's a true multiparadigm language, and so different people actually do use it differently. It's not a monoculture, but there is a well defined idiom for each style, be it hardcore FP, or Actor based programming, or Java++, or something in between.

Anyway. Ocaml is one of the better alternatives, but it's not without its problems either, both in terms of language and ecosystem.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: