News for hackers. Stuff that matters.
Re:The Year of C++ Successor Languages by masklinn on Monday January 02, 2023 @08:27AM (#34217585)
> If you have 3 variables, each of which can be in 10 states, that's 10^3 states your program can be in.

> If instead you have 11 states because all your variables are actually unions with an error, that's 11^3 states (assuming all error states are equivalent to a single state).

> Now in practice it's even worse since what you care about isn't the possible states of your values, but rather how many different paths you have in your control flow to handle them.

You're really demonstrating that you have no clue about the subject and refuse to think about it.

If the current function does not deal to specifically deal with erroneous results (aka it would be a passthrough for exceptions) then it unifies the error states into one, by either pruning their branches through early-returning, or unifying the triplet of results into a result of triplet.

Hence you don't have 11^3 states but 10^3 + 1.

> What exceptions do is enforcing that your working set does not have to encode any erroneous states, preventing the combinatorial explosion of states, which of course is a net win, there isn't really any valid argument that can be made against it.

The problem is that none of that is actually true, you're literally inventing combinatorial explosions which effectively don't exist.

Unless they would have to in all cases at which point exception would lead to a significantly worse combinatorial explosion, because exceptions would not allow representing the product of 11 states as just that, and instead would need 20^3 states as every possible value would have to be paired with two error states, success and failure.

> That's already somewhat dubious

It really is not.

> there is nothing about that which has anything to do with interfacing with C.

The C (or system) ABI is the linga franca of inter-language communication, unless you decide to pay for a network cost.

> I do a lot of system programming and I write it all in C++, which has a lot of advantages over C beyond exceptions.

And plenty of drawbacks as well.

But if all you know is C and C++ and you see the entire world through that lens, I can see why you're missing most of the field, you're essentially blind.

Re:The Year of C++ Successor Languages by mgaunard on Monday January 02, 2023 @05:30PM (#34224601)
Exception prevent the control flow from continuing, which prevents the creation of those states which happens further down.

I find your tone too inadequate to engage further with you though.