How farzonl/warflang works
WarfLang is a small programming language with an interactive/file CLI, a WebAssembly-facing entry point, and tools for compiling source or running and translating its intermediate representation. The main source workflow parses text into syntax, binds it into typed bound nodes, then either evaluates it or lowers it to IR. Compiler and IR-tool paths extend that workflow to LLVM output when enabled. The graph follows the sampled entry-point orchestration; several internal implementations and the README’s build-focused documentation were not sampled.
Main entry points: cli/main.cpp Warf CLI / REPL · wasmEntry.cpp Wasm Entry · compilerTool/main.cpp Source Compiler · irTool/main.cpp IR Tool
Components 17
User Interfaces
- Warf CLI / REPL
src/cli/main.cpp - Wasm Entry
src/wasmEntry/wasmEntry.cpp - Source Compiler
src/compilerTool/main.cpp - IR Tool
src/irTool/main.cpp
Source Frontend
- Syntax Tree
src/lib/Syntax/SyntaxTree.cpp - Parser
src/lib/Syntax/Parser.cpp - Lexer
src/lib/Syntax/Lexer.cpp
Binding and Evaluation
- Binder
src/lib/Binding/Binder.cpp - Symbols and Scopes
src/lib/Symbol/Scope.cpp - Bound Evaluator
src/lib/CodeAnalysis/Evaluator.cpp
IR Processing
- IR Lowerer and Printer
src/lib/IR/Ir.cpp - IR Parser
src/lib/IR/Ir.cpp - IR Interpreter
src/lib/IR/Ir.cpp
LLVM Backend
- LLVM Backend
src/llvmBackend/LlvmBackend.cpp
Other components
- Language User
- Clang Compiler
- Program Result
Connections 28
- Language User → Warf CLI / REPL: enters source
- Language User → Wasm Entry: submits source
- Language User → Source Compiler: compiles source
- Language User → IR Tool: runs or translates IR
- Warf CLI / REPL → Syntax Tree: parses source
- Wasm Entry → Syntax Tree: parses source
- Source Compiler → Syntax Tree: parses source
- Syntax Tree → Parser: builds syntax
- Parser → Lexer: requests tokens
- Warf CLI / REPL → Binder: binds syntax
- Wasm Entry → Binder: binds syntax
- Source Compiler → Binder: binds syntax
- Binder → Symbols and Scopes: resolves names
- Warf CLI / REPL → Bound Evaluator: evaluates bound code
- Wasm Entry → Bound Evaluator: evaluates bound code
- Bound Evaluator → Program Result: returns value
- Warf CLI / REPL → IR Lowerer and Printer: lowers bound code
- Wasm Entry → IR Lowerer and Printer: lowers bound code
- Source Compiler → IR Lowerer and Printer: lowers bound code
- IR Lowerer and Printer → Warf CLI / REPL: prints IR
- IR Lowerer and Printer → Wasm Entry: prints IR
- Source Compiler → LLVM Backend: emits LLVM
- LLVM Backend → Clang Compiler: compiles LLVM IR
- IR Tool → IR Parser: parses IR file
- IR Tool → IR Interpreter: executes module
- IR Interpreter → Program Result: returns value
- IR Tool → LLVM Backend: emits LLVM or bitcode
- IR Tool → Program Result: prints translated output