12 ms·
My (Herb Sutter's) C++ Now 2023 talk is online: “A TypeScript for C++”
- ladberg 3y agoI kinda feel like this is DOA until modules are more widespread. Any new cppfront code in an existing C++ codebase can't include any existing header files which automatically excludes it from any C++ codebase I've worked on (or any I expect to in the next few years) without a significant amount of developer time spent making the migration to modules-only. Would love to try it out though when that happens, I do hope that modules will eventually get mainstream enough to make cppfront viable.
- 38 3y agomy issue with C/C++ code bases in 2023, is the same issue from 2013 and 2003: tooling. With Go, I can download any random code from at least 2018, and do this: go build and it just works. all the needed packages are automatically downloaded and built, and fast. same process for Rust and even Python to an extent. my understanding is C++ has never had a process like this, and its up to each developer to streamline this process on their own. if thats no longer the case, I am happy to hear it. I worked on C/C++ code for years, and at least 1/3 of my development time was wasted on tooling and build issues. I dont ever want to deal with that again.
- sharts 3y agoDocker?
- 38 3y agothanks for the valuable contribution to the conversation.
- davikr 3y agosounds like a golden opportunity for c++next, whatever that will be: cppfront, circle? to standardize on a single building and package management solution.
- 0cf8612b2e1e 3y agoTooling is but one reason I hope Rust eats C/C++ lunch. I think everyone has some story of banging their head against an asinine build process. I am certainly sick of ./configure, make build, huge wait, and then a missing libXYZ error, install XYZ, repeat, missing libABC.
- FpUser 3y ago>" I think everyone has some story of banging their head against an asinine build process" Not my case. I have simple CMake files for my projects and have no problems building on Linux and Windows (I do not do Mac). I do use few libraries (Postgres, network - http/tcp/udp and some others). So far no troubles. I do remember it was way more complicated though. So I am not really missing "Rust eating C++'s lunch". I do understand there are some real life huge insanely complex projects with basillion options. Luckily I do not havbe to deal with that part.
- shric 3y agoCMake doesn't fetch your dependencies for you and ensure they're the version that your code is compatible with. I've cloned 5 year old C++ repos that use cmake and it's quite an effort to build them, mostly due to finding all the dependencies correctly versioed.
- FpUser 3y agoI do not want it to fetch dependencies. I download those once and include it as a copy per project. Update on on-need basis. Over the years I have accumulated enough. To start new project all I have to do is - clone template directory and I am ready to go.
- neeeeees 3y ago> CMake doesn't fetch your dependencies for you and ensure they're the version that your code is compatible with. That’s a little too harsh. You can certainly make it do that via a combination of git tags (to build from source) and CMake modules/Find*, but yes, it’s much more cumbersome than cargo/npm/go
- bluGill 3y agoThat is great for simple projects, but a real toolchain for c++ needs to handle complex real world code. That means you have a mix of FORTRAN, ada, c, rust, some custom internal corporate language, and so on all mixed with the C++. If your build system cannot handle that mess i'm not interested
- spkm 3y ago> That means you have a mix of FORTRAN, ada, c, rust, some custom internal corporate language, and so on all mixed with the C++. If your build system cannot handle that mess i'm not interested In that case I would just use the rust toolchain which I'm sure can handle this stew.
- tasogare 3y ago./configure, make, make install have been more reliable than any pip install I had to deal with. I read about a C++ package manager written by Microsoft few years ago, maybe it's now somewhat usable?
- BatFastard 3y agovcpkg? Its pretty handy. Not like cargo, but better then what existed before.
- johannes1234321 3y agoThat errors out when a library is missing, Soni figure out where to get it, how to install it and rerun configure, just to see something else is missing. And that then leads to a version conflict and then I mess.... only works well for projects with few dependencies and especially no uncommon dependencies.
- kwertyoowiyop 3y agoThe C++ standards group should treat this problem as a high priority. If they define something reasonable, we can gradually migrate code to it.
- not_the_fda 3y agoNever going to happen. The standards group doesn't define the tooling. Every vendor has its own set compiler flags, error messages and ABI. Its also used on architectures where the target hardware has to be complied for on a completely different architecture, i.e. embedded devices. Its too complex of a problem to be solved by a committee with competing interests.
- steveklabnik 3y agoNever say never, there is P2656. We'll see! It's more about making things interoperable than mandating a new tool, but it's still something useful in this space. It also links to previous work. https://github.com/cplusplus/papers/issues/1323 https://github.com/cplusplus/papers/issues/1323
- galkk 3y agoTotally agree. So far the best thing that I've seen in wildlife for c/c++ code is just outsourcing everything into docker container with build tools, that you have with qmk: https://docs.qmk.fm/#/getting_started_docker https://docs.qmk.fm/#/getting_started_docker. It has it's downsides, but it's just 2 commands to have built binary, one of which is to clone git repository. I really had high hopes for Bazel, that they will either package or reuse some standard build tools configurations and just let use them by referencing them in single place in workspace, and the rest is going to handled by build system, but it doesn't seems like this is how it does work now and will work in observable future. If you want it this hermetic, you need to do it on your own.
- psyclobe 3y agoI remember trying to use go, it certainly wasn't that easy, the go folder was a really confounding concept. I think they got rid of that though (been a while).
- TillE 3y agoThe C++ community has de facto standardized on CMake, which solves half the problem. It's not pretty, but it gets the job done. Dependencies can mostly be managed with vcpkg and its CMake integration. The only real problem is when you need something that's not in vcpkg and have to write your own port overlay. It's not perfect, but the situation is vastly better than it was ten years ago.
- ansgri 3y agoThere’s also Conan which supposedly solves all problems, but we weren’t successful at migrating a large CMake project to it. Maybe if you use it from very beginning, it would work.
- tw37074462 3y ago/r/titlegore
- Animats 3y agoIs there a text summary of this? 90 minutes of talking is too much.
- Scramblejams 3y agoSorta, if you scroll down the page.
- smitty1e 3y agoGood speakers survive playing at 1.5X
- dkarl 3y agoI feel conflicted about this. I find that the best speakers live are dynamic in their speaking rate: sometimes slow, sometimes rapid-fire. It really helps with the pacing of a talk, and there's something about being transfixed in person and giving over a block of your life to the speaker. It feels sacred, even if it's a mediocre talk. However, when watching or listening to recorded talks, I prefer a consistent speaking rate so I can choose an optimal speed.
- Animats 3y agoThat's just an index.
- rnikander 3y agoI still can't use C++20 modules with a macOS app (Clang). I tried, and compile times balloon 10-30x on some files. Maybe I should give up and try Rust. Does Rust give you _maximum_ control over performance the way C and C++ do? I need that and that's I why I used C++ in the first place.
- lenkite 3y agoOnly if you dance around the baggage of the borrow checker and restructure your performant data-structures to use integer indices. Thats all how most Rust DS libs do this - get rid of references and replace them with integer pointers.
- carbotaniuman 3y agoIt depends on what you mean by maximum performance. In general Rust is pretty fast, but safety checks do cause slow down, and even with the unsafe escape hatch there are code patterns and use cases Rust currently can't address that well.
- steveklabnik 3y ago> Does Rust give you _maximum_ control over performance the way C and C++ do? Yes, with a small asterisk. In general, this is true. In practice, with the way optimizations go, sometimes one or the other may be faster. Or people playing with definitions. But the answer to your question in spirit is "yes."
- pjmlp 3y agoA side effect from Apple nowadays caring more about Swift than contributing to clang. https://www.kitware.com/import-cmake-c20-modules/ https://www.kitware.com/import-cmake-c20-modules/
- rnikander 3y agoI want to do cross platform native C++ dev. Maybe I should switch to Microsoft-land. I've been using a MacBook for years. I see Visual Studio docs talking about C++ cross-platform mobile (iOS, Android), but nothing about desktop (eg, Linux, macOS). I suspect Visual Studio on Windows works better than what I've been using – VS Code or Emacs with clangd, which sometimes runs amok, takes 20GB of RAM, and kills my laptop.
- richdougherty 3y agoAnother interesting C++ successor language: https://github.com/carbon-language/carbon-lang https://github.com/carbon-language/carbon-lang
- mepian 3y agoAnd another one is Hylo, formerly Val: https://www.hylo-lang.org/ https://www.hylo-lang.org/ The CppCon talk: https://www.youtube.com/watch?v=ws-Z8xKbP4w https://www.youtube.com/watch?v=ws-Z8xKbP4w
- elcritch 3y agoI've used Nim as a C/C++ "successor" language too with its new default memory management in the 2.0 release. It's handy to interface with opencv or other C++ code bases: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma https://nim-lang.org/docs/manual.html#implementation-specifi...
- 29athrowaway 3y agoAn experimental attempt for this already exists https://github.com/carbon-language/carbon-lang https://github.com/carbon-language/carbon-lang https://compiler-explorer.com/ https://compiler-explorer.com/ (pick Carbon)
- schaefer 3y agoI watched this entire talk a couple days ago. As a life long C++ native Software Engineer, cppfront/cpp2 is one of the few efforts in c++ that interest me these days. I am also the hiring manager for our teams, and it's shocking that applicants that proudly include c++20 on their resumes but can not answer the intentionally open-ended question: Tell me about std::move(). IMO: If c++ is to thrive, it is in desperate need of the "10x simpler and safer" vision that is at the core of cppfront.
- zabzonk 3y agosure, people should be able to say what std::move does (basically nothing) but people asking the questions need to be aware of what they are asking about - most c++ programmers are not writing library code.
- deleted 3y ago[deleted]
- schaefer 3y agozabzonk, thank you for raising this point and the discussion it teases out. std::move is nothing but a cast - but it means that means that for every new class, we should be actively considering if a move constructor is appropriate for that class. The consequences of a missing move constructor would be calling the copy constructor... pretty dry stuff I agree. about as exciting as discussing pass by value or pass by reference... but for certain domains of programming (embedded), just as critical. Nicolai M. Josuttis , a 20 year veteran of the standards committee, can be quoted as saying "Move semantics, introduced with C++11, has become a hallmark of modern C++ programming." [1] But if we take a step back and consider the broader picture I think of "the average language proficiency of the team" as being a very real pressure. If the complexity of the code base creeps above the average proficiency of the team, the health of the code base struggles. So, here's the thing. As a hiring manager for embedded products, If I can't get applicants that know about std::move(), then the scope of the c++ language has outpaced it's own talent pool, and something like cppfront becomes all the more critical. [1]: http://www.cppmove.com/ http://www.cppmove.com/
- zackees 3y ago[dead]
- ksherlock 3y agoSince this language is moving further away from C, I suggest they update the name to reflect that: pp.
- binary132 3y ago#
- pjmlp 3y agoFrom all wannabe C++ replacements candidates, the only language that is really a TypeScript for C++, is Circle. For whatever reason, Herb Sutter decided to ignore this language on the presentation. https://www.circle-lang.org/ https://www.circle-lang.org/ This is the only one with the syntax based on C++, incrementally changing the features via #pragma settings. "Circle Fixes Defects, Makes C++ Language Safer & More Productive" https://www.youtube.com/watch?v=x7fxeNqSK2k https://www.youtube.com/watch?v=x7fxeNqSK2k "Circle Evolves C++" https://www.youtube.com/watch?v=P1ZDOGDMNLM https://www.youtube.com/watch?v=P1ZDOGDMNLM
- alexeiz 3y agoCircle is irrelevant because it's closed source. It's been out there since 2019(?) and never gained any adoption or mind share among C++ developers. I've looked at it back when it first appeared, and it seemed interesting, but why would I spend any time on it when the creator of the language can lose interest tomorrow and shut down the project for good? There is no reason to devote any time or effort to a closed source project when plenty of interesting open source projects exist.
- pjmlp 3y agoGuess what, besides clang and GCC, all the other C++ compilers are closed source and are doing just fine.
- alexeiz 3y agoI wouldn't use a closed source C++ compilers either. But with C++ compilers, if one is abandoned, you can switch to another. With Circle, there is nothing else. The best outcome the Circle author can hope for (and this is likely the purpose of the project) is that some company either buys it, or hires him to work on Circle full time. Circle benefits only one guy, it doesn't benefit the C++ community.
- binary132 3y agomaybe because it’s not in the commons