Live data from Hacker News

Reflection for C++26

isocpp.org

211–214 of 214 posts

Re: Reflection for C++26

#211

Earlier quoted context omitted.

> That's all well and good, but what would you do exaclty? Start with having the standards committee accept that they are in fact where the buck stops, and that the language includes, whether they like it or not, the toolchain. They don't have to decide upon the toolchain, but their current MO of "toolchain/ABI issue == not our problem (except for when we decide we're not willing to make any backwards incompatible AB…

> except for when we decide we're not willing to make any backwards incompatible ABI changes That's not an exception. The committee is not willing because the implementors explicitly said it is not going to happen, no matter how much Google cries. > Except there is. If I write an implementation of the standard library, and provide an implementation of std span if you write it as an user you are constrained by the ABI…

> The committee is not willing because the implementors explicitly said it is not going to happen,

Yeah, and I think this is the problem at the root of my gripe. If the committee was willing to reach this point earlier I think we’d be better off!

> But implementors are not: they can bless their own span with superpowers if they want to

Except that they don’t. And we can go around in circles here - I maintain this is a design issue, and it should be fixed at the design stage, rather than passed on to the compiler vendor who are stuck behind the theoretical design that pretends an ABI doesn’t exist, and their customers who will not upgrade if they break the ABI.

Lastly, I agree that the committee cannot force conformance or optimality, nor should they. But their unwillingness to accept that unless it’s technically impossible, the vendors will move mountains for conformance. This leaves us fighting with each other over who is to blame (see this thread), and in my opinion the end result is a half baked outcome that solves the paper problem but doesn’t solve the actual users wants.

Re: Reflection for C++26

#212

Earlier quoted context omitted.

> except for when we decide we're not willing to make any backwards incompatible ABI changes That's not an exception. The committee is not willing because the implementors explicitly said it is not going to happen, no matter how much Google cries. > Except there is. If I write an implementation of the standard library, and provide an implementation of std span if you write it as an user you are constrained by the ABI…

> The committee is not willing because the implementors explicitly said it is not going to happen, Yeah, and I think this is the problem at the root of my gripe. If the committee was willing to reach this point earlier I think we’d be better off! > But implementors are not: they can bless their own span with superpowers if they want to Except that they don’t. And we can go around in circles here - I maintain this is…

>> But implementors are not: they can bless their own span with superpowers if they want to > Except that they don’t. And we can go around in circles here

Except they do. Look at GCC code for std::complex compared to the equivalent hand rolled class: https://gcc.godbolt.org/z/nqcvhPWex . edit: note that in this case GCC is just silly with the hand rolled one, but it does show that they are treated differently.

GCC does similar things with span where the class has special annotations for reference tracking to improve warning messages.

Library vs builtin is an implementation issue, not a standardization one. But yes, we are going in circle.

Re: Reflection for C++26

#213
post #204
post #11

Earlier quoted context omitted.

magic_enum is killing my build time with endless template instantiations. Is this going to be faster?

If you're using C++20 or above, you could try conjure_enum ( https://github.com/fix8mt/conjure_enum ) It's based on magic_enum but optimized for C++20. Not sure about compile times although in our testing and with our test users it hasn't been reported as an issue. Yes, there is magic_enum already - and we based this implementation on the core of magic_enum, but refocused for C++20, using some of the key features of…

I'm trying it, and this library doesn't work on clang 14. Do you have any insight as to why?

Re: Reflection for C++26

#214
post #213
post #204

Earlier quoted context omitted.

If you're using C++20 or above, you could try conjure_enum ( https://github.com/fix8mt/conjure_enum ) It's based on magic_enum but optimized for C++20. Not sure about compile times although in our testing and with our test users it hasn't been reported as an issue. Yes, there is magic_enum already - and we based this implementation on the core of magic_enum, but refocused for C++20, using some of the key features of…

I'm trying it, and this library doesn't work on clang 14. Do you have any insight as to why?

Not supported. Minimum 15. See "8. Compiler support"
Post reply on HN