How pervognsen/bitwise works
This repository is an educational systems-programming project whose implemented software centers on the Ion C-like language compiler and Rattle, a Python hardware-description toolkit. The Ion workflow starts at its command-line entry point and compiles source through lexical, syntactic, semantic, and code-generation responsibilities; system packages and RISC-V language sources provide notable language and target capabilities. Rattle provides bit-level circuit construction, with tutorial examples. The sampled evidence establishes Ion’s amalgamated module composition and Rattle’s tutorial/helper references, but not all internal stage calls, so those links are omitted.
Main entry points: main.c Ion entry point · rattle.py Circuit construction · rattle_extras.py Circuit utilities · tutorial.py Circuit examples
Components 18
Ion Frontend
- Ion entry point
ion/main.c - CLI and OS
ion/os.c - Lexer
ion/lex.c - Parser
ion/parse.c - AST construction
ion/ast.c
Ion Compiler Core
- Type system
ion/type.c - Semantic resolver
ion/resolve.c - C code generator
ion/gen.c - Compiler runtime
ion/ion.c - Target configuration
ion/targets.c - Shared utilities
ion/common.c
Ion Language Assets
- System packages
ion/system_packages - RISC-V sources
ion/riscv - Noir language source
noir/noir/noir.ion
Rattle HDL
- Circuit construction
rattle/rattle.py - Circuit utilities
rattle/rattle_extras.py - Circuit examples
rattle/tutorial.py
Other components
- Compiler user
Connections 13
- Compiler user → Ion entry point: invokes
README.md - Ion entry point → Compiler runtime: calls
ion/main.c - Ion entry point → CLI and OS: includes
ion/main.c - Ion entry point → Lexer: includes
ion/main.c - Ion entry point → Parser: includes
ion/main.c - Ion entry point → AST construction: includes
ion/main.c - Ion entry point → Type system: includes
ion/main.c - Ion entry point → Semantic resolver: includes
ion/main.c - Ion entry point → C code generator: includes
ion/main.c - Ion entry point → Target configuration: includes
ion/main.c - Ion entry point → Shared utilities: includes
ion/main.c - Circuit examples → Circuit construction: imports
rattle/tutorial.py - Circuit utilities → Circuit construction: imports
rattle/rattle_extras.py