How byusistudio/code-cin works
Code CIN is a CIN/PL/ASM language toolchain and cross-platform virtual machine. A user submits source or an existing binary/image through the Python CLI; it compiles or assembles the input, then runs it through the Go native VM by default, with Python interpretation and JIT paths also available. The graph includes the documented CROM/AOT, debugging and profiling branches, plus host graphics and audio capabilities. README documents the major workflows; sampled source confirms selected compiler, VM and debugger behavior, but not every integration link.
Main entry points: cpu.py Python CPU · cli.py Python CLI · isa.py Instruction set · system.go Host system calls
Components 21
Front ends
- Python CLI
codecin/cli.py - CIN compiler
codecin/cin.py - Go CIN compiler
codecin/native/compiler/codegen.go - PL/ASM assembler
codecin/assembler.py - Disassembler
codecin/disasm.py - Instruction set
codecin/isa.py
Execution runtime
- CROM format
codecin/crom.py - AOT compiler
codecin/aot.py - Python CPU
codecin/cpu.py - JIT engine
codecin/jit.py - Native bridge
codecin/native.py - Go VM
codecin/native/engine/vm.go - Memory system
codecin/memory.py - LRU cache
codecin/cache.py
Debug and analysis
- Interactive debugger
codecin/debugger.py - Execution statistics
codecin/stats.py
Host capabilities
- Audio playback
codecin/native/engine/audio.go - 2D canvas
codecin/native/engine/canvas.go - Host system calls
codecin/native/engine/system.go
Other components
- Program user
- Program output
Connections 25
- Program user → Python CLI: runs input
- Python CLI → CIN compiler: compiles CIN
- Python CLI → Go CIN compiler: selects native compile
- Python CLI → PL/ASM assembler: assembles PL/ASM
- CIN compiler → Instruction set: emits instructions
- Go CIN compiler → Instruction set: emits instructions
- PL/ASM assembler → Instruction set: encodes instructions
- Python CLI → CROM format: loads or saves
- CROM format → Python CLI: provides program image
- Python CLI → AOT compiler: requests static build
- Python CLI → Python CPU: runs interpreter
- Python CPU → Native bridge: invokes native VM
- Native bridge → Go VM: passes bytecode and memory
- Python CPU → JIT engine: dispatches hot blocks
- Python CPU → Memory system: reads and writes
- Python CPU → LRU cache: records memory accesses
- Python CPU → Execution statistics: records execution
- Python CPU → Interactive debugger: supports debug session
- Interactive debugger → Python CPU: steps and inspects
- Go VM → Host system calls: dispatches SYS calls
- Host system calls → Audio playback: plays audio
- Host system calls → 2D canvas: draws and exports
- Python CPU → Program output: produces output
- Python CLI → Disassembler: disassembles program
- Disassembler → Instruction set: decodes instructions