3 ms·
C++ is still missing optional Reflection/Introspection. With that feature it could easily replace majority of todays typed languages (with exception of language
by platform 13y ago
C++ is still missing optional Reflection/Introspection. With that feature it could easily replace majority of todays typed languages (with exception of language such has Haskell or Rust).
Reason is that reflextion allows to close a 'external data types' dissonance that currently is present in C++. In other words it is not possible to develop 'framework software' that can introspect plugin/consumer code to derive how they view the externally defined data sources (eg Databases, UI kits, JSON streams/etc).
- vinkelhake 13y agoC++ study group 7 (SG7) is looking at various reflection proposals. https://groups.google.com/a/isocpp.org/forum/?fromgroups#!forum/reflection https://groups.google.com/a/isocpp.org/forum/?fromgroups#!fo...
- jjoonathan 13y agoThe first time I wondered how the hell C++ didn't support introspection, I was 1/3 as old as I am now. I have literally been wondering for most of my life. But hey, at least they have a Turing-complete template language to go with their macros! Priorities, right?
- vinkelhake 13y agoYes, priorities. The evolution of C++ is driven by its users in the industry. That C++ not yet has support for reflection or introspection is an indication that there hasn't yet been a great need for it. Any C++ user (you know, the people who actually use the language) will tell you that templates is a central part of the language and something that is far more important than introspection. Anyway, like I said in the other comment, there's a study group for reflection now. We'll see what comes out of it.
- jjoonathan 13y ago> Any C++ user (you know, the people who actually use the language) Funny, because I am a heavy C++ user (why did you assume differently?). C++ probably accounts for between 1/3 and 1/2 of my lifetime lines-of-code. Trouble is, I've had to use it for more than algorithms work, which is the only place I've ever seen templates shine. I've used a half dozen C and C++ GUI frameworks that painstakingly work around the introspection issue, and while these frameworks often make do quite nicely without templates, they always have a bolted-on monstrosity of an introspection system. Qt is probably the most direct example: they built their own preprocessor/parser around C++ to take care of their need for introspection. I'm glad there is a study group, but the absence of introspection has been hurting the C++ community for a long time. It's the flaw that has launched 1,000 high-level languages and 100,000 dirty hacks.
- pfultz2 13y ago> But hey, at least they have a Turing-complete template language to go with their macros! Priorities, right? And with that you can build reflection: http://stackoverflow.com/a/11744832/375343 http://stackoverflow.com/a/11744832/375343
- jjoonathan 13y agoGreat, now all I have to do is convince every company in the world that uses C++ to paste a macro into each class and keep duplicates of all their variable declarations. (Poe's law applies, sorry if you were attempting humor and I missed it.)