Live data from Hacker News

C++26 Reflections adventures and compile-time UML

reachablecode.com

101–110 of 118 posts

Re: C++26 Reflections adventures and compile-time UML

#101
post #96

Earlier quoted context omitted.

> I'm not a fan of the C++26 linalg stuff. I don't agree at all. For most, linear algebra is the primary reason they pick up C++. Up until now, the best option C++ newbies had was to go through arcane processes to onboard a high performance BLAS implementation which then requires even more arcane steps such as tuning. With C++26, anyone can simply jump into implementing algorithms. If anything, BLAS support was consp…

Except the devil is in the details as usual, the way linalg is specified doesn't guarantee numeric stability across library implementations or compilers. Just like the std::random mess, most people are in for a surprise when they attempt to write portable numeric code with it.

> Except the devil is in the details as usual, the way linalg is specified doesn't guarantee numeric stability across library implementations or compilers.

I think this criticism is silly. You're complaining about the C++ standard not enforcing something that is virtually impossible and no implementation under the sun even suggests it would conceivably support. And we should just assume C++ would be able to force it across implementations, target platforms, and even architectures? Ridiculous.

> Just like the std::random mess (...)

The comments I've seen regarding std::random mainly refer to gotchas, such as std::rand returning values in [0, RAND_MAX] and the latter being a platform-specific constant.

There is a reason after all why you only throw vague complains of "mess" instead of pointing out specific concerns or grievances. You need to complain, regardless of merit.

Overall, this blend of criticism is no different than the cliche criticism targeting the STL. Sure, some niche applications can and do have better ways to scratch their niche itches. In the meantime the STL perfectly serves the need of 99.9% of all common usages. Is this not the point? Doesn't linalg and rand achieve this?

Of course vapid nitpickers can still pull out the last resort card of complaining that the implementation is too complicated, a grievance also directed at the STL. But that's just the extent where this silliness goes.

Re: C++26 Reflections adventures and compile-time UML

#102
post #97

Earlier quoted context omitted.

> sure, but instagram was created by a handful of people with python and got a billion dollar exit in 2012. Facebook famously felt compelled to hire eminent C++ experts to help them migrate away from their PHP backend. I still recall reading posts on the Instagram Engineering blog on how and where they used C++.

And then HipHop failed to provide as much gains as they hoped for versus the Hack JIT implementation, thus Facebook keeps writing mostly PHP like code in many of their workloads.

> And then HipHop failed to provide as much gains as they hoped (...)

What point do you think you're making?

Re: C++26 Reflections adventures and compile-time UML

#103
post #97

Earlier quoted context omitted.

And then HipHop failed to provide as much gains as they hoped for versus the Hack JIT implementation, thus Facebook keeps writing mostly PHP like code in many of their workloads.

> And then HipHop failed to provide as much gains as they hoped (...) What point do you think you're making?

That the C++ migration in the end did not achieve everything they were trying to get out of it, and another more productive approach was chosen in the end.

https://en.wikipedia.org/wiki/HipHop_for_PHP

https://en.wikipedia.org/wiki/HHVM

Re: C++26 Reflections adventures and compile-time UML

#104
post #96

Earlier quoted context omitted.

Except the devil is in the details as usual, the way linalg is specified doesn't guarantee numeric stability across library implementations or compilers. Just like the std::random mess, most people are in for a surprise when they attempt to write portable numeric code with it.

> Except the devil is in the details as usual, the way linalg is specified doesn't guarantee numeric stability across library implementations or compilers. I think this criticism is silly. You're complaining about the C++ standard not enforcing something that is virtually impossible and no implementation under the sun even suggests it would conceivably support. And we should just assume C++ would be able to force it…

Not silly at all, if it can't be enforced in a standard portable way, its place doesn't belong in the standard, at all.

I would have voted SA on this matter, if I had a life that would allow me to go around voting at WG21 meetings.

We have vcpkg and conan now, the standard library cannot be a distribution vehicle for organisations that refuse to adopt C++ package managers.

Re: C++26 Reflections adventures and compile-time UML

#105
post #64

Meta: why does c++ feel almost political on this forum?

c++ gets a lot of hate much of it based on past traumas with specific codebases and history of use.

This has built up into a culture where people who have little to no experience with c++ but who have been told and seen only bad headlines about it join in with those who have legitimate concerns, those who are promoting their favorite language and those who are trolls leading to a general mood.

