Skip to content

Upgrade C++ Backend #384

Draft
ShawSumma wants to merge 9 commits intomainfrom
be-cpp
Draft

Upgrade C++ Backend #384
ShawSumma wants to merge 9 commits intomainfrom
be-cpp

Conversation

@ShawSumma
Copy link
Copy Markdown
Contributor

This gets the C++11 backend to a state that is able to run significant chunks of temper code. I've added it to the default backends too

ShawSumma and others added 4 commits March 15, 2026 12:29
Signed-off-by: Shaw Summa <shawsumma@gmail.com>
Signed-off-by: Shaw Summa <shawsumma@gmail.com>
- Fix cross-TU static initialization order fiasco by generating module
  init functions with dependency init calls and static bool guards
- For modules without init blocks, defer variable initializations to
  init function for guaranteed cross-TU ordering
- For modules with init blocks, keep struct-constructor pattern to
  preserve separate stack frames (avoids [&] lambda capture issues)
- Add DepInit struct at beginning of each TU to trigger init function
- Add regex runtime stubs in core.hpp (compileFormatted, compiledFound,
  compiledFind, compiledReplace, compiledSplit, pushCaptureName, pushCodeTo)
- Add polymorphic eq/ne overloads for mixed shared_ptr types
- Remove Regex::format connected reference (use generated formatter)
- Update snapshot test for new init function pattern

Fixes typesJsonSyntaxTree test (70/75 now passing, up from 69/75).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Shaw Summa <shawsumma@gmail.com>
Signed-off-by: Shaw Summa <shawsumma@gmail.com>
Copy link
Copy Markdown
Contributor

@tjpalmer tjpalmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the latest cpp work was previously under cppv, which is also used in the external c++03 backend. The cppv backend also has support specifically for c++23 and other things also, so we probably should correlate plans before merging this or anything else on c++.

tjpalmer and others added 5 commits March 23, 2026 05:59
Signed-off-by: Tom <tom@temper.systems>
Signed-off-by: Tom <tom@temper.systems>
Signed-off-by: Tom <tom@temper.systems>
Signed-off-by: Tom <tom@temper.systems>
- Main goal here is let the be-cpp pr be merged sooner than later
- I've still only done a quick skim on all the new code, especially in
translator and in core.hpp, but I didn't see anything outright evil in
the skim
@tjpalmer
Copy link
Copy Markdown
Contributor

@ShawSumma Looks like main needs merged in before it will try running ci tests. Maybe worth doing before applying your other changes? I haven't run full tests, so I'm curious if it passes.

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

Successfully merging this pull request may close these issues.

2 participants