Installation & Setup
Toolchain Requirements
Supported Platforms
| Platform | Architecture | Status |
|---|---|---|
| Linux | x86_64, aarch64 | ✅ Full Support |
| macOS | x86_64, Apple Silicon | ✅ Full Support |
| Windows | x86_64 | ✅ Full Support |
| FreeBSD | x86_64 | ✅ Full Support |
Dependencies
- LLVM 21.1.8 - backend code generation used by the main toolchain
- Clang / platform C toolchain - runtime and native linking support
- Rust toolchain - required to build the compiler and tools from source today
Building from Source
1. Clone the Repository
bash
git clone https://github.com/meftunca/vex_lang.git
cd vex_lang2. Build the Compiler
bash
# Debug build
cargo build
# Release build
cargo build --release3. Verify Installation
bash
# Compiler binary
~/.cargo/target/debug/vex --version
# Run a sample program
~/.cargo/target/debug/vex run examples/hello.vx
# Run the repo test suite
./test_all.shThe debug binary path above is the canonical development path used throughout the repository.
Editor/IDE Setup
VS Code (Recommended)
- Install the Vex Language extension from the marketplace
- The extension provides:
- Syntax highlighting
- LSP integration (diagnostics, completion, go-to-definition)
- Code formatting
- Snippets
Manual LSP Setup
For other editors that support LSP:
bash
# Build the LSP server
cargo build --release -p vex-lsp
# Binary path
~/.cargo/target/release/vex-lspConfigure your editor to use vex-lsp as the language server for .vx files.
Typical Workspace Layout
A typical Vex project looks like:
my_project/
├── vex.json # Project manifest
├── src/
│ ├── main.vx # Entry point
│ └── lib/ # Library modules
├── tests/ # Test files
└── examples/ # Example codeFirst Program
Create a file hello.vx:
vex
fn main(): i32 {
$println("Hello, Vex!")
return 0;
}Run it:
bash
~/.cargo/target/debug/vex run hello.vxCommon Commands
| Command | Description |
|---|---|
vex run <file> | Compile and run |
vex compile <file> | Compile and link |
vex test | Discover and run tests |
Useful Development Notes
vex runmay use JIT or no-JIT execution depending on runtime/native-linking constraints.vex compileis the right entry point when you want persistent artifacts or LLVM output.- Examples in this repository often use
~/.cargo/target/debug/vexdirectly during compiler development.
Troubleshooting
LLVM Not Found
bash
# macOS
brew install llvm
# Ubuntu/Debian
sudo apt install llvm-dev libclang-dev
# Fedora
sudo dnf install llvm-devel clang-develLinker Errors
LLD is recommended when available.
bash
# macOS
brew install lldNext Steps
- Syntax Overview - Learn Vex syntax
- Functions - Understand declarations and receivers
- Testing - Learn the test runner