Skip to content
Maksym Skorina

Projects

One system, built from the ground up.

KshanexLang is the current focus: a language, its compiler, its standard library, and the notes that document how the pieces meet.

KshanexLang

compiler · language · standard library

A statically typed, general-purpose language with a direct LLVM IR backend. Effect rows are checked at the call site. The compiler is written from scratch in Rust with no external crates, and the standard library is written in the language itself.

1.08×
vs C at -O2
3,265
tests
70k
LOC of Rust
effects.knx KshanexLang
func read_config(path: str): Result<Config> with fs {
    let raw = fs.read(path)?
    return parse(raw)
}

func main(): int with fs, log {
    let config = read_config("site.toml")?
    log.info(config.name)
    return 0
}

What is inside

Direct LLVM IR backend
compiled through opt and clang at -O2
Effect rows at the call site
rejected with E0115, not at the declaration
VS Code language server
shares the compiler front end
Standard library in .knx
GUI, tensors, crypto, HTTP, JSON, FFT
Self-hosting path
S6c emits the full closure of loaded modules
No external crates
70,316 lines of Rust from scratch

Benchmarks

All 17 cases across six languages, each the minimum of 11 runs on one machine. The losses stay next to the wins.

Methodology
Benchmark KshanexLang C Rust Zig Go Swift vs C
fib_rec 22.70 ms 23.90 ms 24.47 ms 26.44 ms 47.63 ms 45.94 ms
0.95×
sum_loop 30.02 ms 26.97 ms 27.35 ms 26.65 ms 32.29 ms 37.73 ms
1.11×
struct_bits 344.76 ms 332.57 ms 337.11 ms 338.39 ms 367.58 ms 988.50 ms
1.04×
float_sqrt 405.85 ms 416.23 ms 399.38 ms 685.39 ms 323.48 ms 170.18 ms
0.98×
matmul_f64 259.83 ms 211.53 ms 352.34 ms 216.69 ms 317.48 ms 412.78 ms
1.23×
matmul_transpose 90.96 ms 202.64 ms 237.73 ms 213.07 ms 229.06 ms 247.71 ms
0.45×
vec_sum 21.06 ms 20.17 ms 21.49 ms 30.56 ms 17.31 ms 29.49 ms
1.04×
sort_int 548.03 ms 322.96 ms 236.12 ms 328.80 ms 349.67 ms 2.04 s
1.70×
prime_sieve 500.98 ms 497.07 ms 507.09 ms 480.57 ms 463.43 ms 556.92 ms
1.01×
string_build 4.26 ms 4.03 ms 4.43 ms 4.35 ms 5.75 ms 14.79 ms
1.06×
hash_fnv 426.60 ms 396.49 ms 396.98 ms 364.22 ms 412.79 ms 686.72 ms
1.08×
closure_call 338.07 ms 307.00 ms 281.03 ms 266.13 ms 293.35 ms 368.65 ms
1.10×
alloc_churn 1.02 s 591.29 ms 751.09 ms 589.05 ms 221.81 ms 636.15 ms
1.72×
match_dispatch 113.00 ms 46.41 ms 27.08 ms 28.25 ms 117.61 ms 106.87 ms
2.43×
hashmap 45.88 ms 120.80 ms 199.24 ms 123.83 ms 248.50 ms 220.79 ms
0.38×
json_parse 364.08 ms 190.39 ms 130.81 ms 79.41 ms 221.80 ms 360.96 ms
1.91×
net_echo 365.60 ms 377.22 ms 372.74 ms — 370.72 ms —
0.97×

geometric mean 1.08× vs C · bar length is relative time, the tick marks C parity

Minimum of eleven runs on one Windows 11 x86_64 machine. C at -O2; Rust, Zig, Swift, and Go at their documented optimisation levels. Ratios below 1.00× are faster than C. The checked default is measured.

Work with the person who wrote it

For press, research, and engineering conversations, email is the most direct route.