Skip to content

Bootstrap C++ compiler and restore Python reference tests - #19

Closed
ewanc26 wants to merge 20 commits into
mainfrom
codex/numlang-cpp-bootstrap-v4
Closed

ewanc26 wants to merge 20 commits into
mainfrom
codex/numlang-cpp-bootstrap-v4

Conversation

@ewanc26

@ewanc26 ewanc26 commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

This continues the C++ migration as a buildable C++20 compiler for an explicitly scoped core subset, rather than claiming the full language is already ported.

  • Adds the numlangc C++20 CLI and C source generation for numeric/character/string literals, core arithmetic/comparison/math/bitwise operations, numbered variables, basic console I/O, and runtime stack checks.
  • Fails with diagnostics for known structural/runtime opcodes that are not implemented in the C++ port.
  • Restores the previous Python compiler package as a reference implementation and adds its existing unit suite to CTest.
  • Adds C++ CLI smoke tests for hello-world, arithmetic, numbered variables, hexadecimal/binary literals, integer suffixes, malformed numeric diagnostics, unsupported-opcode diagnostics, output generation, missing source files, and paths with spaces/apostrophes.
  • Hardens numeric parsing for malformed binary/octal values, invalid integer suffixes, range errors, and large finite floating-point literals.
  • Emits string literals with length-aware fwrite and fixed-width NUL escapes, preserving embedded NUL bytes even when followed by decimal digits; adds an end-to-end regression test.
  • Makes bitwise and integer remainder opcodes use checked 32-bit conversions, portable signed right-shift behavior, defined 32-bit left-shift results, and diagnostics for out-of-range values, invalid shift counts, and remainder overflow. Smoke tests cover XOR, signed right shift, left-shift bit patterns, invalid shift counts, out-of-range operands, and remainder overflow.
  • Corrects README, contributor guidance, CI, compiler-status documentation, and the shared capability matrix so unported Numlang, Selenium, and Sigi features are not marked fully implemented by their current C++ compilers.

Verification

The earlier revision passed GitHub Actions (run 40241216285): CMake configure/build, the C++ CLI smoke suite, restored Python reference tests, and the capability-matrix checker. The latest numeric and bitwise safety changes are committed to this PR branch, but no CI run is currently visible for the active PR head, so those new cases are not yet verified in CI.

The C++ port still does not cover control-flow blocks, arrays, FFI, named functions/variables, or the broader C-like type system. See issue #16 for the remaining parity work.

Superseded: this branch diverged from the current main branch. The relevant new fixes have been ported to the current base in PR #20.

@ewanc26 ewanc26 closed this Oct 26, 2026
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.

1 participant