Skip to content

Latest commit

 

History

History
177 lines (161 loc) · 4.57 KB

File metadata and controls

177 lines (161 loc) · 4.57 KB

Python68K Final Implementation Checklist

Phase 0 - Bootstrap

  • Repository skeleton created
  • Host build (GCC/Clang) working
  • Amiga build (vbcc) working
  • -cpu=68000 -fpu=0 enforced
  • Platform abstraction layer implemented
  • Tracked allocator implemented
  • Type-width assertions implemented
  • python -V implemented
  • python --help implemented
  • Zero warnings in debug builds
  • Allocator tests passing

Phase 1 - Tokenizer

  • Token definitions complete
  • Integer literals
  • String literals
  • Identifier parsing
  • Comment handling
  • NEWLINE generation
  • INDENT generation
  • DEDENT generation
  • Tab rejection in indentation
  • Line/column tracking
  • EOF token generation
  • Tokenizer test suite passing

Phase 2 - Parser & AST

  • AST arena allocator implemented
  • Pratt expression parser implemented
  • Statement parser implemented
  • Operator precedence verified
  • Function parsing implemented
  • Loop parsing implemented
  • Slice parsing implemented
  • Grammar compliance tests passing

Phase 3 - Symbol Analysis

  • Function prepass implemented
  • Duplicate parameter detection
  • Local slot assignment
  • UNBOUND local support
  • Global name classification
  • Builtin resolution order implemented
  • Context validation (return/break/continue)

Phase 4 - Bytecode Compiler

  • Constant pool implementation
  • Name table implementation
  • String interning
  • FNV-1a hashing
  • Opcode metadata generation
  • Branch patching
  • Function code generation
  • Control-flow code generation
  • Short-circuit logic generation

Phase 5 - Bytecode Verification

  • Instruction boundary validation
  • Branch validation
  • Index validation
  • Stack-depth validation
  • CFG traversal implemented
  • Maximum stack calculation
  • Malformed bytecode rejection

Phase 6 - Runtime Values

  • Reference-counted objects
  • String object
  • List object
  • Function object
  • Native function object
  • Ownership rules implemented
  • Retain/release APIs implemented
  • Leak detection tests passing

Phase 7 - VM Core

  • Value stack implemented
  • Frame stack implemented
  • Global table implemented
  • Builtin table implemented
  • Opcode dispatch loop implemented
  • Error propagation implemented
  • Full VM unwind implemented
  • Traceback support implemented

Phase 8 - Arithmetic Semantics

  • Checked add
  • Checked subtract
  • Checked multiply
  • Checked negate
  • Python floor division semantics
  • Python modulo semantics
  • Overflow tests passing

Phase 9 - Strings, Lists, Range

  • String concatenation
  • String slicing
  • String indexing
  • List append
  • List pop
  • List indexing
  • List assignment
  • Range implementation
  • Cycle detection for lists

Phase 10 - Functions

  • Parameter passing
  • Local variables
  • Recursion
  • Explicit return
  • Implicit None return
  • Call validation

Phase 11 - Builtins

  • print
  • len
  • range
  • int
  • str
  • bool
  • abs
  • min
  • max
  • list_append
  • list_pop
  • exit
  • time
  • sleep
  • ctime
  • localtime
  • strftime
  • perf_counter

Phase 12 - AmigaDOS Integration

  • Script execution
  • -c execution
  • argv support
  • Synchronous os.system command execution
  • os.popen PIPE: output capture verified on Amiga
  • File APIs
  • Environment APIs
  • Exit-code mapping
  • Memory stats output

Quality Gates

  • No memory leaks (full make test suite run under ASan/UBSan, zero findings)
  • All unit tests pass
  • All negative tests pass
  • All differential tests pass
  • Allocation-failure tests pass
  • Host debug build passes
  • Host release build passes
  • Amiga debug build passes
  • Amiga release build passes
  • Executes on emulator
  • Executes on real 68000 hardware

MVP Acceptance

  • python script.py works
  • python -c works
  • Bytecode VM executes code
  • Functions work
  • Recursion works
  • Strings work
  • Lists work
  • Tracebacks work
  • Unsupported syntax rejected cleanly
  • No 68020 instructions present
  • No FPU required
  • Documentation complete
  • Language Level 0.1 frozen

Future / post-0.6

  • CPython-style open (option 1): open() + file.read()/write()/close(), limited keyword args for encoding='utf-8' (accept/ignore), FileNotFoundError, keep fopen as alias; driver: examples/wordcount.py