Standalone Native Language · v0.1
Expressive syntax.
Expressive syntax.
Native performance.
Dlang is a standalone language for mathematics, trading research, physics, and native tools — with optional static types and a batteries-included standard library.
fn factorial(n: int) -> int
if n <= 1
return 1
end
return n * factorial(n - 1)
end
show factorial(6) # 720import http
fn handle(req)
return {
status: 200,
content_type: "text/plain",
body: "Hello from " + req.path
}
end
http.serve("127.0.0.1:8080", handle, 0)import math
import array
xs = array.from([1.0, 2.0, 3.0])
ys = array.from([4.0, 5.0, 6.0])
show array.dot(xs, ys) # 32
show math.std_dev([2, 4, 4, 4, 5, 5, 7, 9])Designed for clarity and speed
Compiled to Native
Compiles `.dl` programs to standalone native binaries with deterministic reference-counted memory.
Flexible Block Syntax
Write clean indentation-based blocks or explicit `end` terminators — whichever fits your style.
Gradual Static Typing
Prototype dynamically, then add `x: int`, `list<T>`, and `T1 | T2` union annotations checked by `dlang check`.
Batteries Included
Built-in `math`, `array`, `text`, `regex`, `fs`, `http`, `json`, `sqlite`, `async`, and desktop `ui` modules.
Explore the Documentation
Introduction to DlangA fast, standalone native programming language for mathematics, trading research, physics, and everyday applications.Installation & Quick StartInstall Dlang on macOS, Linux, or Windows, run your first `.dl` program, and build a standalone native executable.Syntax & BlocksLexical rules, reserved keywords, comments, indentation vs `end` blocks, `show`, and `assert`.Types & AnnotationsDynamic runtime values, strict operations, `missing`, and compile-time type annotations with union types.Operators & PrecedenceArithmetic, exponentiation, comparison, short-circuiting logical operators, and indexing/slicing.Control Flow & MatchBranching with `if`/`else`, `while` and `for ... in` loops, `break`/`continue`, and `match`.Functions & ClosuresDefining functions, optional type parameters, first-class function values, closures, and recursion.Lists, Records & CollectionsImmutable lists and records, `append`, field access, and mutable `collections` structures.Modules & ImportsOrganizing multi-file projects with `import`, `pub`/`private` visibility, and `dlang.json`.Builtins, Math & TextGlobal builtins, mathematical constants, `math`, `random`, `array`, `text`, and `regex`.Files, HTTP, JSON & SQLiteBuild web servers, fetch APIs, read/write files, parse JSON/CSV, and query SQLite databases.Async, System & Desktop UIIsolated concurrent tasks (`async`), OS/process inspection (`system`, `env`, `process`), and native desktop `ui`.dlang CLI ReferenceReference for the `dlang` command-line tool: running scripts, type-checking, building native binaries, and using the REPL.