Reference
Frequently Asked Questions
Answers to the most common questions about Vexel. If you have a question not covered here, open a discussion on GitHub.
General
What is Vexel?
Vexel is a statically typed, compiled programming language designed to be as readable as Python while compiling to native machine code via LLVM. It is especially well-suited for game development thanks to first-class SDL2 support and a garbage-collected runtime.
Who built Vexel?
Vexel was designed and built by Cliff, a self-taught developer who started the project at 17. It is a solo project built in spare time, currently at v0.1. You can read the full story on the About page.
Is Vexel ready for production use?
Not yet. Vexel is at v0.1 and is best suited for experimentation, learning, and small game projects. The language itself is stable and the compiler handles real programs, but there is no standard library, no package manager, and Linux/macOS support is not available yet. Use it for projects where instability is acceptable.
Is Vexel open source?
Yes. Vexel is MIT licensed. The full source code for the compiler is available on GitHub at github.com/Justme-Cliff/vexel. Contributions, issue reports, and forks are all welcome.
What platforms does Vexel support?
Windows x64 is the only fully supported platform in v0.1. A standalone vexel.exe is available for download. Linux and macOS support is planned for v0.2 and will include prebuilt binaries for both platforms.
Language
How is Vexel different from Python?
Vexel uses Python-inspired indentation-based syntax but is a completely different language under the hood. It is statically typed (every variable and function parameter has a declared type), compiled to native code (not interpreted), and does not have a runtime interpreter. There is no duck typing, no dynamic attribute lookup, and no GIL. Vexel programs run as standalone executables.
Does Vexel have garbage collection?
Yes. Vexel uses a mark-and-sweep garbage collector built into the compiler runtime. You do not need to manually allocate or free memory. The GC runs automatically during program execution and handles circular references correctly.
What types does Vexel support?
The built-in primitive types are int (64-bit integer), float (64-bit floating point), str (heap-allocated UTF-8 string), bool, and null. You can define compound types with struct, enum, and interface. Arrays are written as [T]. Type aliases are supported with the type keyword. Generics use [T] syntax on functions and structs.
Does Vexel support object-oriented programming?
Vexel supports structs with methods, which covers most of what you would use classes for. It also supports interfaces (impl X for Y), which allow you to define contracts that different types can implement. There is no inheritance. The design leans toward composition over inheritance.
Can I use lambdas and higher-order functions?
Yes. Functions are first-class values in Vexel. You can assign them to variables, pass them as arguments, and return them from functions. Lambda expressions use the syntax (x: int) -> x * 2. Closures can capture variables from outer scopes (read-only in v0.1; mutable capture is planned for v0.2).
How do imports work?
Use import "path/to/file.vx" to bring all top-level declarations from another file into scope. Use import "path/to/file.vx" as name to access them through a namespace alias. Imports are resolved relative to the file containing the import statement. There are no circular import checks yet, so avoid circular dependencies manually.
Does Vexel have string interpolation?
Not in v0.1. You can concatenate strings with + and convert values with int_to_str() and float_to_str(). String interpolation is planned for v0.2.
What does the match statement do?
The match statement dispatches on enum variants or type patterns. It is exhaustive: you must handle all cases or provide a default branch. It is an expression, not a statement — every branch must evaluate to the same type if used in a value position.
Compiler and Tooling
What does "compiled via LLVM" mean in practice?
The Vexel compiler reads your source file, typechecks it, and then uses llvmlite to emit LLVM Intermediate Representation (IR). LLVM then optimizes the IR and translates it to native machine code for your target platform. The result is a standalone binary that has no dependency on Vexel or Python to run.
How is the compiler itself built?
The compiler is written in Python 3.12 and uses llvmlite for LLVM IR generation. The distributed vexel.exe is packaged with PyInstaller and includes the Python runtime, so no Python installation is required to use Vexel on Windows. The entire compiler pipeline is in a single repository at github.com/Justme-Cliff/vexel.
What is "vexel run" vs "vexel compile"?
vexel run uses LLVM's JIT (just-in-time) compilation to execute your program in memory without writing a binary to disk. It is fast to start and great for development. vexel compile produces a standalone .exe (Windows) or binary (Linux/macOS) that can be distributed and run without Vexel installed.
Is there a VS Code extension?
Yes. The Vexel VS Code extension provides syntax highlighting for .vx files. It highlights keywords, types, strings, numbers, comments, and function names using the Dracula-inspired color scheme. Install it from the extensions directory in the repository.
How do I see the LLVM IR my program generates?
Run vexel ir yourfile.vx. The compiler will print the full LLVM IR to stdout without producing a binary. This is useful for understanding performance characteristics, debugging codegen issues, or just satisfying curiosity about how your code translates to low-level operations.
How do I check for type errors without running my program?
Run vexel analyze yourfile.vx. The compiler runs the full semantic analysis pass and reports all type errors, undefined name errors, and arity mismatches, then exits. No binary is produced.
SDL2 and Games
What SDL2 functions are available?
Vexel exposes sdl2_init, sdl2_quit, sdl2_poll, sdl2_clear, sdl2_set_color, sdl2_draw_rect, sdl2_present, and sdl2_delay. These cover window creation, the event loop, clearing and filling the screen, drawing rectangles, and frame rate control. More drawing primitives are planned for v0.2.
Do I need SDL2 installed to compile with --sdl2?
On Windows you need SDL2.dll in your project directory. Run python setup_sdl2.py once from the compiler repository to download it automatically. The setup script handles everything.
Can I detect keyboard input?
Not directly in v0.1. sdl2_poll handles window close events. Keyboard and mouse input functions are among the highest priority additions for v0.2.
Contributing
How can I contribute?
Open a pull request on GitHub. Good areas to contribute to include the standard library, error message quality, test coverage, documentation examples, and the VS Code extension. If you find a bug, open an issue with a minimal reproducing example and the full error output.
Can I request features?
Yes. Open a GitHub issue with the "enhancement" label. Describe the use case first — what problem does the feature solve? — and then the proposed syntax or behavior. Features with clear motivating use cases are much more likely to be prioritized.
Still have a question?
Open a GitHub discussion or check the documentation for detailed coverage of every language feature.