The Daslang standard library is a collection of modules that extend the language with commonly needed functionality — math, string manipulation, file I/O, serialization, regular expressions, AST manipulation, and more.
Some modules are implemented in C++ and are available by default (builtin, math,
strings, fio, rtti, ast, network, jobque, uriparser).
The rest are written in daslang itself and live in the daslib/ directory;
import them with require daslib/<module_name>.
- :doc:`builtin <generated/builtin>` — built-in runtime functions, operators, containers, smart pointers, and system infrastructure
- :doc:`math <generated/math>` — vector and scalar math, trigonometry, noise, matrix and quaternion operations
- :doc:`math_bits <generated/math_bits>` — bit-level float/int/double reinterpretation helpers
- :doc:`math_boost <generated/math_boost>` — angle conversions, projection matrices, plane math, color packing
- :doc:`fio <generated/fio>` — file input/output, directory manipulation, process spawning
- :doc:`random <generated/random>` — LCG-based random number generators and distributions
- :doc:`network <generated/network>` — low-level TCP socket server
- :doc:`uriparser <generated/uriparser>` — URI parsing, normalization, and file-name conversion (based on UriParser)
- :doc:`uriparser_boost <generated/uriparser_boost>` — URI component accessors and query-string helpers
- :doc:`strings <generated/strings>` — core string manipulation: search, slice, conversion, builder, character groups
- :doc:`strings_boost <generated/strings_boost>` — split/join, replace, Levenshtein distance, formatting helpers
- :doc:`utf8_utils <generated/utf8_utils>` — UTF-8 encoding and decoding utilities
- :doc:`temp_strings <generated/temp_strings>` — temporary string construction that avoids heap allocation
- :doc:`stringify <generated/stringify>` —
%stringify~reader macro for embedding long strings at compile time - :doc:`base64 <generated/base64>` — Base64 encoding and decoding
- :doc:`regex <generated/regex>` — regular expression matching and searching
- :doc:`regex_boost <generated/regex_boost>` —
%regex~reader macro for compile-time regex construction - :doc:`peg <generated/peg>` — PEG parser generator: define grammars with the
parsemacro, compiled to packrat parsers
- :doc:`rtti <generated/rtti>` — runtime type information: type queries, module/function/variable iteration, compilation and simulation
- :doc:`ast <generated/ast>` — compile-time AST access: expression/function/structure creation, visitor pattern, macro infrastructure
- :doc:`ast_boost <generated/ast_boost>` — AST convenience helpers: queries, annotation manipulation, expression generation, visitor utilities
- :doc:`ast_block_to_loop <generated/ast_block_to_loop>` — AST transform that converts block-based iteration to explicit loops (used by DECS)
- :doc:`ast_cursor <generated/ast_cursor>` — AST cursor navigation for walking expression trees
- :doc:`ast_used <generated/ast_used>` — collect all types used by a set of functions (for code generation)
- :doc:`ast_match <generated/ast_match>` — AST pattern matching via reverse reification: match expressions against structural patterns
- :doc:`quote <generated/quote>` — AST quasiquotation for constructing syntax trees from inline code
- :doc:`type_traits <generated/type_traits>` — compile-time type introspection and manipulation macros
- :doc:`typemacro_boost <generated/typemacro_boost>` — type macro and template structure support infrastructure
- :doc:`dynamic_cast_rtti <generated/dynamic_cast_rtti>` — runtime dynamic casting between class hierarchies
- :doc:`debugapi <generated/debugapi>` — debug agent API: breakpoints, stepping, variable inspection, data walkers
- :doc:`functional <generated/functional>` — higher-order functions:
filter,map,reduce,any,all,flatten,sorted - :doc:`algorithm <generated/algorithm>` — binary search, topological sort, set operations on tables, array utilities
- :doc:`sort_boost <generated/sort_boost>` — custom comparator support for the built-in
sort - :doc:`linq <generated/linq>` — LINQ-style query operations: select, where, order, group, join, aggregate, set operations
- :doc:`linq_boost <generated/linq_boost>` — macro support for LINQ query syntax
- :doc:`flat_hash_table <generated/flat_hash_table>` — open-addressing flat hash table template
- :doc:`cuckoo_hash_table <generated/cuckoo_hash_table>` — cuckoo hash table with O(1) worst-case lookup
- :doc:`bool_array <generated/bool_array>` — packed boolean array (
BoolArray) backed byuint[]storage - :doc:`soa <generated/soa>` — Structure of Arrays transformation for cache-friendly data layout
- :doc:`archive <generated/archive>` — general-purpose binary serialization framework with
Serializer/Archivepattern - :doc:`json <generated/json>` — JSON parser and writer (
JsValuevariant,read_json,write_json) - :doc:`json_boost <generated/json_boost>` — automatic struct ↔ JSON conversion via reflection
- :doc:`jobque <generated/jobque>` — job queue primitives: channels, job status, lock boxes, atomics
- :doc:`jobque_boost <generated/jobque_boost>` —
new_job/new_threadhelpers, channel iteration - :doc:`apply_in_context <generated/apply_in_context>` — cross-context function evaluation helpers
- :doc:`async_boost <generated/async_boost>` — async/await coroutine macros using job queues
- :doc:`templates <generated/templates>` —
decltypemacro and[template]function annotation - :doc:`templates_boost <generated/templates_boost>` — template application helpers: variable/type replacement, hygienic names
- :doc:`macro_boost <generated/macro_boost>` — miscellaneous macro manipulation utilities
- :doc:`contracts <generated/contracts>` — function argument contract annotations (
[expect_any_array],[expect_any_table], etc.) - :doc:`apply <generated/apply>` —
applyreflection pattern for struct field iteration - :doc:`enum_trait <generated/enum_trait>` — compile-time enumeration trait queries
- :doc:`constexpr <generated/constexpr>` — constant expression detection and substitution macro
- :doc:`bitfield_boost <generated/bitfield_boost>` — operator overloads for bitfield types
- :doc:`bitfield_trait <generated/bitfield_trait>` — reflection utilities for bitfield names and values
- :doc:`consume <generated/consume>` —
consumepattern for move-ownership argument passing - :doc:`generic_return <generated/generic_return>` —
[generic_return]annotation for return type instantiation - :doc:`remove_call_args <generated/remove_call_args>` — AST transformation to remove specified call arguments
- :doc:`class_boost <generated/class_boost>` — macros for extending class functionality and method binding
- :doc:`defer <generated/defer>` —
deferanddefer_delete— execute code at scope exit - :doc:`delegate <generated/delegate>` —
[delegate]annotation for forwarding method calls - :doc:`if_not_null <generated/if_not_null>` —
if_not_nullsafe-access macro - :doc:`safe_addr <generated/safe_addr>` —
safe_addrandtemp_ptr— safe temporary pointer macros - :doc:`static_let <generated/static_let>` —
static_let— variables initialized once and persisted across calls - :doc:`lpipe <generated/lpipe>` — left-pipe operator macro (
<|) - :doc:`is_local <generated/is_local>` —
is_local_expr/is_scope_exprAST query helpers - :doc:`assert_once <generated/assert_once>` —
assert_once— assertion that fires only on first failure - :doc:`unroll <generated/unroll>` — compile-time loop unrolling macro
- :doc:`instance_function <generated/instance_function>` —
[instance_function]annotation for struct method binding - :doc:`array_boost <generated/array_boost>` —
temp_array,array_view, andemptyhelpers
- :doc:`match <generated/match>` —
matchmacro for structural pattern matching on variants and values
- :doc:`decs <generated/decs>` — DECS (Daslang Entity Component System): archetypes, components, queries, staged updates
- :doc:`decs_boost <generated/decs_boost>` — DECS macro support for query syntax
- :doc:`decs_state <generated/decs_state>` — DECS state machine support for entity lifecycle
- :doc:`coroutines <generated/coroutines>` — coroutine runner (
cr_run,cr_run_all) and generator macros (yield_from) - :doc:`interfaces <generated/interfaces>` —
[interface]and[implements]annotations for interface-based polymorphism - :doc:`cpp_bind <generated/cpp_bind>` — C++ class adapter binding code generator
- :doc:`faker <generated/faker>` — random test data generator: strings, numbers, dates
- :doc:`fuzzer <generated/fuzzer>` — function fuzzing framework
- :doc:`profiler <generated/profiler>` — instrumenting CPU profiler for function-level timing
- :doc:`profiler_boost <generated/profiler_boost>` — profiler cross-context helpers and high-level macros
- :doc:`debug_eval <generated/debug_eval>` — runtime expression evaluation for interactive debugging
- :doc:`dap <generated/dap>` — Debug Adapter Protocol (DAP) data structures for debugger integration
- :doc:`lint <generated/lint>` — static analysis pass for common code issues
- :doc:`validate_code <generated/validate_code>` — AST validation annotations for custom code checks
- :doc:`refactor <generated/refactor>` — automated code refactoring transformations
- :doc:`ansi_colors <generated/ansi_colors>` — ANSI terminal color escape sequences
- :doc:`tty <generated/tty>` — terminal capability probes (is it a terminal, how wide)
- :doc:`command_line <generated/command_line>` — command-line argument parsing helpers
- :doc:`das_source_formatter <generated/das_source_formatter>` — daslang source code formatter
- :doc:`das_source_formatter_fio <generated/das_source_formatter_fio>` — file-based source code formatting
- :doc:`rst <generated/rst>` — RST documentation generator used to produce this reference
- :doc:`dashv <generated/dashv>` — HTTP client/server and WebSocket bindings (C++ module, based on libhv)
- :doc:`dashv_boost <generated/dashv_boost>` — dasHV convenience helpers: GET/POST/PUT/PATCH/DELETE, response iteration
- :doc:`openai <generated/openai>` — OpenAI-compatible API client: chat, tools, embeddings, models, audio, images, vision, streaming
- :doc:`pugixml <generated/pugixml>` — XML parsing, building, and XPath queries (C++ module, based on pugixml)
- :doc:`PUGIXML_boost <generated/PUGIXML_boost>` — XML convenience helpers: node iteration, automatic struct serialization
- :doc:`stbimage <generated/stbimage>` — image loading, saving, and pixel access (C++ module, based on stb_image)
- :doc:`stbimage_boost <generated/stbimage_boost>` — image convenience helpers: drawing, blending, transforms
- :doc:`stbtruetype <generated/stbtruetype>` — TrueType font rasterization (C++ module, based on stb_truetype)
- :doc:`stbimage_ttf <generated/stbimage_ttf>` — font rendering helpers for stbimage surfaces
- :doc:`raster <generated/raster>` — software rasterizer: triangles, lines, circles, polygons
- :doc:`gltf <generated/gltf>` — glTF 2.0 model loader: GLB/.gltf parse, accessor decode, node hierarchy, skinning, keyframe animation
- :doc:`audio <generated/audio>` — audio playback, mixing, 3D spatial audio, effects (C++ module, based on miniaudio)
- :doc:`audio_boost <generated/audio_boost>` — audio convenience helpers: sound loading, bus routing, effect chains
- :doc:`audio_wav <generated/audio_wav>` — WAV file reading and writing
- :doc:`audio_record <generated/audio_record>` — microphone capture and record-to-WAV
- :doc:`strudel_midi <generated/strudel_midi>` — MIDI file parsing and playback
- :doc:`strudel_sf2 <generated/strudel_sf2>` — SoundFont 2 file parser for sample-based synthesis
- :doc:`dasllama <generated/dasllama>` — CPU LLM inference over GGUF models: loading, tokenization, generation, chat