Violette — a statically typed compiled programming language combining the of Go/Kotlin/Swift with the speed of C/Rust.
- Deterministic Memory Model: Fast reference counting (Perceus-style). (not ready yet)
- Null-Safety & Zero-Values: No hidden
nullreferences. - UFCS Methods: Any function taking a struct or primitive as its first parameter behaves as a method (
p.distance(),"Violette".len()). - Sprout Pipelines (
~>): Functional dataflow operator for conveyor-style transformations. - Modular Standard Library: Embedded zero-cost prelude (
prelude.vio) - Modern Terminal Diagnostics: Card-based error reporting like in Gleam
import math.{sqrt}
struct Point {
x: float64,
y: float64,
}
funс distance(p: Point, other: Point) [float64] {
let dx = p.x - other.x
let dy = p.y - other.y
return sqrt((dx * dx) + (dy * dy))
}
funс main() {
let p1 = Point { x: 0.0, y: 0.0 }
let p2 = Point { x: 3.0, y: 4.0 }
// Uniform Function Call Syntax:
println(p1.distance(p2)) // 5.0
// Multi-line fluent chaining:
let result = (-64.0)
.abs()
.sqrt()
println(result) // 8.0
}
funс fetch(url: string) [string] {
return "payload"
}
funс parse(data: string) [string] {
return "json"
}
funс validate(data: string) [bool] {
return true
}
funс main() {
// this string is the same as validate(parse(fetch("https://example.com")))
let is_valid = "https://example.com" ~> fetch ~> parse ~> validate
println(is_valid) // true
}
funс main() {
let text = "Violette"
if !text.is_empty() {
println("Length: " + text.len().to_string())
}
let clamped = clamp(150, 0, 100)
println(clamped) // 100
}
- Lexer & Tokenizer
- Pratt Parser
- Typechecker & Semantic Analysis with immutability by default
- Flow Control Analysis
- C-Transpiler Codegen with FFI
- Embedded Standard Library
- Selective & Dotted Imports (
import math.{abs, sqrt},import math.hypot) - Card-based Terminal Diagnostics with ANSI styling and helpful hints
- Tagged Unions & Pattern Matching expressions (
match+Win/Fail) - Error propagation postfix operator (
|) - Perceus In-Place Buffer Reuse (FBIP) optimization
- Native LLVM Backend (Target v1.0)
- Rust toolchain (Rust 1.80+)
- A standard C compiler (
clangorgcc)
git clone https://github.com/Krev3tka/Violette.git
cd Violette
cargo build --release# Run any .vio file directly:
./target/release/violette run examples/demo_showcase.vionix develop
nix buildIntegration and snapshot tests are managed via the built-in test suite:
# Run Rust unit tests:
cargo test
# Run full integration test suite:
cd tools/Viotestte && go run main.goViolette is an independent open-source project. If you'd like to support the language design and compiler development:
- ERC-20 / ETH:
0x7ecc5C0a8A24dfCB885966a98aEc60fC8D736422
This project is licensed under the MIT License - see the LICENSE file for details.