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

Plans for C++ modules i.e cpp20/23? #1

Open
ar-visions opened this issue Apr 10, 2023 · 1 comment
Open

Plans for C++ modules i.e cpp20/23? #1

ar-visions opened this issue Apr 10, 2023 · 1 comment

Comments

@ar-visions
Copy link

ar-visions commented Apr 10, 2023

I am currently working with clang and msvc which seem to both differ in their implementation of cpp20/23. Do you plan on implementing modules? a reasonable hypothesis would be if someone could do this to C99, it would alleviate compatibility issues by reducing the compilation process differences between platforms with little to no performance loss, and greater understanding and control of mapping the operations. Do you have any plans for this, or am I missing something feature-wise? I can help if needed on your roadmap.

@KevOrr
Copy link
Owner

KevOrr commented May 26, 2023

Hi @ar-visions! Sorry I let this slip through my notifications. I haven't tested this approach with C++ modules, though it would be very interesting to see if it can be made to work.

Just a word of caution:

alleviate compatibility issues by reducing the compilation process differences between platforms

I mostly created this project on a bet that writing a C++ to C transpiler would be an extremely involved process. At the time, I was using inline assembly a lot for another project, so I had the idea to utilize that to "transpile" a C++ program by first actually compiling it and then including that assembly in a stub C program. As you can see, the core of C++-- is a 66-line Python file, and the core of that is simply a call to g++. So this project produces extremely unportable C code.

cmd = ['g++', '-S', *gpp_options, '-o', tmpout, *map(str, sources)]
subprocess.check_call(cmd)

However, if it really does turn out to be useful in some way, that would be awesome!

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