Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If TS is eventually added to the JS standard, I would be very happy. I've only picked it up in the past few weeks, but I'm consistently amazed at how much sense it makes


You can actually annotate typescript types using JSDoc comments. So if you don’t like the added step of compiling your source down to JavaScript you can still write JavaScript with doc comments and then typecheck with `tsc --noEmit` which won’t run the compile step.

However I do see the appeal of the ergonomic of the TypeScript syntax. I hope TC39 will add something like optional type annotations to the spec.


It could be a feature flag, like `use strict`, but `use types` instead


I’m actually hoping for something more akin to python’s optional type annotations. Where opting in is as simple as using type annotations. The runtimes (i.e browsers, nodejs, etc.) would then simply ignore them like they do with comments. But third party tools could use them to do some static analysis. Like mypy does for python (or tsc --noEmit does for javascript).


It really depends on if you want enforced typing, which is why I think a feature flag could be useful. There's room for both—explicit typing being available, and enforced types being a flag away.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: