How betteriutinfoaix/algocompiler works
AlgoCompiler is a Rust implementation of the IUT Aix algorithmic language, offering direct execution and Python generation through both a CLI and a browser playground. The principal workflow reads source, tokenizes it, parses an AST, then either interprets the program or generates Python. The graph also shows the browser’s WASM-facing bridge and shared diagnostics. The bridge implementation was not excerpted, so its connections to the runtime backends are marked unverified.
Main entry points: parser/mod.rs Parser · main.rs CLI file entry · lexer/mod.rs Tokenizer · lib.rs WASM bridge
Components 12
User interfaces
- CLI file entry
AlgoCompiler/src/main.rs - Playground UI
playground/app.js - WASM bridge
playground/src/lib.rs
Language front end
- Tokenizer
AlgoCompiler/src/lexer/mod.rs - Tokens and spans
AlgoCompiler/src/lexer/token.rs - Parser
AlgoCompiler/src/parser/mod.rs - Program AST
AlgoCompiler/src/parser/ast.rs
Execution and generation
- Interpreter
AlgoCompiler/src/interp.rs - Python generator
AlgoCompiler/src/codegen/python.rs
Shared support
- Compile diagnostics
AlgoCompiler/src/errors.rs
Other components
- CLI user
- Playground user
Connections 16
- CLI user → CLI file entry: provides file
AlgoCompiler/src/main.rs - CLI file entry → Tokenizer: tokenizes source
AlgoCompiler/src/main.rs - CLI file entry → Parser: parses tokens
AlgoCompiler/src/main.rs - CLI file entry → Python generator: generates Python
AlgoCompiler/src/main.rs - Playground user → Playground UI: enters program
README.md - Playground UI → WASM bridge: calls WASM exports
playground/app.js - WASM bridge → Interpreter: runs program
- WASM bridge → Python generator: compiles Python
- Tokenizer → Tokens and spans: emits tokens
AlgoCompiler/src/lexer/mod.rs - Parser → Tokenizer: consumes tokens
AlgoCompiler/src/parser/mod.rs - Parser → Program AST: builds AST
AlgoCompiler/src/parser/mod.rs - Tokenizer → Compile diagnostics: reports errors
AlgoCompiler/src/lexer/mod.rs - Parser → Compile diagnostics: reports errors
AlgoCompiler/src/parser/mod.rs - CLI file entry → Compile diagnostics: renders errors
AlgoCompiler/src/main.rs - Interpreter → Parser: uses program AST
AlgoCompiler/src/interp.rs - Python generator → Parser: uses program AST
AlgoCompiler/src/codegen/python.rs