Originally posted by coder
View Post
Announcement
Collapse
No announcement yet.
Coroutines & Modules Added For C++20
Collapse
X
-
Originally posted by Ananace View PostFrom how I understand modules to work, it is left up to the compiler to pass the necessary information (AST etc) between modules where necessary, instead of being the job of the preprocessor - which just naively inlines the entire header and all its includes.
Skipping the preprocessor here speeds up compiling immensely as you no longer need to parse headers more than once between correctly built modules, but you still get full visibility into the definition, just as an AST or other compiler-friendly datastructure.
Comment
-
Originally posted by klapaucius View PostWhat is this exactly? I couldn't find or I missed any mention of it in Herb Sutter's post.
http://www.open-std.org/jtc1/sc22/wg...8/p0668r4.html
I do wonder how much ARM's improved energy efficiency vs. x86 derives from its looser memory consistency model.
I know GPUs benefit greatly from relaxed memory consistency, but it means you can't do things like instruction-level traps.Last edited by coder; 24 February 2019, 05:24 AM.
- 3 likes
Comment
-
Originally posted by klapaucius View Post
What is this exactly? I couldn't find or I missed any mention of it in Herb Sutter's post.
I would guess this is referenced, but I haven been through the report yet
- 2 likes
Comment
-
So now the culprit are the buildsystems to support modules.- build2 is already preparing for/supporting the std modules
- CMake supposedly will leverage from its Fortram support (https://gitlab.kitware.com/cmake/cmake/issues/18355)
- Meson is so far bus writing papers how impossible this is (https://github.com/mesonbuild/meson/issues/4314)
- 1 like
Comment
-
Originally posted by discordian View PostHope they collectively get their s..tuff together in time, and we wont end up with some broken concept in '20.
We will have a large problem at work where some of our compilers will remain old for our legacy requirements, and some will be c++20 one day. It is going to seriously complicate the build system having to use modules for some projects and traditional headers/libs for another.
Originally posted by dwagner View PostI certainly do not like every programming paradigm that has made it into the C++ standard, but the great thing about C++ is that it does not force you to follow one particular paradigm
Last edited by kpedersen; 24 February 2019, 08:23 AM.
- 5 likes
Comment
-
Originally posted by coder View PostThis is why a lot of people use abstract interface classes or the PImpl pattern.
Originally posted by coder View PostWell, C started out life as portable substitute for assembly language. C++ built on it, with the idea that you don't want to pay for features you're not using. That leaves the door open to C-level (or even asm-level) performance, if you're careful. Once you start to dispense with that principle, there's one less argument to use C++.
Originally posted by coder View PostI don't imagine even modules can let you instantiate a type without visibility into its definition, including those of all its type dependencies.
Comment
-
Originally posted by coder View PostSure, but I was responding to atomsymbol 's complaint that the compiler needs to know the types of members in classes you want to use. Whether it's by including a header or importing a module, many uses of classes will still require this visibility.- Accessing a T's field directly
- Calling a function/method/constructor/destructor which uses the inline keyword and accesses a T's field
- Instantiating T on the stack - although after some though this still does not require the knowledge of T's fields, just the knowledge of T's size and alignment
- Static variables of type T - although after some though this still does not require the knowledge of T's fields, just the knowledge of T's size and alignment
For template classes, the use cases are still just 1 and 2.
Comment
-
For those wondering about the current C++20 state in the GCC compiler can see this status matrix as well as the Clang status.
They have a webpage:
Visual C++ Language Conformance
https://docs.microsoft.com/en-us/cpp...ge-conformance
- 1 like
Comment
Comment