News for hackers. Stuff that matters.
Re:C++ Coroutines Do Not Spark Joy by pron on Monday November 01, 2021 @02:23PM (#29070769)
> Rust is not quite as complex as C++

Yet. C++ wasn't as complex as C++ back when it was Rust's age. It wasn't even as complex as Rust. But if you pick a language for the next 20-30 years, you don't just care about where it is now, but also about where it is headed.

Re:C++ Coroutines Do Not Spark Joy by tialaramex on Monday November 01, 2021 @03:51PM (#29072088)
If you get things right first time, you don't need to add as much complexity on the journey to ship something usable.

This is obviously easier coming from behind. You simply don't have to (and shouldn't) repeat other people's mistakes.

> It wasn't even as complex as Rust

I'm particularly dubious about this claim. Even counting from the genesis of C++ rather than standardisation, yet counting Rust as starting only in 2015, C++ after six years not only has multiple inheritance and overloading of everything, it also already has templates. That's a lot of complexity.

Re:C++ Coroutines Do Not Spark Joy by pron on Monday November 01, 2021 @05:13PM (#29073175)
> If you get things right first time, you don't need to add as much complexity on the journey to ship something usable.

There's no such thing as "getting things right the first time," because what's right depends on external, mutable, factors. The best anyone can do -- and most successful languages achieve -- is being well adapted to the environment. But the environment changes. For example, Java's object model was well adapted to an environment where memory access and computation were of roughly similar speed, but hardware changed so that computation is now faster than memory access, so Java is now changing to adapt to the current environment. On the other hand, its bet that memory is cheaper than computation has so far proven relatively long-lasting. But there's no telling what needs new hardware architectures or new software requirements will bring tomorrow.

Both Java and C have adapted better, in my opinion, than C++, and it's not because of specific features, but because of their evolution ethos, which is different not only from C++'s but also from each other. My personal opinion is that C++ has tried for too long to be both high and low level, and that has shaped its particular evolution. I feel that Rust is repeating that same fundamental mistake, but, of course, others may disagree.

Re:C++ Coroutines Do Not Spark Joy by tialaramex on Monday November 01, 2021 @07:07PM (#29074466)
I don't agree that it's somehow impossible to get things right and I'm not even sure you really believe that.

Take "explicit". In hindsight I suspect even many C++ proponents would agree that actually you don't want C++ conversion behaviour (when calling a function that takes a parameter of type X and you've provided a parameter of type Y, the C++ compiler will look for any way to construct an X that only needs a Y and then call that constructor rather than report that you've got the wrong type) by default. Perhaps C++ should have implicit conversion you can opt into, but it certainly should not have (as it does today) implicit conversion you must know about and opt out of to avoid blowing your feet off by mistake.

But I argue that it goes much further than such superficial mistakes. Multiple inheritance is a mistake. Personally I'm sold on the theory that all type inheritance is a mistake full stop (heritability should be a property only of interfaces), lots of people don't agree, but far fewer support the choice C++ made to embrace multiple inheritance of types. It's just so rarely even useful let alone the best option to solve a problem.

Re:C++ Coroutines Do Not Spark Joy by pron on Tuesday November 02, 2021 @04:33AM (#29078520)
> I don't agree that it's somehow impossible to get things right and I'm not even sure you really believe that.

That depends what you mean by "things." Obviously, languages created in 2015 might fix mistakes made in 1985, and recognised as mistakes, in, say, 1995. But the things that a language needs to solve over its lifetime are mostly unknown when it's created. How the language handles the problems that are known when it's created is less interesting. If it doesn't do it well, it will never become popular. What's interesting is how it adapts when those problems change with time and new ones appear.