Earlier quoted context omitted.
Newer stuff yes and it is great. However from basic rendering to browsers and the most complex applications (CAD, office software, finance, complex solvers like airline planning) are still in C++. Nobody will accept rewriting 35+ years of history. C++ code bases are really a lot longer-lived than any other software builds upon them. Hence we cannot drop it. Starting with C++17, I think committee has been doing the la…
I understand and empathize with your fear. C++23 added a type with 22 constructors ( http://en.cppreference.com/w/cpp/utility/expected/expected.h... ), that ought to be enough to strike fear into anyone.
What to do with C++ modules?
191–200 of 269 posts
Re: What to do with C++ modules?
#192Earlier quoted context omitted.
Not sure why you are getting downvoted, but this alone would make me switch (Still waiting for Qt moc support): > No more weird forward declarations We c++ devs just have collectively accepted that this hack is still totally ok in the year 2025, just to improve build times.
The only thing that forward declaration buys you is avoiding to include a header, which is not that expensive in C, but thanks to templates something as innocent as including a header can become infinitely expensive in C++.
Re: What to do with C++ modules?
#193Earlier quoted context omitted.
I understand and empathize with your fear. C++23 added a type with 22 constructors ( http://en.cppreference.com/w/cpp/utility/expected/expected.h... ), that ought to be enough to strike fear into anyone.
Don't worry, C++25 will deprecate half of them and C++27 will remove them while adding 20 new ones just to be deprecated in C++30.
Re: What to do with C++ modules?
#194Earlier quoted context omitted.
Don't worry, C++25 will deprecate half of them and C++27 will remove them while adding 20 new ones just to be deprecated in C++30.
C++ standard and deprecation is a contradiction. They almost never deprecate things. Things always go more complex.
https://en.cppreference.com/w/cpp/locale/codecvt_utf8.html
https://en.cppreference.com/w/cpp/algorithm/random_shuffle.h...
Re: What to do with C++ modules?
#195Earlier quoted context omitted.
ccache speeds up compilation of single files by quite a lot, by effectively avoiding unnecessary recompilation. There are distributed caches that work like ccache too. Compiling a file for a second or fiftieth time with no changes because of doing a clean build is the absolute most common case. Maybe zapcc does additional caching of compiler internal state, but I would have to look into it to see if it's actually goo…
I have a cpp file that takes 10 seconds to compile. I change one line. How does ccache help me in this case?
Re: What to do with C++ modules?
#196Earlier quoted context omitted.
That was my point — with LLMs the progress would not be at the same slope as with people only.
Have there been any successful attempts yet of translating 'idiomatic' C++ to 'idiomatic' Rust for a large codebase that has been developed over 30 years? What does the output look like? Does the code look maintainable (because mechanical solutions to translate from other languages into Rust exist, the result is just not what a human would write or ever want to work on). Are the prompts to guide the LLM shorter than…
Re: What to do with C++ modules?
#197Earlier quoted context omitted.
Why should anyone use zapcc instead of ccache? It certainly sounds expensive to save all compiler's internal data, if that is what it does. I'm sure you must be aware, these compiler tools do not constitute a language innovation. I'd also imagine that both are not productions ready in any sense, and would be very difficult to debug if they were not working correctly.
Why should anyone eat apples instead of oranges? ccache doesn't add anything over make for a single project build.
Re: What to do with C++ modules?
#198Earlier quoted context omitted.
ccache speeds up compilation of single files by quite a lot, by effectively avoiding unnecessary recompilation. There are distributed caches that work like ccache too. Compiling a file for a second or fiftieth time with no changes because of doing a clean build is the absolute most common case. Maybe zapcc does additional caching of compiler internal state, but I would have to look into it to see if it's actually goo…
ccache does not speed up compilation at all, in fact it slows it down. It only speeds up re-compilation of the same translation unit (as in, bitwise identical preprocessed source code) which is often not all that useful, especially when the local development rebuild use case is already covered by make.
Re: What to do with C++ modules?
#199Earlier quoted context omitted.
What do you mean by "no context can leak into it"? Do you mean it shouldn't export transitive imports? As in `#include ` also performs `#include ` but `import vector` would only import vector, requiring you to `import iterator`, if you wanted to assign `vec.begin()` to a variable? Or is it more like it shouldn't matter in which order you do an import and that preprocessor directives in an importing file shouldn't aff…
Not GP, but I take it to mean I can’t do: #define private public #import // muahaha Or any such nonsense. Nothing I define with the preprocessor before importing something should effect how that something is interpreted, which means not just #define’s, but import ordering too. (Importing a before b should be the same as importing b before a.) Probably tons of other minutiae, but “not leaking context into the import”…
you define #import as "include but no context leaks into it" and that should on its own be enough to let the compiler just, compile that file once and reuse it wherever else its imported. That's like 95% of the benefit of what modules offered but much much simpler
Re: What to do with C++ modules?
#200Earlier quoted context omitted.
ccache works at a translation unit level which means it isn't any better than just make-style incremental rebuilds when you aren't throwing away the build directory - it still needs to rebuild the whole translation unit from scratch if a single line in some header changes.
> ccache works at a translation unit level which means it isn't any better than just make-style incremental rebuilds when you aren't throwing away the build directory You used many words just so say "ccache is a build cache". > it still needs to rebuild the whole translation unit from scratch if a single line in some header changes. You are using many words to say "ccache rebuilds a translation unit when it changes".…
Frankly your attitude in this whole thread has been very condescending. Being condescending and also not understanding what you're talking about is a really bad combination. Reconsider whether your commenting style is consistent with the HN guidelines, please.