← Back to Blog
Design Mar 5, 2026

Designing a Python-Like Syntax for a Compiled Language

One of the hardest problems in language design is syntax. It has to be learnable, writable, and readable: and for a compiled language, unambiguous enough for a parser to handle without backtracking.

The Goal

Python's syntax reads like pseudocode. That is a feature. Vexel aims for the same property: code should make sense read aloud in English. You should be able to hand Vexel source to someone who has never seen it and have them understand the structure immediately.

Key Decisions

Indentation over braces

Like Python, Vexel uses indentation to delimit blocks. Curly braces add visual noise without aiding readability once indentation is already enforced. The tradeoff is that the lexer must emit INDENT and DEDENT tokens: a solved problem in CPython's tokenizer, and in ours.

Explicit type annotations

Unlike Python, type annotations are required on function signatures and let declarations. This lets the compiler catch type errors early and generate efficient LLVM IR without full type inference.

# type is explicit: no guessing for the compiler
let score: int = 100

fn, not def

We chose fn over def because it is shorter, more familiar across modern languages (Rust, Swift, Kotlin), and signals that this is a compiled language: not a scripting environment.

The result is a language that is immediately legible to Python developers, while generating code as efficient as hand-written C.