wind

Compiled language. Custom C++ compiler, x86-64 backend.

C++ / AST / IR / x86-64GitHub
From source to machine code
  1. Source.w
  2. Lexer / parserTokens → AST
  3. GenerationIR → Optimizer
  4. Backendx86-64
Pipeline derived from src/core/wind/ ↗

Compiler pipeline

Source passes through lexer and parser into an AST. Compiler visitors produce an intermediate representation; the repository includes an optimizer and an x86-64 backend.

src/core/wind/

Type handling

The compiler infers types for binary expressions and handles coercion. Differently sized scalar types require an explicit cast; pointer and array types have separate handling.

compiler.cpp

Language examples

The feature-test source includes typed variables, pointers, guards, loops, try blocks and overflow handling. Benchmarks and feature tests are included in the repository.

base.w

testing/features/tests/dev/base.w · excerpt

func main(argc: int, argv: ptr<ptr<char>>): int {
    var T: s16=30_000;
    var i: int=0;
    var tptr: ptr<int> = guard![malloc(sizeof<int>*8)];
Read full source