upvote
Lots (most?) of statically typed languages also do near zero runtime checking.

They naturally use types for compilation, but the type system is trusted to forbid some invalid states. Underneath it’s all bits and bytes.

Even in safe languages you need deserializers/parsers/validators.

Typescript actually ends up having more checks because it runs Javascript underneath (although some might argue those barely count).

reply
I have never worked in Java. But you can certainly ship TypeScript code that does not pass typecheck and it'll run fine in the browser because the browser runs Javascript, not typescript. Obviously a decent build process will prevent code that fails typecheck from shipping, but that's not a language feature.

For runtime types I've leaned on Zod or Effect schema,which can also generate static types for you.

reply
its more than annotations, your code fails to compile when you get a type error at least with strict settings. if it type checks and fails at runtime that means youre missing input validation or using bad declarations for third party/legacy untyped code. or using some escape hatch like `myValue as unknown as MyType` in the wrong way.
reply
its statically typed, but not runtime typed!
reply
[dead]
reply