this can't happen soon enough :( we must have this now!
@llothar687 жыл бұрын
Maybe in C++26. Serious, the language moves so slow with really new ideas.
@anfield63217 жыл бұрын
Herb comes from a beach every time he gives a talk?
@poserise7 жыл бұрын
Yeah, Nick Slaughter's styling :)
@FooBar896 жыл бұрын
no, he's just that awesome :)
@sephirostoy7 жыл бұрын
My eyes shined from the second slide to the last slide and and even more after each one. This presentation sounds to solve most of the C++ lacks and more. Definitively I want it tomorrow.
@jaysistar27117 жыл бұрын
Unreal Engine 4 and Atomic Game Engine both have script bindings that need a side compiler. Adding a side compiler to a build system is rarely trivial. This proposal would eliminate the need for those side compilers. Also, Protocol Buffers, and CapNProto could eliminate their side compilers. Object DB mapping, and general serialization benefits as well.
@kamilkoczurek4847 жыл бұрын
Indeed, in 10 years we may see Qt become actual c++ library instead of language extension. //Wow, it's actually in that video. :0
@guillaumepiolat59637 жыл бұрын
This is basically what we have in D for years
@kamilkoczurek4847 жыл бұрын
I use D sometimes, how is that feature called? Never heard 'bout that.
@guillaumepiolat59637 жыл бұрын
It's the combination of static (and runtime) reflection, CTFE, static foreach, static if, string mixins, and traits. For example checkout dproto which compile Protocol Buffers at compile-time, std.regex, pegged...
@seditt51464 жыл бұрын
If I am not mistaken LLVM on a relative scale anyway does make side compilers Trivial. Trivial as possible for what it is but still.
@TheJanhalsema17 жыл бұрын
I can't wait to use this, this is so amazing :)
@seditt51464 жыл бұрын
While I kind of want this, We have to ask ourselves. Will this make our code shorter? Right now C++ can do pretty much anything your heart desires, you can do whatever with the language. Is this reflection necessary or order to write code faster. If it does not make our code writing faster we should not implement it because C++ has been getting more and more stuff that is bloating the language and making writing code longer in some cases. These Meta classes while they seem cool and my most recent project could have likely used just a thing as I attempted to abstract out function pointers to store different signatures all in the same array. Reflection could have helped but I managed to do it anyway and not sure this sort of stuff is worth the bloat. Idk, I guess we will see. Most peopple have not even learned many of the features of c++17 yet and we are almost into 2020
@kwanarchive7 жыл бұрын
I want this yesterday.
@jimhewes75077 жыл бұрын
Although it makes the code _look_ simpler, will such code really be simpler in practice? For example, if you don't know for any given class whether variables are public or private by default, then you will always have to go running for documentation to find out. Whereas in good-old normal C++ I know they're always private. With metaclasses you get power because you can change the rules, but then you don't always know what the rules are when looking at any given code. True? I haven't fully ingested all this yet, and no doubt metaclasses are a good thing. But as far as being simpler I'm not sure yet. Anyway, a first impression.
@cH3rtzb3rg7 жыл бұрын
But if you write `typedef std::pair Point;` vs. `value Point {int first; int second; };` where is the difference between looking up how `std::pair` is defined and how `value` is defined? Of course you could define insanely stupid metaclasses, but you can also define stupid classes. And if you code something which is already simple with a standard C++ class/struct, there is no reason to hide this somehow in a metaclass.
@jimhewes75077 жыл бұрын
Yes, if there is encapsulation going on and you need to know what's in there you have to look it up. But there is now an additional level. If I'm reviewing a class definition, I still don't know the rules. I don't know what extra functions might have been added, what various defaults are, etc. So I'd also need to look at the metaclass definition. As shown in the slide at 22:00, you are getting to define a little more of the language itself which the compiler normal defines. So when you are looking at code you have to ask yourself, "what 'language' am I looking at now?" What are the rules here? I noticed that even the volunteers had some trouble. In the slide at 15:00 they had trouble guessing whether the members of Point were public or private. They gave different guesses. I understand that Herb's intention was to get them to say what they _wanted_ or _expected_ the defaults to be in this particular case. But you can't know until you also look at the metaclass definition and that was not simple at first glance. This would be good and probably simpler _within_ a company where you were familiar with the metaclasses you've built. But simpler in the wild? I guess I'll have to use it for a while to see if that's true.
@Runoratsu7 жыл бұрын
Yep, this is my biggest concern with this as well. Maybe it won't be the same for completely new programmers, but if I look at something that looks like a class, I'll begin to parse it as a class (in my head), and might then, from time to time, expect different behavior than what will be produced. It just makes the code so much more implicit. With inheriting classes I at least see: Oh, there's a parent class, I should look into it to see its methods! At least some kind of identifier (attribute/whatever) for metaclass types would be good imho.
@r4uz7 жыл бұрын
Any class today, if it has base classes, you'll have to study the base classes first to fully understand the limitations of the derived class. For classes "coming from" a metaclass, it means you'll have to study the metaclass first to understand its limitations. I don't see this as a negative.
@SolidAir54321 Жыл бұрын
Considering the Rust derive macro I'm warming up to metaclasses.
@RobTheBlob7 жыл бұрын
Really pleased to see this direction being explored. I do wonder why limit it to metaclasses? Is is not possible (in theory) to apply this type of transform at other scope levels - notably namespaces and methods, to allow similar transformations. For example, it could enable writing a test class, with test methods - each generating the appropriate scaffolding to support a test runner or test explorer tools.
@videocortex-io7 жыл бұрын
Mind blowing!
@lividlin41427 жыл бұрын
nice talk. encapsulation is a double sword, you put everything in blackbox, hard to figure out code idea at first glance.
@jleahr7 жыл бұрын
Metaclasses...I want it, I love it, We need it
@jaredmulconry7 жыл бұрын
The end result is cool. The mechanism, whilst a little clunky, is in a good direction. Having static reflection will be the first step. Follow it with this hook-in point makes sense because I see *huge* issues coming up with the grammar, especially around namespaces, scoping and what it means to have one of these things in template declarations, etc. Basically, everything that the keyword 'class' has to deal with, so must anything you make with this facility. Good luck :p
@jstock23177 жыл бұрын
Mmmm, Object Oriented OOP This talk will be legendary, great stuff!
@Sobbayi7 жыл бұрын
This is so amazing... I'm feeling really excited about this
@paulcook82114 жыл бұрын
This is pure genius.
@henrymiller18207 жыл бұрын
I want std::interface in the library for C++20, even if the syntax to do any other interface needs to wait for a latter standard.
@mrlithium697 жыл бұрын
This was way over my head but it looks good - if you can understand it.
@k6l2t6 жыл бұрын
If Jai gets released before C++ adds reflection, C++ is going to get dropped from the game development industry.
@hys4207 жыл бұрын
As always - exceptional
@draguin7 жыл бұрын
The way Herb asks the questions and presents the features is biasing judgement so much
@CharIie837 жыл бұрын
is it necessary to reinvent the wheel every time?
@EgnachHelton7 жыл бұрын
Brilliant!
@simivb7 жыл бұрын
The first 18 minutes are the worst way to present something that I have ever seen. he puts two people on stage an plays "guess all the awesome things about my stuff" with them. WHY?? Whats it with the "what if I told you..."?
@seditt51464 жыл бұрын
I feel like these people are lying about some stuff and I am only 15 minutes in. Give it a real review already else they are going to keep pushing crap that don't make sense. The Interface they obviously thought was crap but then soon as he said that is the proposed standard they changed their tune as though they wanted it. Which means we get trash because people giving them input are not truthful because they are star struck.
@ronniecorbett7 жыл бұрын
Fantastic!
@acmdz7 жыл бұрын
actually praying for this
@andoalon7 жыл бұрын
I need this so hard
@georgeplaintiff8197 жыл бұрын
I also see equivocation fallacy here, if something *looks* simpler, it doesn't mean it is. When Dijkstra said that every problem can be solved by introducing another level of abstraction, he didn't mean it in a positive way, piling abstractions is a bad thing. This would also introduce more dependencies within code base and make it harder to move code between projects, if it won't spawn a bunch of "sub-languages" altogether... The idea isn't that bad in itself, it's just that there are many ways it can be abused.
@piotrarturklos7 жыл бұрын
If you think this feature is powerful, check out D language in which you can generate source code as a **string** at compile time and tell the compiler to treat it as a part of compiled source code. Its not macros, it uses regular, very readable D code to generate the strings. Combined with compile-time introspection (also in D) and powerful template system it enables creating special classes like in the video and much more. The metaclasses proposed in this video are quite limited because you can only define a class this way. In D you can generate any expression or statement (another issue is that often you don't even need to generate code as strings because D templates are very powerful). As an extreme example, in D you can define class Parser by writing formal grammar as a string in source code.