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 time

  • base64 — 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, sorted

  • algorithm — binary search, topological sort, set operations on tables, array utilities

  • sort_boost — custom comparator support for the built-in sort

  • linq — 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 by uint[] storage

  • linked_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 / Archive pattern

  • json — JSON parser and writer (JsValue variant, 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_boostnew_job / new_thread helpers, channel iteration

  • apply_in_context — cross-context function evaluation helpers

  • async_boost — async/await coroutine macros using job queues

1.9. Macros and metaprogramming

  • templatesdecltype macro and [template] function annotation

  • templates_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.)

  • applyapply reflection pattern for struct field iteration

  • enum_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

  • consumeconsume pattern for move-ownership argument passing

  • generic_return[generic_return] annotation for return type instantiation

  • remove_call_args — AST transformation to remove specified call arguments

  • class_boost — macros for extending class functionality and method binding

1.10. Control flow macros

  • deferdefer and defer_delete — execute code at scope exit

  • if_not_nullif_not_null safe-access macro

  • safe_addrsafe_addr and temp_ptr — safe temporary pointer macros

  • static_letstatic_let — variables initialized once and persisted across calls

  • lpipe — left-pipe operator macro (<|)

  • is_localis_local_expr / is_scope_expr AST query helpers

  • assert_onceassert_once — assertion that fires only on first failure

  • unroll — compile-time loop unrolling macro

  • instance_function[instance_function] annotation for struct method binding

  • array_boosttemp_array, array_view, and empty helpers

  • heartbeat — periodic heartbeat callback injection

1.11. Pattern matching

  • matchmatch macro for structural pattern matching on variants and values

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 polymorphism

  • cpp_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