logoalt Hacker News

chpatricklast Tuesday at 5:29 PM2 repliesview on HN

Its type system is miles better than Python and it has some basic stuff Python doesn't have like block scope. Functional programming is also intentionally kind of a pain in Python with the limited lambdas.

If TypeScript had the awesome python stdlib and the Numpy/ML ecosystem I would use it over Python in a heartbeat.


Replies

josephglast Tuesday at 6:11 PM

Typescript also has significantly better performance. This is largely thanks to the browser wars funnelling an insane amount of engineering effort toward JavaScript engines over the last couple decades. Nodejs runs v8, which is the JavaScript engine used by chrome. And Bun uses JSC, written for safari.

For IO bound tasks, it also helps that JavaScript has a much simpler threading model. And it ships an event based IO system out of the box.

tehjokerlast Tuesday at 6:00 PM

you can define a named closure in python, i do it from time to time, though it does seem to surprise others sometimes. i think maybe it's not too common.