CppCon 2017: Ben Deane & Jason Turner “constexpr ALL the Things!”

Поділитися
Вставка
  • Опубліковано 18 гру 2024

КОМЕНТАРІ • 38

  • @jankodedic3130
    @jankodedic3130 7 років тому +96

    Great talk by Ben and JSON, as always!

  • @henke37
    @henke37 7 років тому +113

    "There was a misunderstanding between me and the compiler".

    • @meow75714
      @meow75714 3 роки тому

      How polite of him to address Mr. Compiler like that.
      For rest of us compiler is a real bitch.

  • @dipi71
    @dipi71 7 років тому +55

    Just when I thought I had a grip on C++ … well done, guys. ((slow-clap))

    • @OperationDarkside
      @OperationDarkside 7 років тому +12

      Kinda rethorical question: Do you ever?

    • @WorldWideWebWisdom
      @WorldWideWebWisdom 3 роки тому +6

      @@OperationDarkside 3 years later, I can confidently tell you that you never do.

  • @arthur.passos
    @arthur.passos 5 років тому +24

    "Jason" just talked about how we actually represent "Jason" values

  • @cc.jsullivan
    @cc.jsullivan 7 років тому +9

    wow, this really is constexpr all the things

  • @connorhorman
    @connorhorman 6 років тому +9

    I’ve done all of SHA2 in constexpr, and I’ve even written a program that Randomly decides when it wants to compile.

  • @odedkadshai
    @odedkadshai 4 роки тому +1

    a milestone lecture. well done!

  • @hanneshauptmann
    @hanneshauptmann 7 років тому +1

    great talk by deane and jason, as always !

  • @JosefdeJoanelli
    @JosefdeJoanelli 3 роки тому +1

    "constexpra" tripped me up every time

    • @TheMR-777
      @TheMR-777 2 роки тому +1

      @Mercer “constant expression” can be any constant expression
      “constexpr” is a 'term', which also mean functions, and methods, which evaluate on compile time

  • @prezadent1
    @prezadent1 7 років тому +8

    Great talk by Bean and Freddie, as is the norm.
    I don't know whats going on either. I just try to fit in.

  • @xamidi
    @xamidi 4 роки тому

    The code on slide 20 (at 12:20) is not part of the github project and doesn't seem to compile.. Nothing of cx_map.h seems to be used in the project. When I comment all its content out and remove its import into cx_json_value.h, the project still compiles?! Whenever I try to use cx::map, it gives an error "no type named 'type' in 'struct std::enable_if'". (Tried with GCC 7.2.0 as they claimed to use - concrete distribution: MinGW-w64 x86_64-7.2.0-release-posix-seh-rt_v5-rev1.)

  • @alcesmir
    @alcesmir 6 років тому +1

    33:45 Isn't that essentially zipWith in haskell?

  • @intvnut
    @intvnut 7 років тому +1

    Did anyone else catch The Prisoner reference at 51:38?

  • @bsuperbrain
    @bsuperbrain 7 років тому +1

    Is this the same talk from 2016?

  • @OperationDarkside
    @OperationDarkside 7 років тому +24

    "You can clearly see..." -> No I can not, lol
    Nonetheless, awesome

    • @AM-qx3bq
      @AM-qx3bq 4 роки тому +2

      That's functional syntax for parsing a string key to the value of your reaction. Nice.

  • @yomoma6692
    @yomoma6692 7 років тому +1

    So much usefull knawledge. :D

  • @outsider1st
    @outsider1st 7 років тому +8

    Wtf are those comments on every vid ;o

  • @aDifferentJT
    @aDifferentJT 3 роки тому

    combine is liftA2

  • @nmmm2000
    @nmmm2000 7 років тому +3

    bit disappointing to see old Jason video in new clothes. Where I can see the source code of this?

  • @connorhorman
    @connorhorman 6 років тому +9

    Next stop, Lua constexpr implementation.

  • @robbie_
    @robbie_ 6 років тому +4

    OK, this is just a fun thing to do isn't it (and interesting), but totally impractical. Would be faster/better to write a simple console app to parse json into a C++ structure, running it as a pre-build step.

    • @homomorphic
      @homomorphic 6 років тому +9

      Nope, this isn't just a fun thing to do, it is extremely useful. As is obvious from the talk constexpr still isn't quite ready for prime-time, but when it is it will be extremely useful. It looks like it is getting close, I am guessing that by C++20 it will dripping with awesomeness.

    • @TheFlynCow
      @TheFlynCow 5 років тому +3

      minimizing the steps and dependencies of your build system is key.

  • @Runoratsu
    @Runoratsu 6 років тому +5

    It's very impressive, but honestly? a) You can't debug it properly, really, and thus it's VERY hard to use in an environment with multiple people having to be able to read and understand the code, and b) as soon as your code base grows past a few 100k loc this "bit of compile time overhead" will drive everyone insane (if we assume a relatively constant percentage of constexpr code to runtime code). It's nice to speed up your runtime side, but if every recompile takes (literally!) hours, you can't work on the code base productively anymore.

    • @homomorphic
      @homomorphic 6 років тому +4

      What in this video leads you to believe that this would substantially increase compile time? I think that Ben and Jason made the point that other than debug builds (which is likely due to symbol emission) that compile time and compile time memory usage are not significantly impacted.

    • @VioletGiraffe
      @VioletGiraffe 6 років тому +1

      100k LOC doesn't nearly take an hour, though. More like 2.5 minutes for a full recompile (which you should only need very rarely). /DEBUG:FASTLINK will give you much better productivity than reducing code complexity in the interest of compilation time.

  • @simgesonmez3508
    @simgesonmez3508 3 роки тому +2

    It's out of topic but why always guys??
    I want to see more women on the stage any more especially in this discipline.
    By the way, congrats guys, great talk :)

    • @muhdiversity7409
      @muhdiversity7409 11 місяців тому +4

      Why don't you start? Who exactly is stopping you?