1. Introduction
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>.
1.1. Core runtime
builtin — built-in runtime functions, operators, containers, smart pointers, and system infrastructure
math — vector and scalar math, trigonometry, noise, matrix and quaternion operations
math_bits — bit-level float/int/double reinterpretation helpers
math_boost — angle conversions, projection matrices, plane math, color packing
fio — file input/output, directory manipulation, process spawning
random — LCG-based random number generators and distributions
network — low-level TCP socket server
uriparser — URI parsing, normalization, and file-name conversion (based on UriParser)
uriparser_boost — URI component accessors and query-string helpers
1.2. Strings
strings — core string manipulation: search, slice, conversion, builder, character groups
strings_boost — split/join, replace, Levenshtein distance, formatting helpers
utf8_utils — UTF-8 encoding and decoding utilities
temp_strings — temporary string construction that avoids heap allocation
stringify —
%stringify~reader macro for embedding long strings at compile timebase64 — Base64 encoding and decoding
1.3. Regular expressions
regex — regular expression matching and searching
regex_boost —
%regex~reader macro for compile-time regex construction
1.4. Reflection and AST
rtti — runtime type information: type queries, module/function/variable iteration, compilation and simulation
ast — compile-time AST access: expression/function/structure creation, visitor pattern, macro infrastructure
ast_boost — AST convenience helpers: queries, annotation manipulation, expression generation, visitor utilities
ast_block_to_loop — AST transform that converts block-based iteration to explicit loops (used by DECS)
ast_used — collect all types used by a set of functions (for code generation)
quote — AST quasiquotation for constructing syntax trees from inline code
type_traits — compile-time type introspection and manipulation macros
typemacro_boost — type macro and template structure support infrastructure
dynamic_cast_rtti — runtime dynamic casting between class hierarchies
1.5. Functional and algorithms
functional — higher-order functions:
filter,map,reduce,any,all,flatten,sortedalgorithm — binary search, topological sort, set operations on tables, array utilities
sort_boost — custom comparator support for the built-in
sortlinq — LINQ-style query operations: select, where, order, group, join, aggregate, set operations
linq_boost — macro support for LINQ query syntax
1.6. Data structures
flat_hash_table — open-addressing flat hash table template
cuckoo_hash_table — cuckoo hash table with O(1) worst-case lookup
bool_array — packed boolean array (
BoolArray) backed byuint[]storagelinked_list — intrusive doubly-linked list data structure
soa — Structure of Arrays transformation for cache-friendly data layout
1.7. Serialization and data
archive — general-purpose binary serialization framework with
Serializer/Archivepatternjson — JSON parser and writer (
JsValuevariant,read_json,write_json)json_boost — automatic struct ↔ JSON conversion via reflection
1.8. Jobs and concurrency
jobque — job queue primitives: channels, job status, lock boxes, atomics
jobque_boost —
new_job/new_threadhelpers, channel iterationapply_in_context — cross-context function evaluation helpers
async_boost — async/await coroutine macros using job queues
1.9. Macros and metaprogramming
templates —
decltypemacro and[template]function annotationtemplates_boost — template application helpers: variable/type replacement, hygienic names
macro_boost — miscellaneous macro manipulation utilities
contracts — function argument contract annotations (
[expect_any_array],[expect_any_table], etc.)apply —
applyreflection pattern for struct field iterationenum_trait — compile-time enumeration trait queries
constexpr — constant expression detection and substitution macro
bitfield_boost — operator overloads for bitfield types
bitfield_trait — reflection utilities for bitfield names and values
consume —
consumepattern for move-ownership argument passinggeneric_return —
[generic_return]annotation for return type instantiationremove_call_args — AST transformation to remove specified call arguments
class_boost — macros for extending class functionality and method binding
1.10. Control flow macros
defer —
deferanddefer_delete— execute code at scope exitif_not_null —
if_not_nullsafe-access macrosafe_addr —
safe_addrandtemp_ptr— safe temporary pointer macrosstatic_let —
static_let— variables initialized once and persisted across callslpipe — left-pipe operator macro (
<|)is_local —
is_local_expr/is_scope_exprAST query helpersassert_once —
assert_once— assertion that fires only on first failureunroll — compile-time loop unrolling macro
instance_function —
[instance_function]annotation for struct method bindingarray_boost —
temp_array,array_view, andemptyhelpersheartbeat — periodic heartbeat callback injection
1.12. Entity component system
decs — DECS (Daslang Entity Component System): archetypes, components, queries, staged updates
decs_boost — DECS macro support for query syntax
decs_state — DECS state machine support for entity lifecycle
1.13. OOP and interfaces
coroutines — coroutine runner (
cr_run,cr_run_all) and generator macros (yield_from)interfaces —
[interface]and[implements]annotations for interface-based polymorphismcpp_bind — C++ class adapter binding code generator
1.14. Testing and debugging
faker — random test data generator: strings, numbers, dates
fuzzer — function fuzzing framework
coverage — code coverage instrumentation and reporting
profiler — instrumenting CPU profiler for function-level timing
profiler_boost — profiler cross-context helpers and high-level macros
debug_eval — runtime expression evaluation for interactive debugging
dap — Debug Adapter Protocol (DAP) data structures for debugger integration
1.15. Code quality and tooling
lint — static analysis pass for common code issues
lint_everything — global lint pass applying paranoid diagnostics to all modules
validate_code — AST validation annotations for custom code checks
refactor — automated code refactoring transformations
1.16. Developer tools
das_source_formatter — daslang source code formatter
das_source_formatter_fio — file-based source code formatting
rst — RST documentation generator used to produce this reference