It is almost perfectly predictable that if you open the discussion on a link to a c++ article on this site there will be someone promoting either zip, rust or circle in that discussion. There will also be a comment on the bloat of the language and someone venting their trauma from some horrible code base.

Re: C++26 Reflections adventures and compile-time UML

#106

Earlier quoted context omitted.

The stream of modern C++ features have been a god-send for anyone that cares about high-performance, high-reliability software. Maybe that doesn’t apply to your use case but C++ is widely used in critical data infrastructure. For anyone that does care about things like performance and reliability, the changes to modern C++ have largely been obvious and immediately useful improvements. Almost all C++ projects I know i…

You are sounding like rose tinted glasses are on. I think your glass is half full if you recheck actual versions and features. And mine is half empty in gamedev. Anecdata: A year or so ago I have been in discussion if beta features of C++20 on platforms are good to be used on large scale. It makes it not a sum but an intersection of partial implementations. Anyway it looked positive until we needed a pilot project to…

> Proportional increase of remote compilation cloud costs for few minor features is a 'no'.

How high are those compilation costs compared the developer time that might be saved with even minor features?

Re: C++26 Reflections adventures and compile-time UML

#107

Earlier quoted context omitted.

You sound like you subscribe to "Orthodox C++". Speaking seriously, I agree there's definitely a lot of bloat in the new C++ standards. E.g. I'm not a fan of the C++26 linalg stuff. But most performance-focused trading firms still use the latest standard with the latest compiler. Just a small example of new C++ features that are used every day in those firms: Smart pointers (C++11), Constexpr and consteval (all impro…

> I'm not a fan of the C++26 linalg stuff. I don't agree at all. For most, linear algebra is the primary reason they pick up C++. Up until now, the best option C++ newbies had was to go through arcane processes to onboard a high performance BLAS implementation which then requires even more arcane steps such as tuning. With C++26, anyone can simply jump into implementing algorithms. If anything, BLAS support was consp…

> This blend of comments is more perplexing given that a frequent criticism of C++ is its spartan standard lib

The frequency doesn't make the criticism more valid and those repeating it would be better served to let go of their fear of third-party libraries.

Re: C++26 Reflections adventures and compile-time UML

#108

Earlier quoted context omitted.

You sound like you subscribe to "Orthodox C++". Speaking seriously, I agree there's definitely a lot of bloat in the new C++ standards. E.g. I'm not a fan of the C++26 linalg stuff. But most performance-focused trading firms still use the latest standard with the latest compiler. Just a small example of new C++ features that are used every day in those firms: Smart pointers (C++11), Constexpr and consteval (all impro…

> I'm not a fan of the C++26 linalg stuff. I don't agree at all. For most, linear algebra is the primary reason they pick up C++. Up until now, the best option C++ newbies had was to go through arcane processes to onboard a high performance BLAS implementation which then requires even more arcane steps such as tuning. With C++26, anyone can simply jump into implementing algorithms. If anything, BLAS support was consp…

> I don't agree at all. For most, linear algebra is the primary reason they pick up C++.

Out of hundreds of hundreds of projects I've interacted with, maybe less than 1% have used linear algebra in any non-basic capacity (e.g. more than multiplying two 4x4 matrices) and had to use Eigen or BLAS

Re: C++26 Reflections adventures and compile-time UML

#109
post #82

Earlier quoted context omitted.

But the standard library should have had things so that we can write: constexpr std::array types = {^^int, ^^float, ^^double}; auto sizes = std::whatever::transform(types, std::meta::size_of); which would have been even nicer.

It would have been, but it looks like the difficulty there is that the type of `sizes` must be compile time known, but `std::transform` and friends don't really know about fixed sizes. Depending on the context, one can do `auto sizes = types | std::views::transform(std::meta::size_of);`, the difficulty comes in materializing at the end.

Thinking about this more, for consteval this should work - huh

Re: C++26 Reflections adventures and compile-time UML

#110

Earlier quoted context omitted.

You are sounding like rose tinted glasses are on. I think your glass is half full if you recheck actual versions and features. And mine is half empty in gamedev. Anecdata: A year or so ago I have been in discussion if beta features of C++20 on platforms are good to be used on large scale. It makes it not a sum but an intersection of partial implementations. Anyway it looked positive until we needed a pilot project to…

> Proportional increase of remote compilation cloud costs for few minor features is a 'no'. How high are those compilation costs compared the developer time that might be saved with even minor features?

Tbh I dont have exact numbers from 2024 at hand. I remember that decision was unanimous. A build times increase is a very sensitive topic for us in gamedev.
Post reply on HN