3 ms·
I'm generally an advocate for a robust, mandatory type system like Rust. But there are production scenarios where it's a hindrance. Imagine processing arbitrary
by perrygeo 2y ago
I'm generally an advocate for a robust, mandatory type system like Rust. But there are production scenarios where it's a hindrance. Imagine processing arbitrary JSON document containing several required properties and many additional ones. You can't possibly know what additional properties any given document will have (it's only available at runtime, with infinite variations) but it's often a hard requirement that these extra data get passed through the system. Being forced to create a concrete type for what is effectively an open map + some validation logic is awkward at best. Maps and general purpose functions that process maps are a better fit for this problem.
- anon291 2y agoAt the byte level it's all concrete types anyway
- kazinator 2y agoYes but the concrete types at the byte level can be used to say: "these five bits are, concretely, a type tag, and always a type tag", and so it goes from there. I don't want to be typing at the high level the same way I'm typing at the byte level.