Re:C++20 coroutines: “The bug is in the C++ standard, not GC...
by 0xbadcafebee on Tuesday October 04, 2022 @03:47PM
(#33085726)
I find it unreasonable that every language would have all of its features always compatible. Why can't we just say "don't use X and Y together" ? It might solve a ton of problems. All you have to do is have a big red warning in the manual that says DON'T COMBINE X AND Y, and a language feature that lets you turn on X and turn off Y.
[ Parent
| on HN ]
Re:C++20 coroutines: “The bug is in the C++ standard, not GC...
by j-krieger on Tuesday October 04, 2022 @04:15PM
(#33086104)
> Why can't we just say "don't use X and Y together"?
Because that goes against the most fundamental idea of programming languages that you can build larger abstractions by combining basic building blocks.
Re:C++20 coroutines: “The bug is in the C++ standard, not GC...
by travisgriggs on Tuesday October 04, 2022 @04:40PM
(#33086471)
Abstractly speaking, what if we consider a "big ball of spaghetti" and "working program" to both be abstractions of just "a program". Now it fits under the larger abstraction umbrella still. :D
All other things aside, C++ seems to be the language "to big to fail" and so it just keeps getting more and more features added to keep it competitive.
Re:C++20 coroutines: “The bug is in the C++ standard, not GC...
by lionkor on Wednesday October 05, 2022 @04:30AM
(#33092791)
Its okay to say "but you cant combine those two". Its also okay to point out that not every feature should be combinable with every other feature, and that needing to do so is likely an indicator of terrible (user-side) software design
Re:C++20 coroutines: “The bug is in the C++ standard, not GC...
by eru on Wednesday October 05, 2022 @04:58AM
(#33092982)
Then at least the compiler should complain, when you try to combine incompatible features.
Re:C++20 coroutines: “The bug is in the C++ standard, not GC...
by 0xbadcafebee on Tuesday October 04, 2022 @05:16PM
(#33087035)
A half dozen languages already do this and abstractions still work
Re:C++20 coroutines: “The bug is in the C++ standard, not GC...
by CJefferson on Tuesday October 04, 2022 @04:45PM
(#33086545)
Who reads the "manual of C++" -- what even is that, the standard document (certainly no-one should read that for learning).
It would be just about OK for the compiler to refuse to compile X and Y together.
If you "switched off" X, then in C++ (where code is in headers which are just concatenated with your code), this would effectively split the language, as you also couldn't use libraries which use X in their headers.
Re:C++20 coroutines: “The bug is in the C++ standard, not GC...
by extropy on Tuesday October 04, 2022 @04:31PM
(#33086361)
Sure, here is your Lego set.
But do not put while bricks next to red ones or it will explode!
Re:C++20 coroutines: “The bug is in the C++ standard, not GC...
by jejones3141 on Tuesday October 04, 2022 @05:01PM
(#33086815)
Orthogonality has been recognized as desirable at least since the days of Algol 68. Once you couldn't pass a struct as a parameter in C. Now you can.