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

I wouldn't really say Typescript is enforceable, given that the types aren't actually considered at runtime.



That is the case for most typesystem considered safe, save for introspection use cases. For instance, haskell, a language with strong type guarantees, does erase types for runtime.


In fact, people should see Typescript as a linter / bundler tool than a programming language by itself, ignoring the design mistakes of how enums and namespaces came to be.


Almost no languages have types considered at runtime.


Well python does, after the famous PEP to pack all types into strings got parked (probably forever).

There's packages to typecheck at runtime, even to check the parameters to a function.




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

Search: