Skip to content

Harden Numlang string output and integer opcodes - #20

Merged
ewanc26 merged 10 commits into
mainfrom
codex/numlang-cpp-safety-v5
Oct 26, 2026
Merged

ewanc26 merged 10 commits into
mainfrom
codex/numlang-cpp-safety-v5

Conversation

@ewanc26

@ewanc26 ewanc26 commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

This is a narrow follow-up against the current main branch for two correctness issues in the C++ bootstrap compiler.

  • Emits string literals with length-aware fwrite and fixed-width NUL escapes, preserving embedded NUL bytes even when followed by decimal digits.
  • 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.
  • Adds end-to-end smoke tests for embedded-NUL output, XOR, signed right shift, left-shift bit patterns, invalid shift counts, out-of-range operands, and remainder overflow.
  • Updates the README and compiler-status document to describe the verified behavior without claiming full Numlang parity.

Verification

The build and Python reference suite passed in CI, but the new embedded-NUL regression initially exposed test-fixture escaping and newline-expectation errors. Those issues are corrected. The next CI run caught an opcode-number collision in the invalid-shift fixture (32 is an opcode, so the test now uses 32.0); the corrected fixture is committed and awaits CI.

The broader C++ port remains a scoped subset. Control-flow opcodes, arrays, FFI, named functions/variables, and the broader C-like type system remain tracked in issue #16.

@ewanc26
ewanc26 merged commit 0e4ab3c into main Oct 26, 2026
1 check passed
@ewanc26
ewanc26 deleted the codex/numlang-cpp-safety-v5 branch October 26, 2026 04:49
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