Introduction
Welcome to the official documentation for Drift, a lightweight and expressive programming language designed to explore new ideas in syntax, semantics, and execution flow.
Drift is built with three core goals in mind:
- Clarity: Favoring readable constructs over boilerplate code.
- Flexibility: Supporting alternative syntaxes and modern patterns like functional expressions, prefabs, and union types.
- Control: Providing precise runtime behavior with static checks, explicit type constraints, and scoped evaluation.
Whether you're here to explore its syntax, understand its evaluation model, or contribute to its evolution, this documentation will guide you through the language's features and design decisions.
Why Drift?
Drift isn't just a toy language. It's an ongoing experiment in rethinking traditional programming conventions.
Drift is written in Kotlin and comes with a full parser, type checker, and evaluator. The runtime is designed to be minimal, testable, and extensible:
- A lexer
- A precedence-based parser
- An AST-based interpreter
- Runtime and type validation with extensive tests
What This Documentation Covers
This documentation will cover the following topics:
- Getting Started — Learn how to run your first Drift program.
- Syntax Overview — Explore expressions, control flow, functions, classes, and prefabs.
- Type System — Understand Drift's type model and how type checking works.
- Builtins and Native Features — See what comes preloaded and how to extend the language.
- Internals — Dive into how Drift is implemented under the hood.
Let’s get started.