Comment by knorker

Comment by knorker 5 hours ago

0 replies

You're misapplying it.

A language that doesn't let you do safe things, then that's a very different language.

In this case, it would be a language that does not allow creating a UdpSocket object by bringing in your own file descriptor, or it verifies that it's the right type of socket when you do. Which has performance implications without adding any "safe" guarantees.

Say you add this feature, taking the performance hit. Now you need to adjust seccomp policies to allow that. Ok, no biggie. But then I invent UDPv2, and this check fails. The code becomes wrong because of an incorrect assumption about the future.

All without gain. It's not an invalid state, any more than naming a variable "x_squared" but containing x+1 is an invalid state.

You could also imagine stdout to be of a different type if it's line or character buffered, and continue in the direction of a cartesian explosion for all states. Ok… that seems like it'd cause more problems than it'd solve.

> instead of getting indignant

Please don't assume my mental state. You got it wrong.

> This is a failure of imagination, nothing more. An appropriate type schema for this domain will be able to handle the requirements of the domain.

I'm all ears. Note that it also has to support "I got the file descriptor as a libc::c_int from a C library", or it's not fit for purpose.