logoalt Hacker News

com2kidyesterday at 10:40 PM4 repliesview on HN

Us Node folks adapted typescript because we wanted static compiled types.

I wish TS had more of a runtime. The only thing I'm jealous of with regards to python is how seamlessly you can do JSON schema enforcement on HTTP endpoints. The Zod hoops are a constant source of irritation that only exists because the TS team is dogmatic.


Replies

ngrillytoday at 5:42 PM

> The only thing I'm jealous of with regards to python is how seamlessly you can do JSON schema enforcement on HTTP endpoints.

Yes, it is much easier in Python because type annotations are reflected at runtime.

tptacekyesterday at 10:49 PM

I think Typescript is a perfectly cromulent language. I don't know it well but would seriously consider it for any problem that had a shape that admitted a dynamic language. There's a lot to be said for using dynamic languages, too!

show 1 reply
Recursingtoday at 8:16 AM

express-zod-api works well for me https://github.com/RobinTail/express-zod-api I'd say about as well as anything Python

satvikpendemtoday at 3:24 AM

Check out Perry the TypeScript compiler to native code