cppfront module syntax? #1126
Replies: 2 comments 2 replies
-
This seems to be a hot question! In short, module syntax in cppfront hasn't been enabled yet, because Herb is waiting for its support to be solidified across compilers (that is, to simply lower |
Beta Was this translation helpful? Give feedback.
-
I think cppfront should implement its own module syntax and then let developers choose the transpilation result through configuration. If the compiler doesn't support modules or the environment can't use modules, then cppfront could be configured to generate headers. |
Beta Was this translation helpful? Give feedback.
-
Does cppfront have any plans for modules?
I found that the existing examples of cppfront still use header files (*.h2). I think cppfront should focus on modules instead of using header files.
Even though mainstream compilers(like clang, gcc) don't fully support C++ modules yet, cppfront is like TypeScript for JavaScript, where the code gets transpiled into cpp code.
So, is it possible that after a cpp2 module is transpiled to cpp, it becomes a header file and a translation unit?
Just like this:
---------------------- cpp2 module ----------------------------
after transpiled
---------------------- cpp1 header -------------------------------
---------------------- cpp1 file ------------------------------------
This way, cppfront would have its own modules and wouldn't need to worry about whether the C++ compiler supports modules or not.
Beta Was this translation helpful? Give feedback.
All reactions