Quickstart
A quickstart guide to understanding and installing Violet
Violet is a systems programming language that combines:
- Zig’s manual allocation philosophy, comptime metaprogramming, fast compile times, and simplicity
- Rust’s interfaces (traits), generics, affine type system, and operator overloading
- Pascal’s readability, keyword conventions, and syntactic clarity
Violet targets embedded systems, operating systems, games, servers, and any domain where control over memory and performance is essential. It provides memory safety without a borrow checker through a combination of linear types, scope-tagged pointers, and explicit allocator discipline.
-- Hello, World
const process = import("std/process").Context;
const debug = import("std/debug");
fn main(ctx: process.Context): !void {
debug.print("Hello, World!\n");
}
Design Philosophy
Explicit over implicit. Every allocation is visible. Every suspension point is visible. No hidden control flow.
Manual allocation, compiler-verified discipline. You choose when and where to allocate. The compiler ensures you clean up.
No borrow checker, meaningful safety. Linear types, scope tags, and unsafe boundaries catch the most dangerous bugs without the cognitive overhead of lifetime annotations.
One way to do things. One async runtime, one allocator interface, one derive mechanism. Ecosystem cohesion over infinite flexibility.
Pascal heritage, modern execution. Keywords like and, or, not, case, repeat...until and nil alongside {} blocks, generics, and a Zig-style build system.
Toolchain
The Violet toolchain is a single binary: violet.
violet build -- debug build (Cranelift backend) [TBD]
violet build --mode=ReleaseSafe -- release build (LLVM backend) [TBD]
violet build --mode=ReleaseUnsafe -- maximum performance, reduced safety [TBD]
violet run -- build and run
violet test -- run @test functions
violet fmt -- format source files
violet pkg add arena-alloc -- add a palette dependency
violet pkg remove arena-alloc
violet pkg update
violet pkg build --mode=ReleaseSafe
violet pkg publish -- publish to palette registry [TBD]
Backend Split
| Mode | Backend | Purpose |
|---|---|---|
| Debug | Cranelift [TBD] / Custom backend | Fast iteration, sub-second rebuilds |
| ReleaseSafe | LLVM | Optimized, all checks active |
| ReleaseUnsafe | LLVM | Maximum performance, reduced checks |
Linkers: mold (default on Linux), wild for incremental linking [TBD], lld on other platforms.
File Extensions
.vi— Violet source filepalette.kdl— package manifestpalette.lock.kdl— lockfile (generated, commit to VCS)build.vi— build script (a normal Violet program)
Build Instructions
At the current moment, Violet’s source code is private. It will be publicized once Violet 0.1.0 is stable.
The final version of Violet is planned to be written in haskell, these steps only apply to violet 0.1.0-alpha1.
Requirements
- git
- zig ≥ v0.16.0
Clone and Build
Pull Violet’s source code from the gitlab repo at https://gitlab.com/violet-lang/compiler.git.
git clone https://gitlab.com/violet-lang/compiler.git violet
cd violet
zig build
Running violet
Running Violet depends on the platform of the system, check the relevant instructions for the system you are using.
Running Tests
zig build test