Hacker News new | ask | show | jobs
by dimgl 1545 days ago
One of those is not like the other. JavaScript and TypeScript are almost interoperable. You don't have to relearn the semantics of the language to use a JavaScript library in TypeScript. It's is an extremely light superset compared to Clojure, Scala, Elixir, Kotlin, etc.
2 comments

True, though I think part of this is also recognizing that the more the semantics diverge, the more potential upside there is.

Not that JavaScript-with-types isn't a compelling pitch for TypeScript— it totally is. But that's a benefit that is primarily geared toward scale and safety, whereas Clojure is a completely different kind of language from Java. Maybe I'm just arguing essentially the same point here, that Clojure is always going to be a niche, but the core of it is that if your problem domain demands using a Lisp, and you have other reasons to want to be on the JVM, then it's likely that the cost of having to pick up some Java is going to be well worth it.

Typescript requires an intermediate step though.

We had the Typescript vs JS debate when starting out with pianojacq.com and I was pretty strongly committed to doing it in plain JS and not to have any tooling dependencies or build step. Which I think is the one thing that makes JS at least moderately interesting: that it is a language that in theory does not require any tooling beyond the browser. Of course, the day Typescript is supported natively by the browsers that argument will die. But for now that does not seem to be the case.

I agree that just JavaScript is okay for simple applications. In fact I didn't use TypeScript for a really long time because getting the tooling going can be cumbersome at first.

TypeScript shines with complex webapps. Having the typing prevents a whole class of issues and helps with refactoring quite a bit.

Yes, agreed. And small projects tend to grow to much larger projects over time so it may well make sense to choose Typescript even if your project is still small.