Skip to content

v2.2.0 — Memory Consolidation: Cell Wrapping, Tape Persistence, Output Redirection#8

Merged
nullhack merged 1 commit into
mainfrom
feature/v2.2.0-memory-consolidation
May 3, 2026
Merged

v2.2.0 — Memory Consolidation: Cell Wrapping, Tape Persistence, Output Redirection#8
nullhack merged 1 commit into
mainfrom
feature/v2.2.0-memory-consolidation

Conversation

@nullhack
Copy link
Copy Markdown
Owner

@nullhack nullhack commented May 3, 2026

Summary

  • Cell wrapping: Fixes 8-bit unsigned wrapping (0-255) in both JIT and interpreted execution paths — programs like LostKingdom.b that rely on wrapping now work correctly
  • Tape persistence: save_tape()/load_tape() methods serialize/deserialize tape state to JSON for checkpointing and resuming programs
  • CLI flags: --output FILE redirects BF output, --dump FILE saves tape state after execution, --load FILE restores tape state before execution
  • REPL commands: quit/exit to leave REPL, save [FILE] to dump tape state
  • Output redirection: output_file parameter on execute() for programmatic output capture
  • EOF handling: EOFError in _read_input_direct() and _read_value() now returns -1 instead of crashing

Test plan

  • 60/60 tests pass (36 original + 24 new)
  • New tests: tests/unit/test_persistence_and_wrapping.py (17 tests), tests/features/cli-flags/cli_test.py (7 tests)
  • Verified clean install from wheel: Hello World, library imports, all CLI flags, cell wrapping, save/load roundtrip
  • LostKingdom.b runs and produces intro text with cell wrapping fix

…redirection

- Fix cell wrapping to 8-bit unsigned (0-255) in both JIT and interpreted paths
- Add save_tape()/load_tape() methods for JSON tape state serialization
- Add --output FILE, --dump FILE, --load FILE CLI flags
- Add output_file parameter to execute() for redirecting BF output
- Add REPL quit/exit/save commands
- Fix EOFError handling in _read_input_direct() and _read_value()
- Add 24 new tests (persistence, wrapping, CLI flags)
- Update docs: CHANGELOG, README, system.md, technical_design.md, branding.md
@nullhack nullhack merged commit d2e68ec into main May 3, 2026
@nullhack nullhack deleted the feature/v2.2.0-memory-consolidation branch May 3, 2026 13:04
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