Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for "C++20" modules #4314

Closed
gdelazzari opened this issue Oct 2, 2018 · 6 comments
Closed

Support for "C++20" modules #4314

gdelazzari opened this issue Oct 2, 2018 · 6 comments

Comments

@gdelazzari
Copy link

gdelazzari commented Oct 2, 2018

I was wondering if there's someone else interested (or even working) on a first implementation to support the upcoming C++20 modules (not sure if they're actually part of the upcoming C++20, but seems like so). Clang is already supporting some of the syntax and stuff, I can actually compile a module and a program that imports it using such a Makefile:

program: program.cpp stuff.pcm
	clang++ -fmodules-ts -std=c++17 -fmodule-file=stuff.pcm -o program program.cpp stuff.pcm

stuff.pcm: stuff.cppm
	clang++ -fmodules-ts -std=c++17 --precompile -o stuff.pcm stuff.cppm

with import stuff; in program.cpp and export statements in stuff.cppm.

As you can see by the Makefile it's a bit cumbersome to manually handle the compilation. I know this is not yet a final implementation/feature, but I think it's something it would be cool to experiment with for small projects. A build system like Meson handling it would be amazing, build times should also improve (that's one of the promoted reasons for modules in C++).

Is there anyone else interested or someone that wants to share its opinion?

@jpakkane
Copy link
Member

jpakkane commented Oct 2, 2018

We are in the process of writing a paper to the next C++ standardisation meeting about this issue and about the changes we would like to see in the syntax (the current one makes it really hard to implement). Thus it is our hope that the user interface of modules will change so using dev cycles to add support for something that will be changed does not seem like the best use of our limited resources.

@gdelazzari
Copy link
Author

Thanks for the information. If I may ask, what's the problem with the current syntax/what syntax would be better? I mean, what are your points?

@jpakkane
Copy link
Member

jpakkane commented Oct 2, 2018

The tl/dr version is that the model as currently defined does the same thing as FORTRAN, which is a nightmare to support in a build system.

@GunpowderGuy
Copy link

GunpowderGuy commented Mar 29, 2019

@jpakkane any updates ? has c++'s module system proposal already been stabilized ?

@GunpowderGuy
Copy link

GunpowderGuy commented Apr 7, 2019

there is an ongoing discussion at
#5024

@dcbaker
Copy link
Member

dcbaker commented Apr 9, 2019

I'm going to go ahead and close this so we can keep all of the modules discussion in the other issue.

@dcbaker dcbaker closed this as completed Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants