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

Don't use .mpp extension for non modules #19

Open
RedBeard0531 opened this issue Jul 22, 2019 · 3 comments
Open

Don't use .mpp extension for non modules #19

RedBeard0531 opened this issue Jul 22, 2019 · 3 comments

Comments

@RedBeard0531
Copy link

RedBeard0531 commented Jul 22, 2019

Ideally you wouldn't use that extension at all because clang silently doesn't emit object files for it, requiring -x c++. But if you think that is important, at the very least it should only be done for actual modules. https://github.com/mathstuf/cxx-modules-sandbox/blob/master/link-use/use.mpp is particularly incorrect because currently main() isn't allowed to be defined inside of a module.

@mathstuf
Copy link
Owner

I'm partial to the "extensions don't matter too much" view because it's all C++ code and the build system can't trust any of it until it scans the code anyways. At that point, we know what kind it is and we can just add whatever flags are necessary to make it be accepted. Sure, assumptions about the code based on the extension are fine, but they shouldn't be pre-destined because of it. If someone really wants to put C++ code into a .js file, I'm not going to question their life choices :) .

@RedBeard0531
Copy link
Author

I agree with your viewpoint at a high level. How about renaming everything to .cpp? Build systems should be able to handle that.

My issue was with simultaneously introducing a new extension to distinguish modular code from non modular (which I agree is of questionable utility), and also using the modular extension for non modular code. It feels contradictory.

@mathstuf
Copy link
Owner

It was needed for build2 support since it requires such an extension. FWIW, it started off as .cpp in the beginning :) .

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

2 participants