How aswinsilver/aphelion works
Aphelion is a C11 language implementation whose main workflow takes .agne source through lexing, parsing, semantic checking, bytecode compilation, and execution in a stack VM; the CLI also exposes inspection, checking, and bytecode-file operations. Source modules and compiled-in ACSL cryptography extend programs through summon, while the REPL compiles and runs individual input lines. README statements establish the compiler pipeline and product capabilities; sampled source and the SOURCE INDEX support several implementation links, but not every runtime call is visible in the excerpts.
Main entry points: main.c CLI commands · acsl.c Native registry · parser.c AST parser · compiler.c Bytecode compiler
Components 20
Language front end
- Lexer
src/lexer.c - AST parser
src/parser.c - AST model
src/ast.c - Type checker
src/semantic.c - Bytecode compiler
src/compiler.c
Bytecode runtime
- Bytecode format
src/bytecode.c - Stack VM
src/vm.c - Runtime values
src/value.c
Modules and native APIs
- Source module loader
src/module.c - Native registry
src/acsl.c - Hash and HMAC
src/acsl_hash.c - Authenticated cipher
src/acsl_cipher.c - Key derivation
src/acsl_key.c - Secure randomness
src/acsl_random.c
User interfaces
- CLI commands
src/main.c - One-line REPL
src/main.c
Other components
- Programmer
- `.agne` source
- `.apb` bytecode
- OpenSSL / Argon2
Connections 30
- Programmer → CLI commands: runs command
README.md - Programmer → One-line REPL: enters lines
README.md - `.agne` source → CLI commands: provides source
README.md - CLI commands → Lexer: token inspection
src/main.c - CLI commands → AST parser: AST inspection
src/main.c - Lexer → AST parser: supplies tokens
src/parser.c - AST parser → AST model: builds tree
src/parser.c - AST parser → Type checker: passes AST
README.md - Type checker → Bytecode compiler: checks before compile
README.md - Bytecode compiler → Bytecode format: emits instructions
README.md - Bytecode format → Stack VM: executes instructions
README.md - Stack VM → Runtime values: operates on values
- CLI commands → Bytecode compiler: compiles source
src/main.c - CLI commands → Bytecode format: writes or reads
README.md - CLI commands → Stack VM: runs program
README.md - One-line REPL → Bytecode compiler: compiles each line
README.md - One-line REPL → Stack VM: runs compiled line
README.md - CLI commands → Source module loader: loads summoned modules
src/main.c - Source module loader → AST parser: parses source modules
src/module.c - Source module loader → Native registry: recognizes native module
- Stack VM → Native registry: dispatches native calls
- Native registry → Hash and HMAC: invokes crypto
src/acsl.c - Native registry → Authenticated cipher: invokes crypto
src/acsl.c - Native registry → Key derivation: invokes crypto
src/acsl.c - Native registry → Secure randomness: invokes crypto
src/acsl.c - OpenSSL / Argon2 → Authenticated cipher: provides crypto
README.md - OpenSSL / Argon2 → Key derivation: provides derivation
README.md - OpenSSL / Argon2 → Secure randomness: provides randomness
README.md - Bytecode compiler → Bytecode format: serializes for output
README.md - Bytecode format → `.apb` bytecode: reads or writes
README.md