Skip to content
Draft

Language Overview

Draft is a statically-typed, compiled programming language designed for simplicity and performance. Its word-oriented syntax makes code readable and approachable while maintaining the power needed for systems programming.

Goal Description
Simplicity Minimal syntax rules. Easy to learn in hours.
Performance Compiles to native code. Zero-cost abstractions.
Safety No null pointer exceptions. Explicit error handling.
Portability Target native, WASM, web, embedded from one codebase.
Productivity Great tooling, fast compile times, clear errors.

Draft uses English words for control flow instead of symbols:

if @score > 90
write("Excellent!")
else if @score > 70
write("Good!")
else
write("Keep trying!")
fin if.

All variables use the @ prefix:

@name = "Draft"
@version = 1
@is_awesome = true

Use # for member/property access:

@length = @string#length
@first = @list#first
@body = @request#body

Every block has a clear ending marker:

action greet(@name)
write("Hello, " + @name)
fin action.
if @ready
launch!
fin if.
for @item in @items
process(@item)
fin for.

Draft uses ownership and manual memory management. Memory is predictable and real-time safe.

Draft compiles to multiple backends:

Target Use Case
Native Desktop apps, servers, CLI tools
WebAssembly Browser apps, plugins, edge computing
Web Full-stack web applications
Embedded Microcontrollers, IoT devices
Mobile iOS and Android apps

Draft ships with a rich standard library:

Module Purpose
io Input/output operations
fs File system access
math Mathematical functions
strings String manipulation
collections Arrays, maps, sets
json JSON encoding/decoding
http HTTP client and server
time Date and time handling
process Process management

Continue to the Syntax Reference to learn Draft’s complete syntax.