Rust Features that I Want in C++ - David Sankel - CppNow 2022

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ต.ค. 2024

ความคิดเห็น • 184

  • @dexterman6361
    @dexterman6361 2 ปีที่แล้ว +77

    Man some of the audience just don't seem to get the point "YoU cAn dO THaT IN c++ juST dO so And so aNd MAcro aND CLass" like bro do you want the language to evolve or not? I get that you like the language but if you really like it, accept the flaws and let it evolve. Please, let modern C++ not be stuck in the past. There's a reason Rust is voted most fav language 3 times in a row.

    • @cthutu
      @cthutu 2 ปีที่แล้ว +22

      6 times in a row

    • @kaplansedat
      @kaplansedat ปีที่แล้ว +11

      The attitude of the audience and the attitude of the presenter towards his personal views were very interesting. I think a language of unquestionable talent was killed or frozen by such a community. The presenter does not criticize, he just wishes we had it. i am a hobbyist programmer. wanna learn c++ or rust. Thank you to the audience at the presentation. They made my choice easy. Add a point to Rust.

    • @kaplansedat
      @kaplansedat ปีที่แล้ว +6

      they were so offensive in the beginning. therefore they could not object to 54:58 . because they set an example of the attitude mentioned. it was great. I don't know if it's predictive or detective for him to add this to the presentation. but I really liked the silence in this part. I have added this part to my favourites.

    • @RD-fb6ei
      @RD-fb6ei ปีที่แล้ว

      If you went to a rust crowd and showed off C++ features the reaction would be a thousand times worse. I can already hear it. Why would you need default parameters when you can just implement a dozen getters with for builder pattern?

    • @mishugrig6832
      @mishugrig6832 ปีที่แล้ว

      C++ has evolved into a scientific computer that most people don't know what all the buttons do.

  • @ISKLEMMI
    @ISKLEMMI ปีที่แล้ว +57

    37:13 - So, this person essentially asks, "What if I don't want to RTFM or read the code?"
    You have to read one or the other (preferably *both*), no matter the language or the library. In a talk interrupted by lots of really silly questions/statements, this was the silliest.

    • @clv603
      @clv603 ปีที่แล้ว +1

      agreed. But in my experience it's not uncommon.

    • @Inuyasha463
      @Inuyasha463 ปีที่แล้ว +3

      I just got to that point in the video and had to pause for a minute because I was so dumbfounded.

    • @bluedark7724
      @bluedark7724 ปีที่แล้ว +6

      "I'm the kind of guy that doesn't read documentation." 😂 Well, how the hell did he learn how to program in the first place.
      I bet he doesn't read his code either.. it just is

    • @bluedark7724
      @bluedark7724 ปีที่แล้ว +2

      37:40 "is an important comment" he said.
      What not reading 😂

    • @greg_land
      @greg_land 11 หลายเดือนก่อน +2

      I think the point of what was being said was "I don't want to have to read the manual to figure out how to use your library because you decided to be to "clever" instead of just doing things the simple and straight forward way."

  • @wackytheshaggy
    @wackytheshaggy 2 ปีที่แล้ว +110

    If you want to know what the problem in c++ is, there is a guy, clearly passionate about c++ talking about cool stuff he saw somewhere else and more than half the comments from the audience are about how he’s wrong.

    • @mikeharry1799
      @mikeharry1799 ปีที่แล้ว +2

      Exactly what I thought.

    • @richardfairthorne7021
      @richardfairthorne7021 ปีที่แล้ว +4

      Despite the negativity, I found it encouraging. It showed that people were engaged and curious.

    • @jakearkinstall5313
      @jakearkinstall5313 ปีที่แล้ว +15

      ​@@richardfairthorne7021 No, it showed that several members of the audience wanted to divert attention to themselves.
      Most of the comments weren't actual questions, and most of the actual questions were questions about aspects of the slides that weren't pertinent to the topic.

    • @DBGabriele
      @DBGabriele ปีที่แล้ว +10

      This is common in all communities, try saying that C++ is better at something during a Rust conference or on Reddit's Rust community. Be prepared for a cascade of arrogance and sarcastic comments.

  • @tylerbloom4830
    @tylerbloom4830 2 ปีที่แล้ว +76

    Great talk. I love to see C++ folks getting interested in Rust. A slight correction around 16:40, David said something that is not entirely true about pattern matching an enum. If you only care about one or two variants of an enum, you can still use match statements. You can just use a wildcard as your last branch of the match and just let it be a no-op. Alternatively, you can use destructuring with if-let to do something given a specific variant. Rust's destructuring ability also goes much further than that and is an incredibly powerful tool.

    • @peramoredellanalisi4341
      @peramoredellanalisi4341 ปีที่แล้ว +1

      Excuse me, why should C++ programmers get interested in Rust? Ain't it possible for you to continue to work on your Rust and for us with C++? What's wrong with that? Variety is beautiful, isn't it? A world with Rust and C++, each one with its strengths and weaknesses, is an amazing world!

    • @kilianvounckx9904
      @kilianvounckx9904 ปีที่แล้ว +20

      ​@@peramoredellanalisi4341He just said he loves it when c++ folks get interested in rust. Never did he say every c++ programmer should switch over to rust or anything. As you say variety is beautiful, so people can like more than one language

    • @not_ever
      @not_ever ปีที่แล้ว +3

      ​@@peramoredellanalisi4341 I think you have misinterpreted Tyler Bloom's comment but, to answer your question, there are benefits to learning the basics of any language outside of C++. Each new language you learn gives you a fresh perspective on C++ and new ways of thinking and problem solving. Similarly, The Pragmatic Programmer recommends learning one new language a year. Rust is very quick and easy to learn when you have a C++ background, which makes it an idea candidate for busy people. If you can ignore all the pointless hostility towards C++ and proselytising by certain, frankly moronic, members of the Rust community, it is a very interesting language and probably will make you a better C++ developer.

    • @raianmr2843
      @raianmr2843 ปีที่แล้ว +3

      @@peramoredellanalisi4341 dude, rust was literally created by c++ folks. these langs and communities don't have the weird antagonistic relation that you think we do. like me, most rust folks are also cpp folks. this is like, literally how tech evolves and all

  • @julkiewicz
    @julkiewicz ปีที่แล้ว +38

    Incorrect pointer ownership bugs are uncommon (according to the talk). But hidden concurrency bugs are very very common and extremely hard to find in complex systems. And you cannot have proper thread safety in a system where there can be ownership issues. So actually the main advertised feature of Rust is in fact essential.

  • @thosteg
    @thosteg 2 ปีที่แล้ว +76

    One interesting aspect that (I believe) was not mentioned was language editions. In rust it is possible to say that a particular component adhers to a specific version of the rust language. The component can then be defined that it must be compiled with a certain version of the language. That does not mean that all components require this version of the language. The same compiler is capable of building each component with its permitted language edition but that does not restrict the calling application in regards to the required language edition. This could enable deprecating certain language features while retaining backward compatibility. (Searchterm: "rust editions")

    • @kevindelnoye9641
      @kevindelnoye9641 2 ปีที่แล้ว +4

      There was a proposal for this in c++ if I am not mistaken, c++ epochs or something similar

    • @gowtham236
      @gowtham236 2 ปีที่แล้ว +3

      In c++, I think you can achieve that at a file level with compiler flags indicating the language version.

    • @fdwr
      @fdwr 2 ปีที่แล้ว +2

      That's the one thing I really want because it would enable C++ to progress without the shackles while still maintaining compat. Surprisingly nothing in his list did I care about, and the one thing I cared about wasn't mentioned :/.

    • @thosteg
      @thosteg 2 ปีที่แล้ว +1

      @@gowtham236 Indeed, though the difference is that c++ regularly only adds features, it does not (usually?) deprecate them in newer language versions.
      On the other hand, if something is warned about in a new version, that can help already, with "treat warnings as errors".

    • @brianmorin7022
      @brianmorin7022 2 ปีที่แล้ว +4

      A major complication is include files. C++ doesn't have a modern concept of internal vs external surface area the way newer languages do. This causes a lot of leakage of details, side effects, order dependencies, package nightmares, slows down builds and makes it really computationally expensive to do the sorts of editors we've become accustomed to.

  • @obrsl
    @obrsl 2 ปีที่แล้ว +137

    How do I downvote the audience?

    • @peterwmdavis
      @peterwmdavis ปีที่แล้ว +5

      26:09 “I’m gonna present an alternative, because, obviously.” lol.

    • @peterwmdavis
      @peterwmdavis ปีที่แล้ว

      and it gets snippier from there

    • @Aaron-o_o
      @Aaron-o_o ปีที่แล้ว

      Ikr

    • @TheEmT33
      @TheEmT33 ปีที่แล้ว +7

      jeez the constant interruption made this talk unwatchable and it was not the speaker's fault

    • @eliduvid
      @eliduvid ปีที่แล้ว +12

      but the guy pushed through like a champ, and made his points clear

  • @kevindelnoye9641
    @kevindelnoye9641 2 ปีที่แล้ว +19

    There really should be some kind of community "suggestions" committee kind of like the cpp core guidelines.
    Half of the c++ ergonomic issues could be solved with minimal standardization efforts and agreeing on a common convention.
    - docstring annotation
    - test annotation
    - pitchfork layout
    - reviewing community libraries for a coherent API that will never reach the standard (argparse, Json, graphics, networking ...)

    • @julkiewicz
      @julkiewicz ปีที่แล้ว +2

      It sounds like perhaps they should first focus on making the C++ standard more easily changeable and faster to iterate on. Issues like having underscore breaking the syntax of existing code base should be avoidable. I really liked some of the ideas from Herb Sutter's CPP2 talk.

  • @chololennon
    @chololennon 2 ปีที่แล้ว +8

    Great talk, but please, audience's comments at the end, otherwise it's awfully long and a mess for all of us who are not there.

  • @dougrudolph5400
    @dougrudolph5400 ปีที่แล้ว +29

    the audience's comments juxtaposed to the community section of this great talk was a real time example displaying the lack of self-awareness in the C++ community. I've used C++ for many years, but fr it's so easy to have an egoless technical conversation with ppl in the Rust community. if you dare ask a question in an online C++ forum, there's more than 50% chance that you'll get a "well actually" type response, or just something vague and pedantic. and what's worse is that the people in this audience are doing this pedantic commenting, and they're the experts the lead committees of this language. the C++ community from the top down is rude. I'm happy to see there is someone deep in the C++ ecosystem that is trying to course correct the community, but god damn just watching this make me feel like the damage is already done

    • @AG-ld6rv
      @AG-ld6rv ปีที่แล้ว +4

      The audience was so absurd it made me laugh at times like the guy splitting hairs so much he corrected the dude when he said he worked on that paper 5 years ago ("Actually, it's 7 years" or something like that). That kind of thinking is useful in programming though as a program is full of technicalities, and the more you know about all of them, the more sense programming will make. They just need to cool it on the ego when it comes to irrelevant things like how old a paper is.
      I can't judge each and every comment made in the talk without knowing what their proposed C++ solution would look like (for all I know, some of these features really are quite easy to do in C++, and if that's the case, bringing it up during the talk was justified. Perhaps some people's concerns were well-founded.).
      As for your feeling attacked thing, I can't relate. In matters of performance (like business), politeness isn't needed. Efficient, understandable communication is more important. We are dealing with real, brutal realities when in comes to competition. You either know something or you don't, and being corrected isn't an insult. As long as the comment is true and adds to the asker's picture of programming in C++, it was actually a charity for a person to make a comment like that - not an insult. Of course, that is assuming the comment was accurate and that there was context for the information to be relevant.
      Personally, I love when someone gives me a detailed analysis of how I'm wrong. I just got free tutoring from an expert. We live in a very sensitive world where about 80-90% of people take being fallible as an insult. As a simple example, in most competitive, team-based video games, they have switched to showing people's ranks only AFTER the game concluded. I used to use that information to comprehend who deserves to lead the team, whose recommendations should be used. Unfortunately, tons of soft gamers took leadership / charity work / instruction / orders from someone who deserves to command as an insult. The prognosis is "teenager" (or man child), because successful adults understand power structures can exist and should exist sometimes. I guess they felt "attacked" as well. It's pretty sad, because now when someone gives a recommendation, you don't know if they're 4 ranks higher than you and you ought to take their advice, or if you're 4 ranks higher than them and should trust your own instincts. In a live match, there is no time to vet out each person's idea or derive optimal play on the fly, so you really need a measurement of authority in order to decide who to trust more and who to trust less.

  • @OptimusVlad
    @OptimusVlad 2 ปีที่แล้ว +20

    Some of the audience members are so obtuse. "Python can parse comments to do that" -- Who cares? Do you not understand what the man is trying to illustrate?

  • @loganmcbroom9001
    @loganmcbroom9001 ปีที่แล้ว +9

    The actual best rust feature is that the community doesn't act like the audience at this talk. I'm quitting out halfway through this because it's been multiple straight minutes of people interrupting with pointless comments.

    • @SealedKiller
      @SealedKiller 11 หลายเดือนก่อน +2

      Wow, the community must be full of intellectuals!

  • @Mark-zk7uj
    @Mark-zk7uj ปีที่แล้ว +7

    15:20 Sum types are a fundamental ingredient! Who knew! Apart from ML programmers for 50 years

    • @ccgarciab
      @ccgarciab ปีที่แล้ว +2

      One day Hindley Milner will be the minimum expected from type systems

  • @hellwolf4liberty
    @hellwolf4liberty 2 ปีที่แล้ว +15

    the elephant in the room is that, C++ is not a single compiler, it is a standard compromising for max adoption among all its compilers.
    You'd get some of what you want here into one c++ compiler. It seems a wrong expectation to expect c++ standardisation be as nimble as other single compiler languages.

    • @talesvinicius598
      @talesvinicius598 ปีที่แล้ว

      But does the standard needs really 3 years minimum for every single feature? And there's some features that they don't even have a proper test before implementing it to the standard. The way the language is evolving has to change, it's not modern to have a "update" every 3 years anymore.

    • @AG-ld6rv
      @AG-ld6rv ปีที่แล้ว +2

      @@talesvinicius598 Evolving C++ is probably one of the hardest, complex, and intellectually difficult types of work a programmer can do. It's done by highly rational people. If they could iterate faster, they would.

    • @pierreollivier1
      @pierreollivier1 10 หลายเดือนก่อน

      @@AG-ld6rv Yeah that's the problem the language is a pile of shit built on top of pile of crap, it's not good and unfortunately they don't want to break anything so they just add things nobody cares and uses.

  • @bocckoka
    @bocckoka 2 ปีที่แล้ว +8

    Linear types. Linear types are magic. You can do totally misuse resistant APIs with it, because you can use types as proof of work done.

  • @PaulTopping1
    @PaulTopping1 2 ปีที่แล้ว +7

    Great talk! One obvious question that the speaker didn't address (or I just missed it) is whether they would use C++ or Rust for a new project. I realize that that might have a complicated answer but it has to be asked.

    • @thelatestartosrs
      @thelatestartosrs 2 ปีที่แล้ว +2

      At the start he essentially mentions he doesn't work on new projects

    • @laurenpinschannels
      @laurenpinschannels ปีที่แล้ว

      2:05 or so

    • @random_bit
      @random_bit ปีที่แล้ว

      the answer is really, it depends… depends on, if your target platform has an LLVM compatibility or not. i tried compiling some rust for an unsupprted embedded platform this week and ended going the C route because I could not get the nightly compiler working on the rust side.
      and yes C, not C++, i have 0 interest in writing C++ in the current era, the community is simply that unapproachable.

  • @nathanbanks2354
    @nathanbanks2354 ปีที่แล้ว +17

    I'm coming from Python and dusted off my C++ to write a module. It has a memory leak somewhere. Now I'm planning to translate it into Rust since it needs refactoring anyway. This talk makes me think learning Rust is the right decision.

    •  11 หลายเดือนก่อน +3

      This sounds more like you simply don't know how to write C++, I wouldn't blame the language that easily.

    • @IExSet
      @IExSet 10 หลายเดือนก่อน +1

      A language itself wouldnt solve ur problems, neither in Python nor in Rust, if u doesnt have skills to use a tool, dont change the tool change ur skills or u'd be doomed to run in search of silver bullet for a rest of ur life ! 😂

  • @thevinn
    @thevinn 2 ปีที่แล้ว +21

    Great talk, BUT.... "Make C++ more ergonomic" is super broad. I try to make my own libraries ergonomic and this is an enormous task. I spent 8 months designing Beast's body abstraction and it is still not ergonomic. One does not simply make a thing more ergonomic. Standard library interfaces are already pretty ergonomic, after all they were designed by the cream of the crop of knowledgeable C++ folks. To improve them further, one or more individuals would need to do a narrow, deep dive into a particular interface. Say, "filesystem::path" for example. It isn't easy. But we should try.

    • @Roibarkan
      @Roibarkan 2 ปีที่แล้ว +6

      I agree. I’d also say that the notion of UB-NDR (undefined behavior, no diagnostics required) is non-ergonomic by definition and is quite prolific in c++

    • @raymundhofmann7661
      @raymundhofmann7661 2 ปีที่แล้ว +1

      The tools could also gain their ergonomy, for example:
      - Error messages / Diagnostics getting you quicker to where your compile problem is.
      - Helping with object pointer/reference life time by thread aware static analysis.

    • @bunpasi
      @bunpasi 2 ปีที่แล้ว

      I used Beast and I really like it, but I think that ergonomics has to do with the interface as well. I've built a wrapper around your code with which you only need to call `Response = Request::GET(args)`. There is also an asynchronous version. A C++ library can be almost as easy as a JS library. If I actually need more options, I'll fall back at Beast itself. That's what is great about C++. You can get the best of both worlds.

    • @firexgodx980
      @firexgodx980 ปีที่แล้ว

      Here's a way to make it more ergonomic: don't require -m when you want to use the math library. If this trivial case can't be solved, C++ is irredeemable.

  • @tuckerhart510
    @tuckerhart510 2 ปีที่แล้ว +13

    Great talk but wow some of the commentators really just wanted to hear themselves talk 😭

  • @voidwalker7774
    @voidwalker7774 2 ปีที่แล้ว +12

    He did a good job, convincing this C++ programmers to use Rust instead xD

    •  ปีที่แล้ว +1

      I don't think any C++ programmer would be switching, rather learning Rust as well. Why not.

  • @KyleSmithNH
    @KyleSmithNH 2 ปีที่แล้ว +4

    Really would have preferred if he didn't take any questions or comments during the presentation. Not a lot of useful discourse.

  • @think2086
    @think2086 2 ปีที่แล้ว +8

    Just use `*` as wildcard.
    If it doesn't precede a variable name, it's not a pointer declaration or dereference. If it is not between two integral types, it's not multiplication.

  • @kostaad
    @kostaad 2 ปีที่แล้ว +2

    C# introduced pattern matching and it is every bit as great as you think it is :)

  • @cthutu
    @cthutu ปีที่แล้ว +8

    One of the super powers of Rust is Editions. This allows a newer version of Rust to be backward incompatible with a previous version but still be able to build code that uses both versions. The secret sauce to this is Miri which is an intermediate language generated from all versions of Rust code. This is then used instead of Rust code to build and generate the code.
    I think C++ requires a similar official system. Then a more modern C++ can be backward incompatible and so you can fix its issues. There is a complication with header files but perhaps that can be fixed with #defines such as #if __EDITION >= 2023 ...

    • @EMB3D
      @EMB3D ปีที่แล้ว +1

      Cpp is backward compatible

    • @DBGabriele
      @DBGabriele ปีที่แล้ว

      There the module, a good starting point to drop some old features.

    • @Soraphis91
      @Soraphis91 ปีที่แล้ว +5

      @@EMB3D that's not the point. the forced backwards compatibility in the language level is what makes it hard to modernize cpp while dropping old / error-prone stuff.
      editions are a way to allow for backwards INcompatibility (while still allowing to build the projects)

    • @iso-c
      @iso-c 9 หลายเดือนก่อน

      @@EMB3D and CPP style do it, is very expensive for evolution.

  • @toddzankich9200
    @toddzankich9200 2 ปีที่แล้ว +3

    We can put the tests in the same file with doctest -- and in either traditional or BDD style. My manager also disagrees with me that tests should be right in the .cpp file for ultimate locality. A compromise is that, for every header xyz.h, and maybe xyz.cpp, I write a corresponding xyz.spec.cpp to test it. At least that way I don't have to change directories. (In the past, though, I have rigged up hotkeys to jump between corresponding h/cpp/test files.)

    • @toddzankich9200
      @toddzankich9200 2 ปีที่แล้ว +1

      Regarding the next point about Rust checking code examples in doc comments, code examples in doc comments might be an anti-pattern, anyhow, and WET (not DRY) if you already have, say, doctest BDD-style executable documentation directly in your .cpp file. Because then, a failure would be detected with known inputs, expected outputs, and the chain of BDD GIVEN/WHEN/THEN clauses provides context. (If code merely compiles in comment, but doesn't actually work correctly, that's not so useful.)

    • @thosteg
      @thosteg 2 ปีที่แล้ว +1

      @@toddzankich9200 The doc-test is automatically run as part of the tests, it usually includes assertions that prove that the feature works as intended.

    • @dmitriidemenev5258
      @dmitriidemenev5258 2 ปีที่แล้ว

      @@toddzankich9200 To add more info to @Thomas Stegmaier reply, you can also use both declarative and procedural macros in doc comments. #[doc = my_macro_call!("...")] so macros can generate documentation.

  • @rafaelkss2009
    @rafaelkss2009 2 ปีที่แล้ว +1

    I dunno Circle, but that statement seems BOLD. I mean Ruby is pure meta programming basically, they revived MVC with it.
    Very bold statement, not saying it's wrong, just saying this is something.

  • @gubgubbubbub
    @gubgubbubbub 8 หลายเดือนก่อน

    That 2015 proposal for variant was so, so much better than std::variant. There's no reason why std::variant shouldn't be implemented as a built-in type.

  • @cthutu
    @cthutu 2 ปีที่แล้ว +13

    For me, personally, C++ is a legacy language. I've already replaced it with Rust. There's pretty much nothing I miss from C++. Professionally, C++ is not legacy yet as I work in the video game industry and it's alive and kicking there (unfortunately).

    • @isitanos
      @isitanos ปีที่แล้ว

      Given the wealth of C++ middleware games use, there's no way Rust can gain popularity there given it can't comfortably inteface with C++. Something like Circle has a much higher chance of working since it has full interop and the ability to selectively enable features in different parts of the source. Circle is supposed to get a borrow checker pretty soon, so it would allow you to work in a Rust-like manner in most of your code while having classic C++ at the borders where you don't have the choice to interact with external libraries or your own legacy code.
      All we need now is commercial backing or an open-source community around a Circle-like language and we're in business, really.

    • @marcossidoruk8033
      @marcossidoruk8033 ปีที่แล้ว +2

      Rust is horrible for games, zig or odin or jai (if it ever releases lol) have much greater potential.

  • @The1RandomFool
    @The1RandomFool ปีที่แล้ว +2

    I just do programming as a hobby, and I'm glad that Rust is more approachable than C++. I moved from C++ to Rust because of it. Rust documentation is easy to read by comparison.

  • @hanabimock5193
    @hanabimock5193 2 ปีที่แล้ว +8

    What an annoying audience, they think they know more than the guy, then just go do the talk…

    • @pmcgee003
      @pmcgee003 2 ปีที่แล้ว +4

      cppnow is a small group conference, with experienced people, that encourages discussion over lecturing.

  • @vincentlextrait3092
    @vincentlextrait3092 10 หลายเดือนก่อน +3

    I've been working on very large very long-lived C++ applications with a specific focus on performance, and no, variants are not everywhere. They are everywhere if you avoid inheritance, which is a fringe usage of C++ (granted, supported by the notable Alex Stepanov). Now as Rust does not have inheritance, variants (aka enums in Rust's parlance) are everywhere... It's poor man's inheritance. Replacing C++ concise virtual calls with match/switch does not sound very appealing to me. Replacing inheritance frugal memory layout usage with variants that take the maximum size even less. It used to be inventoried as the anti-pattern "type bloat".

    • @NotherPleb
      @NotherPleb 9 หลายเดือนก่อน +1

      You don't replace virtual calls with enums. You can still do dynamic dispatch with trait objects.

  • @wi8shad0w
    @wi8shad0w 2 ปีที่แล้ว +12

    The crowd is , irritating, Snobbish and very defensive .. let the man talk or even rant out all he wants.. Thats the only culture to progress ..

    • @piotrarturklos
      @piotrarturklos 2 ปีที่แล้ว +6

      The crowd is engaged, that's good. It's composed of top professionals who want to get to the truth.

  • @27182818284590452354
    @27182818284590452354 2 ปีที่แล้ว +12

    It's a shame that Circle extensions were too scary for the committee, they make the language a lot less masochistic. Or more “ergonomic”, I guess.
    Rust is a great place to adopt Python features for C++.

    • @PedroAlves0
      @PedroAlves0 ปีที่แล้ว

      The commentary about the committee being scared about security was very dismissive although that truly is an important issue. Also, Circle's meta programming model is broken for cross compilation which makes it a nonstarter.

  • @simonhrabec9973
    @simonhrabec9973 ปีที่แล้ว +5

    Today I was coding in C++ a little and made a few simple typos along the way and desptie being able to find the issue quickly I was wondering why just replacing "cin" with "cout" has to create so many ugly error message lines including templates. Just how did we get to the place where we accepted that people should understand what is actually happening under the hood (with all the iostreams and operator overloading) just to be able to fix this small typo.

    • @indiesigi7807
      @indiesigi7807 9 หลายเดือนก่อน +1

      My ide always points to the relevant message and big red would have appeared at your std::cin

  • @ic3man5
    @ic3man5 6 หลายเดือนก่อน

    I remember when learning std::cout almost 20 years ago and thinking "how is this better than printf"

  • @sneu420
    @sneu420 2 ปีที่แล้ว +1

    This dude's great...!
    Shoulda got more views...!

  • @שחרלנגבהיים
    @שחרלנגבהיים 2 ปีที่แล้ว +8

    What did Bryce say at 1:06:06?!
    Also, great talk. Especially the inclusivity / ergonomics part. I've done C++ for years and now transitioned to Rust, and I'm doing way more complex things, significantly faster.

    • @paulosantana9607
      @paulosantana9607 2 ปีที่แล้ว

      Bryce said something about needing different people somewhere, I can't tell exactly where, but it sounds like MIT lol
      "Well maybe we need different people at the MIT then"

    • @pmcgee003
      @pmcgee003 2 ปีที่แล้ว

      @@paulosantana9607 basically in the standards committee/s

  • @oraqlle
    @oraqlle 2 ปีที่แล้ว

    Is there a C++ WG21 ergonomics group being created or no in the works of doing so?

    • @andreicirstea8517
      @andreicirstea8517 2 ปีที่แล้ว +3

      Even if it were you wouldn't get much out of it. C++ committies are so inefficient. Game developers have asked for reflection since 2000's but are left hanging to this day. The situation is so bad that for my own game engine I had to basically create a macro parser that would go through my files and create reflection types.

  • @kuhluhOG
    @kuhluhOG 9 หลายเดือนก่อน

    21:36 You know, default is already a keyword. So why not just use that?

  • @jonasPlatte
    @jonasPlatte 2 ปีที่แล้ว +3

    Poor Raph Levien, people always get his name wrong 😅

  • @ConceptInternals
    @ConceptInternals 11 หลายเดือนก่อน

    1:01:17
    We have to decide what we wanna focus on. It could be **what's the word he said here?**

  • @niklkelbon3662
    @niklkelbon3662 ปีที่แล้ว

    We dont need variant in language.
    We need syntax for creating a visitor.
    Something like overload set-lambda with better syntax

  • @paulmoore7964
    @paulmoore7964 8 หลายเดือนก่อน

    '_' is not a wild card. It means 'i dont need the data' , rust will complain is you do not use a variable unless it starts with _

  • @boffo25
    @boffo25 ปีที่แล้ว

    What is the difference between pattern matching and a switch case?
    If you assign the enum as const you have the same behavior.

    • @mishaerementchouk
      @mishaerementchouk ปีที่แล้ว +6

      Switch works only with integral types. Pattern matching has a wider scope.

  • @jimhewes7507
    @jimhewes7507 ปีที่แล้ว +3

    Will C++ become a legacy language?
    Relevant to this might be Herb Sutter's talk on "Can C++ be 10x Simpler & Safer?" released after this video was released. Worth watching.
    th-cam.com/video/ELeZAKCN4tY/w-d-xo.html
    He points out how the first C++ "compilers" were actually translators (e.g. Cfront) that translated C++ into C and then compiled the output with a C compiler. (I remember those days.) Maybe a newer C++ can do something similar while staying backward compatible.

  • @a314
    @a314 2 ปีที่แล้ว +1

    All these features are in #DLang since 2010

  • @khuiification
    @khuiification ปีที่แล้ว +3

    Terrible audience lol. Dont have to agree with everythinf but sheesh, let the guy talk

  • @DerDoMeN
    @DerDoMeN 2 ปีที่แล้ว

    I like the ideas but pretty pretty pretty please could we get a C++ version without attributes?
    I went through that Java attribute hell and I don't want to see that repeated in C++ again...
    I like the functionalities presented but if they'll be ported to C++ with attributes I'll call them not-worth-it no matter what.

    • @isitanos
      @isitanos ปีที่แล้ว +1

      Too late, C++ has attributes like [[nodiscard]].

  • @Baptistetriple0
    @Baptistetriple0 11 หลายเดือนก่อน +1

    the guy was exposing cool feature from another language that he would like to see in cpp because that's what you do when you like something, you try to improveit. and every comment of the audience was "hu you can do that in cpp, it's just very ugly and super not easy but you can, so I don't see the point" or other dumb questions like "how do you opt out?" bro that's not the point, the point is that feature is cool, how it is implemented is irrelevant

  • @cataclysmwarshulduar
    @cataclysmwarshulduar 2 ปีที่แล้ว +9

    I feel like C++ should have stuck with C++14 and then just create better tooling/infrastructure around it. The simple truth is that C++XX will never, ever, ever get as ergonomic as a modern language because it carries lots of baggage. There's simply no reconciling that. Instead, what happens is that we have something like std::variant that just feels half-assed and no one ends up really using it. It just feels bad to use compared to ADTs. Perhaps there should a frontend for C++17 like Carbon/Circle and innovate there instead of trying to wrangle 40 years of evolution into 1 coherent language.

    • @dagoberttrump9290
      @dagoberttrump9290 2 ปีที่แล้ว +1

      I like variants whats wrong with them?

    • @LyubomyrSemkiv
      @LyubomyrSemkiv 2 ปีที่แล้ว

      I almost hate variants but just don’t have alternative and use all the time.

  • @binary132
    @binary132 7 หลายเดือนก่อน

    It’s funny that he mentioned “community” as a Rust language feature he’d like to have in C++.
    Rust’s community is incredibly dysfunctional. That is a major reason I avoid Rust and prefer C++.

  • @simonfarre4907
    @simonfarre4907 ปีที่แล้ว +4

    Rust is just a modern programming language. It picked up the torch of what C++ really aimed to do, with it's c++11-14 and going forward. C++ was looking really, really promising last decade on it's ambitions. By the end of the 2010's, it became apparent that the steam, just had ran out. It's now just adding things nobody wants instead, taking _forever_ for the basic things, like std::format, std::print.
    I mean for christs sake, Andrei was a proponent of static if for the longest and having something akin to what D does. C++ template meta programming _isn't_ good and never will be, since it just massively *explodes* compile times. It's terrible and everybody agrees that it's terrible. It's unfortunate.

  • @OlaInTheClouds
    @OlaInTheClouds 2 ปีที่แล้ว +1

    Finally, Rust arguments not focusing on stuff nobody who know c++ would ever do. But I'm fine with C++ thanks. Interesting

  • @andremaha
    @andremaha ปีที่แล้ว +4

    Well, the audience is the prime reason C++ is going away. Just look at Linux kernel being rewritten in Rust.

  • @perghosh8135
    @perghosh8135 ปีที่แล้ว +1

    C/C++ differs from other languages ​​as it is about writing assembler code without having to write assembler. Other languages do not work like that, they are more tools/libraries used to work with existing functionality. This talk was only a prof of that, C++ should not try to mimic rust, instead - if you want rust then write libraries in C++ that makes c++ look like rust.

    • @heruhday
      @heruhday ปีที่แล้ว

      Rust has inline assembly for x86 , x86-64, ARM, AArch6 , RISC-V, LoongArc.
      Ex:
      use std::arch::asm;
      // Multiply x by 6 using shifts and adds
      let mut x: u64 = 4;
      unsafe {
      asm!(
      "mov {tmp}, {x}",
      "shl {tmp}, 1",
      "shl {x}, 2",
      "add {x}, {tmp}",
      x = inout(reg) x,
      tmp = out(reg) _,
      );
      }
      assert_eq!(x, 4 * 6);

  • @italoaugustooliveira9664
    @italoaugustooliveira9664 ปีที่แล้ว +2

    The pedantry of the audience is so annoying.

  • @firexgodx980
    @firexgodx980 ปีที่แล้ว +4

    1:07:15 "If you don't care about inclusivity for beginners, beginners aren't going to care about your language". This is so true. The first time I touched C++ and tried to import the math library, only to find out you have to add the -m as a compiler flag, I knew C++ was a terribly designed language. Because if such a simple ergonomic issue like that hasn't been fixed yet, what else is broken? I used it for 6 months after that, learned about all the other ridiculous ergonomic issues and never touched that clown fiesta of a language again.

  • @isitanos
    @isitanos ปีที่แล้ว

    Nice to see an inclusivity discussion that's actually practical and aimed at including the masses instead of being just about giving in to demands from extremely marginal and polarized groups that are blind to anything except their own issues. The worry being that any working group founded will need to keep its focus on those goals or it risks being hijacked and polluted by those selfish and unsavory folks.

  • @ABaumstumpf
    @ABaumstumpf 2 ปีที่แล้ว +1

    C++ pattern matching...........
    The current approaches seem so stupid. Don't introduce new keywords for an extension of existing behaviour. There is no reason to not just use the good old switch-case for this as that is already doing EXACTLY what we want to be more generic.
    Mailing-lists and IRC... the benefit of those is the vast history they have, their simplicity, reliability and ubiquity.
    Github is a company, discord is a company. They might fail at any moment, they might insert their own ideology at any moment. I am really not a fan of mailing-lists but they just work.

  • @abdulshabazz8597
    @abdulshabazz8597 2 ปีที่แล้ว +4

    Rust features I want in my C++ is like Tesla Model 3 features I want in my Ford Mustang GT.

    • @szymoniak75
      @szymoniak75 10 หลายเดือนก่อน

      meh, not really. Your Ford Mustang probably doesn't have a "press this for 2% extra engine power but risk violently exploding" button

  • @metaltyphoon
    @metaltyphoon ปีที่แล้ว +1

    What a horrible audience. Just keep ur questions or comments to the end.

  • @DerDoMeN
    @DerDoMeN 2 ปีที่แล้ว +1

    Inclusivity is a double way road that is unfortunately quite these days often not taken by people that wish to be included... There's always the talk about including new new-bee members and random people but from my experience there are two types of people (yes generalising to just include the extremes as the rest - non extreme people - are more often than not a minority and not problematic):
    1. the ones that are far too arrogant to even consider they're in wrong and look at the things from the opposing view (or even better 3-10 of the valid opposing views)
    2. people that are really willing to get included, have an open mind and admit when they're in lack of knowledge/understanding
    Oddly enough the second group is in my experience the minority in programming world and are in my experience the only ones that do fit well and are the ones that should be included.
    Community is a messed up thing these days...

    • @AG-ld6rv
      @AG-ld6rv ปีที่แล้ว +1

      If I understand your points, I agree. The fact is different programming languages are harder/easier to use, and C++ is one of the hardest. Not only do the abstractions tend to remain in contact with the metal, you have to figure out which ones you want to pay for and which ones are too slow for your use case. Additionally, the language has some of the heaviest baggage out of any other language out there (e.g. supporting almost all of C even now). It might seem like there's an elitist club, but the reality is writing very good C++ (especially a library programmer or someone who does super high performance computing like for a trading firm) is some of the most challenging coding a person can get into. As a point of contrast, something like C# or Java removes tons of options, making it far easier to reason about and use (but also its best performance is around 2-5 times slower than tuned C++ code on average).

  • @AbuAl7sn1
    @AbuAl7sn1 ปีที่แล้ว

    9:07
    easily you can use shadowing
    let mut c = color::Red
    let c = 3

  • @ultimatesoup
    @ultimatesoup ปีที่แล้ว

    C++ is still superior to rust though. Constexpr, consteval, constinit and their if counterparts are more powerful. Operator overloading to create nice dsl and syntactic sugar, postfix literal overloading, variardic templates, etc. I could go on and on about why cpp is better overall, but that's not to say their aren't nice features in rust I'd like to see

    • @pierreollivier1
      @pierreollivier1 10 หลายเดือนก่อน

      I don't know Rust but I'm positive it's better than Cpp, Cpp is a very bad language, It's only used because well that's what everyone get taught at uni, and it's a performant language, but poor ergonomic, terrible standard, the tooling is especially atrocious. Compiler errors are terrible, unhelpful and it's slow to compile, Rust or Zig seems to be way more promising candidate than C++ and It's not going to change anytime soon as the people from the standard are really bad at their job too adding 50 ways of doing the same bloody thing in a more and more non intuitive way, just for 95% of developers to straight up ignore it.

    • @indiesigi7807
      @indiesigi7807 9 หลายเดือนก่อน

      @@pierreollivier1 Well then don't use it? It's the greatest language ever imo.

  • @ddddddddd345
    @ddddddddd345 2 ปีที่แล้ว +27

    Good talk, but the effort is too little too late. Whoever cares is already writing Rust instead of hoping that C++30 is going to be half as good as Rust is today. And self selection guarantees that people that stick around are of the old mindset and will keep the language on the current trajectory.
    Writing any new code in C++ instead of Rust is a malpractice. Maintaining a legacy codebase will increasingly be just a well paid niche, like Cobol is today.

    • @nono1271
      @nono1271 2 ปีที่แล้ว +3

      Rust is very much not a productive language with tons of half-baked features. Affine types alone isn't really an appealing pro over other languages with atrocious compile times and things being always broken anyway.

    • @raymundhofmann7661
      @raymundhofmann7661 2 ปีที่แล้ว +6

      AI was supposed to be as capable as a three year old kid over 50 years ago, and still AI cars need a human driver to supervise it and crash with too many fatalities. Rust is like AI. Grandiose claims by rust activists like you and miserable failure, plus a few useful ideas that will be picked up by what is successful.

    • @Cons-Cat
      @Cons-Cat 2 ปีที่แล้ว +1

      C++ is _today_ a far far more powerful metaprogramming language than Rust, or any other systems level language for that matter. Rust needs to adopt more of C++, at least in-place construction. It's baffling that Rust still doesn't have that feature after years and multiple RFCs.

    • @piotrarturklos
      @piotrarturklos 2 ปีที่แล้ว +2

      It's not malpractice. Rust is good for some things, for other things Rust is a meh solution and C++ is awesome.

  • @pastasawce
    @pastasawce 10 หลายเดือนก่อน

    Worst questions ever from audience

  • @davidvernon3119
    @davidvernon3119 ปีที่แล้ว +1

    Do we really need to add another damn thing to c++. It’s time has passed. Why copy rust features into C++ when you can just migrate to rust?

  • @pedromiguelareias
    @pedromiguelareias ปีที่แล้ว +4

    Rust is another «belle de jour» soon to age dramatically.

    • @xvnz
      @xvnz ปีที่แล้ว +3

      a good question after "will c++ inevitably be legacy?" would have been "will it outlive rust?"

    • @indiesigi7807
      @indiesigi7807 9 หลายเดือนก่อน

      @@xvnz I kinda hope so. My skills will become even more valuable. Go rust!

  • @WilhelmDrake
    @WilhelmDrake ปีที่แล้ว

    It seems whenever there is talk about inclusivity, it's always limited to including other people of privilege.
    It's never about including poor people.

    • @isitanos
      @isitanos ปีที่แล้ว +1

      Not sure what you're getting at. To be proficient at systems programming (which is what C++ and Rust target) you need to be literate and trained in logic and maths, algorithmy, computer hardware fundamentals, and so on, so you pretty much need to have access to higher education.
      Even in so-called "privileged" countries there's a lot of illiteracy that would need to be addressed first, and then you get into sociology because a lot of the communities concerned have a deep-seated resistance to richer people trying to push education on them. At this point we've veered completely off-topic for this kind of talk, no sure what you were expecting exactly but it was obviously not realistic.

  • @haystackdmilith
    @haystackdmilith 2 ปีที่แล้ว +11

    Sorry mate, but what you say is gibberish. Memory safety issues is a known to be over 80% of all SIGSEGVs, crashes, and later exploits and CVEs… I boil inside seeing you say "It's not that big deal".

    • @stavinke
      @stavinke 2 ปีที่แล้ว +5

      Do you mind saying which point is gibberish? The whole thing? You boil inside? Go outside and touch some grass my guy, relax

    • @mapron1
      @mapron1 2 ปีที่แล้ว +8

      I agree with him. Of all segfaults and memory bugs in my carreer I found 0 issues with C++ 'oh this variable referenced twice'. That kind of issue is really not a big deal.

    • @galchinsky
      @galchinsky 2 ปีที่แล้ว +7

      80% of sigsegvs is 90s style code with C arrays without any automatic bounds checking even in debug build. It's not about modern c++ and modern c++ programmers

    • @mutuka
      @mutuka 2 ปีที่แล้ว

      Use Rust then...

    • @brianmorin7022
      @brianmorin7022 2 ปีที่แล้ว

      @@mapron1 It's not a big deal up until the day it is. Or it's the underlying cause of a compute process having a shelf life before it either dies in a non-obvious way or needs a reboot. Give the sorts of systems the worlds needs us to build in cars, medial equipment, utilities, etc. having memory safety as a core feature is super-important.

  • @lalishansh
    @lalishansh ปีที่แล้ว

    I Don't like where this is going. I Love C and C++, C is very easy to understand, it helps understand machine, there language, C++ builds some essentials and extends it.
    about "std::variant" though it would look cool to use variant keyword, i won't like that because it adds a data member hidden away doing some special stuff.
    "match" may look like "switch" statement but it dosen't (isn't) seem that way. Also we are mixing compile-time behavior with runtime behavior. I can
    predict what belongs to runtime behavior and compile time behavior when it comes to C++, `where you draw the line in rust`. how can these things be allowed ?
    Creating Examples from comments is good idea though and C++ pre-processor especially needs work to be done but thats different than meta-programming.
    i rather set my bet on this than modifying C++.
    th-cam.com/video/ELeZAKCN4tY/w-d-xo.html
    an interpreter for a language that builds up on C++ or even C, that's what C++ has always been at-least for me.

    • @mikeharry1799
      @mikeharry1799 ปีที่แล้ว +2

      That talk is really damning of C++ IMHO. It's become so complex that you'd only let a machine use it. It has all these powerful concepts and abstractions, but you need a cleaner language to translate from. And just the other day there was a paper (co-authored by Bjarne) which stated that it would never happen, because it's a different dialect, and it would never make it in to the standard.

  • @unduloid
    @unduloid ปีที่แล้ว

    C++ features I want in Rust: Inheritance.

  • @user-zq8bt6hv9k
    @user-zq8bt6hv9k 2 ปีที่แล้ว +19

    Unfortunately rust is a woke language with multiple half baked features, lots of good idea though

    • @skellious
      @skellious 2 ปีที่แล้ว +10

      strange choice of phrase. what does woke mean to you?

    • @cysia3683
      @cysia3683 2 ปีที่แล้ว +6

      > multiple half baked features
      any example?

    • @raymundhofmann7661
      @raymundhofmann7661 2 ปีที่แล้ว

      And it seems to have an army of shills outnumbering productive users by a factor of 10 to 100.

    • @KohuGaly
      @KohuGaly 2 ปีที่แล้ว +4

      @@cysia3683 Off the top of my head I can name a few:
      async rust. The end goal is that the standard library will define the common api for all the async-related stuff. All the async code, libraries and runtimes become generic over each other and be mutually compatible.
      The reality is, the type system is nowhere near even making such stabilization possible, due to several key features (GATs, generators, HKTs, specialization, async traits...). The ecosystem is fractured as fuck, the mutual compatibility is nonexistent. Unless you're on the happy path, your async code will eat your soul with problems that are currently impossible to solve with stable features.
      Const evaluation. It's really half baked, and in most cases unusable (yet).
      SIMD.
      Interfacing with exceptions is non-existent.
      Dynamic linking of generics.
      This is just stuff that needs language support directly to even exist. There are major gaps in the ecosystem too.

    • @Gabriel-nj3iw
      @Gabriel-nj3iw 2 ปีที่แล้ว +3

      @@cysia3683 async

  • @MrAbrazildo
    @MrAbrazildo ปีที่แล้ว

    25:20, because it's verbose and slow. Of course a macro is much better.
    1:09:35, are you crazy, people?! The best language becoming legacy?! WTF?!

  • @ShanyGolan
    @ShanyGolan ปีที่แล้ว +1

    C++, please disappear. All hail rust.

  • @michah3956
    @michah3956 2 ปีที่แล้ว +2

    Rust is the best programing Lang.

    • @cthutu
      @cthutu 2 ปีที่แล้ว +1

      Depends what you're doing but I agree it's the best systems programming language today.