Vex is a simple and powerful programming language. It is built with Rust. It has a special Inspector tool to see how the compiler works step-by-step.
You need Rust and Cargo on your computer.
To run a Vex file (.vx), use this command:
cargo run -p vex-cli -- path/to/your_file.vxYou can see how long each compiler step (Lexing, PreParsing, etc.) takes and how much RAM they use.
cargo run -p vex-cli -- path/to/your_file.vx --statsTo see memory (RAM) used by each step, you need the performance-stats feature:
cargo run --features performance-stats -p vex-cli -- path/to/your_file.vx --statsThe Inspector is a powerful tool to see how the compiler works. You must use the inspector feature for it to work.
Our new graphical inspector provides a side-by-side view of Lexer tokens, PreParser results, AST nodes, and Source code highlighting.
To open the GUI Inspector:
cargo run --features inspector -p vex-cli -- path/to/your_file.vx --inspect --guiKey Features:
- Full View: Complete pipeline visualization in a single screen.
- Execution Trace: Real-time call stack tracking of the Rust parser algorithms.
- Cross-Highlighting: Clicking a token highlights it in all other lists and the source code.
- Automatic Sync: AST selection automatically scrolls and highlights related tokens.
If you prefer the terminal, you can use the classic TUI inspector:
cargo run --features inspector -p vex-cli -- --inspect path/to/your_file.vx- SPACE: Move to the next step.
- Skip Phase: Fast-forward to the next compiler phase.
- Reload (R): Reload the source file and restart inspection.
- Focus (F): Re-center the view on the current selection.
- Q: Quit the Inspector.
If you want to save the token list, press E in the Inspector. It will create a file named report*...*.md. You can open it in VS Code to see a nice table of your code.
We love help! To add a new feature:
- Look at vex-lexer to change how characters are read.
- Look at vex-parser to change the language rules.
- Use the Inspector to test your changes. It helps you find bugs easily.
- vex-core: Basic types (Tokens, Spans).
- vex-lexer: Converts code text into tokens.
- vex-parser: Checks the code structure.
- vex-inspector: The TUI debugger tool.
- vex-cli: The main program.
Happy coding with Vex!
