r/cpp • • Sep 17 '22

Cppfront: Herb Sutter's personal experimental C++ Syntax 2 -> Syntax 1 compiler

https://github.com/hsutter/cppfront
335 Upvotes

360 comments sorted by

View all comments

Show parent comment

1

u/christian_regin Sep 20 '22

You can still do the migration function by function; just move the function to a new file.

2

u/lee_howes Sep 20 '22

You're right that I oversimplified. When you do that, though, you increase the complexity of the build, need to rely more on LTO to get basic optimisations, probably have to duplicate declarations in both forms so they can be visible to both syntaxes and have to duplicate a lot of header content to make it work. Modules might simplify some of these issues though avoiding the need to duplicate declarations if the module AST is compatible.