OK I guess I'm having a hard time reconciling that with:
> basically all static typing
OK I guess I'm having a hard time reconciling that with:
> basically all static typing
From the linked article the post: "The right answer is for applications to do validation as-needed in application-level code. If you want to detect when a client fails to set a particular field, give the field an invalid default value and then check for that value on the server. Low-level infrastructure that doesn’t care about message content should not validate it at all."
(I agree that "static typing" isn't exactly the right term here. But protobuf dynamic validation allows the programmer to then rely on static types, vs having to dynamically check those properties with hand-written code, so I can see why someone might use that term.)
1. Type info which is available before runtime, but not at runtime (compiled away).
2. Type info which is available at runtime, but not at compile time (input, statistics, etc.).
3. Type info which is available both at compile time and runtime (say like a Java class).
When you have a JIT optimizer that can turn [3] and [2] into [1], there's no longer a reason to have [1], except if you're micro-optimizing embedded code for some device with 64kb RAM or whatever. We've carried through legacy practices, and we don't even question them, and try to push them way out of their league into large-scale distributed software.
When I say we don't need [1], this doesn't mean I deny [3], which is still statically analyzable type information. It's static types, but without throwing away flexibility and data at runtime, that doesn't need to be thrown away.
> there's no longer a reason to have [1]
I guess if you're assuming the value of static types is just performance? But it's not, not by a long shot - hence 'mypy', a static typechecker that in no way impacts runtime.
I think this conversation is a bit too confusing for me so I'm gonna respectfully walk away :)