XTB is a BetterC-first foundational library for D. It avoids the GC, exceptions, classes, and runtime reflection, and keeps allocation and ownership explicit.
| Subpackage | Import | Provides |
|---|---|---|
| core | xtb |
allocators, containers, strings, formatting, Option, Result, utilities |
| os | xtb.os, xtb.os.posix, xtb.os.linux |
low-level native errors, handles, pipes, and platform interfaces |
| terminal | xtb.terminal |
terminal capability policy and ANSI selection |
| fs | xtb.fs |
paths, files, directories, metadata, file-backed mappings |
| process | xtb.process |
process environment, commands, child processes, communication, pipelines |
| time | xtb.time |
timestamps, monotonic instants, timeouts, sleeping |
| window | xtb.window |
desktop windows, input, OpenGL contexts, native graphics handles |
| opengl | xtb.opengl |
BetterC OpenGL 4.6 bindings and runtime function loading |
| log | xtb.log |
level-based logging and composable sinks |
| math | xtb.math |
vectors, matrices, transforms, random, noise |
| threading | xtb.thread, xtb.sync |
threads and synchronization primitives |
| parser | xtb.parser |
parser combinators and reusable grammars |
| serde | xtb.serde |
serialization and deserialization |
| cli | xtb.cli |
typed command-line parser |
| diagnostics | xtb.diagnostics |
stack traces, demangling, crash diagnostics |
core is the base subpackage. DUB resolves transitive subpackage dependencies.
nix flake new -t github:Xearty/xtb#app ./my-app
cd my-app
direnv allow
just runSee the application template for selecting subpackages.
| Mode | Use |
|---|---|
debug |
development with checks and debug information |
release-safe |
optimized build with checks retained |
release-fast |
optimized build with checked-only contracts removed |
just build
just release-safe
just release-fast
just checkSee build modes for the exact differences.
Contributors should follow the XTB style guide.