3 ms·
Why should types even exist at runtime? Everything should be validated at compile time and then the whole concept of types no longer needs to exist.
by Gigachad 4y ago
Why should types even exist at runtime? Everything should be validated at compile time and then the whole concept of types no longer needs to exist.
- DangitBobby 4y agoYou are sometimes interacting with external data. Particularly in web land, you don't know for sure if the payload meets expectations until you check.
- pharmakom 4y agoPlenty of solutions here such as code generation or Elm style combinators. I’m not convinced that Python style runtime meta programming is a particular robust solution since it is not (easily) checked statically.
- DangitBobby 4y agoSure. But it would be nice not to need to describe the structure of your data twice if you need runtime validation. Since TS is such an ergonomic way of describing the structure of your types, runtime availablility is more attractive (to some) than relying on external libraries for that functionality.
- draw_down 4y ago[dead]