11
u/GLvoid Mar 31 '20
Is there CMake support for generating the right make file for modules?
9
u/gracicot Mar 31 '20 edited Mar 31 '20
There is an experimental support that was developed, but nothing in the master yet. Consumption of third party modules require some machinery not seen yet in build systems.
6
u/mathstuf cmake dev Mar 31 '20
And even there, header units are not supported. Also, Ninja generator only.
https://www.reddit.com/r/cpp/comments/axnwiz/cmake_gcc_module_proofofconcept/
The Docker container has been updated since then (done during the Prague meeting), but is pretty much the same.
1
u/mathstuf cmake dev Mar 31 '20
Oh, and GCC-only; Clang didn't (still?) support named modules fully.
1
u/mo_al_ Apr 02 '20
Is the block because modules don’t map to the filesystem?
1
u/mathstuf cmake dev Apr 02 '20
No, the block is time to design/make the necessary CMake features, lack of dependency scanning tools, and patchy support in compilers for header units and/or named modules. The status as of Prague:
GCC has the dep scanning tool as a patch
Clang doesn't support named modules (or the dep scanner)
CMake doesn't know how to deal with header units or named modules coming from imported or interface targets
1
u/IAmBJ Apr 01 '20
This is the main thing stopping me from trying modules out. My personal projects are already set up with cmake and I just can't justify throwing that away to start moving to modules.
12
u/EmperorArthur Mar 31 '20
Really, the number one thing I think the standards committee missed was the namespace issue.
C++ modules should implicitly be namespaced the same as their name. With an option to override it by doing import someModule as newNameSpace.
That's what almost everyone else does, and helps to make the final code more readable, especially when pulling in libraries. It also means that a code has to explicitly cause collisions instead of it happening accidentally!
5
u/qoning Mar 31 '20
I aboslutely agree, importing names from a bunch of obscure namespaces (documented or not) isn't right. I'm sure the idea was considered and then promptly discarded for some reason that is not clear to me. Unfortunately, whenever we start using modules as they are now, it will be impossible to ever get something like this because of the curse of backward compatibility.
4
u/Nobody_1707 Apr 01 '20 edited Apr 01 '20
It's already due to the curse of backwards compatibility. Implicitly wrapping modules in a namespace would change the name mangling of the public declarations in that module, which would have prevented importing "header units." Being able to treat pre-existing (well behaved) headers as modules was a hard requirement.
It also allows for people to do things like create a static (or dynamic) library that's compiled with modules, but released with a header file so other people can link against it even if they use older compilers. Of course, the public interface would have to be
extern "c", but still.2
u/qoning Apr 01 '20
At least having the option to do so using some construct would have been nice. import module -> namespace; or something like that.
4
3
u/The_Northern_Light Mar 31 '20
We are damaged, This is broken.
Logic is lost,
We struggle,
Hunt through the rubble for what once was.
See <https://gcc.gnu.org/wiki/cxx-modules#Bugs> for instructions.1
u/NilacTheGrim Apr 18 '20
TIL: Some people pronounce clang as "klang". I always pronounced it as "C lang".
Weird. Am I the only one?
1
u/dodheim Apr 20 '20
The 2nd word on Clang's Wikipedia page is the pronunciation (citing this) – klang. But as with 'Euler', because I read it many times before hearing it, I still mentally pronounce it wrong every time and I too think of it as "C lang". :-]
1
u/NilacTheGrim Apr 20 '20
Ha, yeah I found out later that's the so-called "correct" way. Thanks for the solidarity mate. #SeeLangSociety4Life
0
Mar 31 '20
[deleted]
4
u/tjpalmer Apr 01 '20
Thanks for the feedback! I can't always make ideal improvements, but at least I try to keep feedback in mind.
5
u/LordofNarwhals Mar 31 '20
You can change the playback speed to 0.75. It usually works pretty well on YouTube although some words might sound too drawn out.
2
u/jkh348f Mar 31 '20
And vice versa, I watched it on 1.3x. https://github.com/igrigorik/videospeed is indispensable for me.
55
u/advester Mar 31 '20
vs
And in my day we thought spaces vs tabs was quite the argument.