Live data from Hacker News

Show HN: Beautiful Type Erasure with C++26 Reflection

ryanjk5.github.io

51–60 of 64 posts

Re: Show HN: Beautiful Type Erasure with C++26 Reflection

#53
post #16

What's compilation time like when using it? I see there's an issue in the tracker to get more accurate data, and since it's using an under dev feature in compilers, it's not going to be definitive, but any rough numbers?

I don't have any numbers, but it is pretty slow. You can try making some edits in Compiler Explorer to see for yourself (though that of course has some impact from network requests). One reason is that, like you said, the feature is still new. Additionally I made pretty liberal use of the std::ranges library in my implementation which has notoriously bad compile times. That could be an area to improve upon. Another m…

Or a module.

Compiler Explorer is not good for measuring anything in general, because there is also the issue of containers being allocated for specific languages, and compiler toolchains, and how many people are using it on a given moment.

Re: Show HN: Beautiful Type Erasure with C++26 Reflection

#54
post #37

Earlier quoted context omitted.

C++ is in the transitional phase where major bad things are being taken away very satisfactorily, usually by providing a simpler and more general replacement (for example, auto instead of long and pointless type declarations or modern initialization protecting against implicit conversions and surprise constructor overloads), but most progress of elegance and grace come from new features that enable something traditio…

Oh, have they finally started to remove features?

Yes, several even, C++98 or C++11 code will not compile in C++26 mode, depending if some of those feature were being used.

Exception specifications, auto_ptr, C++11 GC, the way volatile works, uninitialised variables,...

Re: Show HN: Beautiful Type Erasure with C++26 Reflection

#55
post #4

The things people describe as "beautiful" never cease to amaze me... ...but, as they say, beauty is in the eye of the beholder!

I find it hard to see a language as beautiful that’s grown too complex for a single person to hold a complete mental model of. I used to think that was a personal limitation, until I saw an interview with Bjarne explaining that he used to understand all of it but at this point it’s too big, no one can anymore.

Very few languages are like that, not even something like Scheme, Go or C, unless that person never used anything beyond version 1.0, and a single implementation.

Re: Show HN: Beautiful Type Erasure with C++26 Reflection

#57
post #4

The things people describe as "beautiful" never cease to amaze me... ...but, as they say, beauty is in the eye of the beholder!

Yes unfortunately, C++ has a long history of features that were supposed to be much more limited than how they ended up being used - but engineers ended up finding holes in these fences, and that's how we ended up with things like SFINAE and weird compile time code execution methods.

People ended up getting celebrated for their cleverness and not horrified by the abuse of good taste, and many of these tricks appeared in core C++ libraries like Boost.

So doing stuff like this is unfortunately just part of C++ culture, and allows you to emulate proper features that using a C++ standard that's at least a decade older.

Re: Show HN: Beautiful Type Erasure with C++26 Reflection

#58

glad to see that in the yaer of our lord 2026 c++ is still slaying, wasting gigawatts of 18yo supple brain energy on useless shit like this

4 comments to heap your scorn on someone's work and what you don't understand. And you say their work is useless.

Re: Show HN: Beautiful Type Erasure with C++26 Reflection

#60

glad to see that in the yaer of our lord 2026 c++ is still slaying, wasting gigawatts of 18yo supple brain energy on useless shit like this

4 comments to heap your scorn on someone's work and what you don't understand. And you say their work is useless.

my scorn is not for this person's work but for the abomination of a programming language that made it possible
Post reply on HN