←back to thread

196 points svlasov | 1 comments | | HN request time: 0.215s | source
Show context
lallysingh ◴[] No.40851756[source]
Wow this got really long. I was one of the coauthors for a reflection proposal (N3340) over a dozen years ago. Implementing compile-time reflection is honestly trivial - you basically transfer data from the symbol table on-demand into template specializations. It was roughly 1500 LOC to modify g++ to do it.

Looking at the examples (https://isocpp.org/files/papers/P2996R4.html#examples) what really stands out is the direct integration of type-syntax into the language. It fits in with a certain token-substitution way that connects back to templates. It also replaces some of the uglier operators (typeof?).

I hope it goes int! During the language's stagnation I left for a while, perhaps it'll be competitive again soon.

replies(2): >>40851990 #>>40855315 #
stiglitz ◴[] No.40851990[source]
By ”stagnation” do you mean “not getting new features”?
replies(3): >>40852374 #>>40852457 #>>40852476 #
jacoblambda ◴[] No.40852476[source]
C++ has gotten a ton of quality of life features with each update. The issue is less that new features aren't coming and more that new features bake through countless iterations of proposals for close to or often over a decade until everyone in WG21 is happy.

So it's not that we aren't getting features. They are coming quite fast and people regularly complain that new C++ has too many things for them to learn and keep up with. The issue is that those are the same features everyone has been asking for for over a decade so the people that really care found workarounds and eventually move over to the new std way of doing things when they can while everyone else continues waiting for that one feature they really care about.

replies(7): >>40853490 #>>40854139 #>>40854365 #>>40854369 #>>40854878 #>>40855193 #>>40856663 #
okanat ◴[] No.40854369[source]
I think the bureaucratic cadence of the things also make C++ not a unified entity. C++ is patchwork language. So many of the new features don't work well together or don't fit together or they have conflicting goals.

Since the proposals target problems with differing philosophies, they each have different traps in them from bad time complexity to outright unrefined behavior. Keeping up with the updates hard because of this.

I think many C++ projects are (or will be) basically infeasible to maintain not because of the old problems but due to the exploding complexity of the interactions of all features, unless developers actively ban using large parts of the language.

replies(1): >>40859041 #
1. jacoblambda ◴[] No.40859041[source]
> C++ is patchwork language. So many of the new features don't work well together or don't fit together or they have conflicting goals.

I don't really see this as true. In my experience most C++ features actually "just work" together and there are relatively few footguns involved in mixing features.

And it's less that C++ is a patchwork language and more that it is multi-paradigm and multi-discipline. Some features have specific applications and they get used inappropriately but in my experience that is solved with a quick reference/citation of the standard during code review or in a new ticket.