Daslang Standard Library 0.6.2
Copyright (c) 2018-2026 Gaijin Entertainment Authors: Anton Yudintsev, Boris Batkin
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- 1. Introduction
- 1.1. Core runtime
- 1.2. Strings
- 1.3. Regular expressions and parsing
- 1.4. Reflection and AST
- 1.5. Functional and algorithms
- 1.6. Data structures
- 1.7. Serialization and data
- 1.8. Jobs and concurrency
- 1.9. Macros and metaprogramming
- 1.10. Control flow macros
- 1.11. Pattern matching
- 1.12. Entity component system
- 1.13. OOP and interfaces
- 1.14. Testing and debugging
- 1.15. Code quality and tooling
- 1.16. Developer tools
- 1.17. HTTP and WebSocket
- 1.18. XML
- 1.19. Image
- 1.20. Audio
- 2. Core
- 2.1. Built-in runtime
- 2.1.1. Type aliases
- 2.1.2. Constants
- 2.1.3. Handled structures
- 2.1.4. Function annotations
- 2.1.5. Call macros
- 2.1.6. Reader macros
- 2.1.7. Typeinfo macros
- 2.1.8. Handled types
- 2.1.9. Structure macros
- 2.1.10. Containers
- 2.1.11. das::string manipulation
- 2.1.12. Heap reporting
- 2.1.13. GC0 infrastructure
- 2.1.14. Smart ptr infrastructure
- 2.1.15. Macro infrastructure
- 2.1.16. Profiler
- 2.1.17. System infrastructure
- 2.1.18. Memory manipulation
- 2.1.19. Binary serializer
- 2.1.20. Path and command line
- 2.1.21. Time and date
- 2.1.22. Platform queries
- 2.1.23. String formatting
- 2.1.24. Argument consumption
- 2.1.25. Lock checking
- 2.1.26. Bit operations
- 2.1.27. Intervals
- 2.1.28. RTTI
- 2.1.29. Initialization and finalization
- 2.1.30. Algorithms
- 2.1.31. Memset
- 2.1.32. Malloc
- 2.1.33. Compilation and AOT
- 2.1.34. GC
- 2.2. Math library
- 2.2.1. Constants
- 2.2.2. Handled structures
- 2.2.3. all numerics (uint*, int*, float*, double)
- 2.2.4. float* and double
- 2.2.5. float* only
- 2.2.6. float3 only
- 2.2.7. float2, float3, float4
- 2.2.8. Noise functions
- 2.2.9. lerp/mad/clamp
- 2.2.10. Matrix operations
- 2.2.11. Matrix initializers
- 2.2.12. Matrix manipulation
- 2.2.13. Quaternion operations
- 2.2.14. Packing and unpacking
- 2.3. Math bit helpers
- 2.4. Boost package for math
- 2.5. Random generator library
- 2.1. Built-in runtime
- 3. Strings
- 3.1. String manipulation library
- 3.1.1. Enumerations
- 3.1.2. Handled structures
- 3.1.3. Character set
- 3.1.4. Character groups
- 3.1.5. Character by index
- 3.1.6. String properties
- 3.1.7. String builder
- 3.1.8. das::string manipulation
- 3.1.9. String modifications
- 3.1.10. Search substrings
- 3.1.11. String comparison
- 3.1.12. String conversion routines
- 3.1.13. String as array
- 3.1.14. Low level memory allocation
- 3.2. Boost package for string manipulation library
- 3.3. Soft-failing string-to-numeric conversions returning Result<T; ConversionError>
- 3.4. Temporary string utilities
- 3.5. UTF-8 utilities
- 3.6. Base64 encoding and decoding
- 3.7. Long string embedding macro
- 3.1. String manipulation library
- 4. I/O and Serialization
- 4.1. File input output library
- 4.2. Network socket library
- 4.3. HTTP and WebSocket library (libhv)
- 4.3.1. Enumerations
- 4.3.2. Handled structures
- 4.3.3. Handled types
- 4.3.4. WebSocket client
- 4.3.5. WebSocket server lifecycle
- 4.3.6. WebSocket channel send
- 4.3.7. Handle operations
- 4.3.8. HTTP route registration
- 4.3.9. HTTP server configuration
- 4.3.10. HTTP response helpers
- 4.3.11. HTTP client requests
- 4.3.12. Message and header access
- 4.3.13. Request configuration
- 4.3.14. Cookies
- 4.3.15. Form data
- 4.3.16. SSE response writer
- 4.4. High-level HTTP and WebSocket wrappers
- 4.5. URI manipulation library based on UriParser
- 4.6. Boost package for the URI parser
- 4.7. ANSI terminal color and style helpers
- 4.8. General purpose serialization
- 4.9. Command-line utilities
- 5. Data Structures
- 5.1. Boost package for array manipulation
- 5.2. Boost package for the builtin sort
- 5.3. Flat hash table
- 5.4. Cuckoo hash table
- 5.5. SOA (Structure of Arrays) transformation
- 5.6. Packed boolean array
- 5.7. Monadic Option<T> — a value-or-nothing tagged pair
- 5.8. Monadic Result<T, E> — a value-or-error tagged pair
- 6. Algorithms and Functional
- 6.1. Miscellaneous algorithms
- 6.2. Functional programming library
- 6.3. LINQ
- 6.3.1. Sorting data
- 6.3.2. Set operations
- 6.3.3. Concatenation operations
- 6.3.4. Generation operations
- 6.3.5. Aggregation operations
- 6.3.6. Filtering data
- 6.3.7. Partitioning data
- 6.3.8. Joining
- 6.3.9. Grouping
- 6.3.10. Querying data
- 6.3.11. Element operations
- 6.3.12. Transform operations
- 6.3.13. Conversion operations
- 6.3.14. Comparators and keys
- 6.4. Boost module for LINQ
- 6.5. Pattern matching
- 7. Data Formats
- 7.1. JSON manipulation library
- 7.2. Boost package for JSON
- 7.3. XML parser (pugixml)
- 7.3.1. Constants
- 7.3.2. Enumerations
- 7.3.3. Handled structures
- 7.3.4. Document operations
- 7.3.5. Node lookup
- 7.3.6. Node navigation
- 7.3.7. Node mutation
- 7.3.8. Attribute access
- 7.3.9. Copy and move
- 7.3.10. Value reading
- 7.3.11. Value writing
- 7.3.12. XPath compilation and evaluation
- 7.3.13. XPath selection
- 7.3.14. XPath node set operations
- 7.3.15. Construction and RAII
- 7.3.16. Handle validity and comparison
- 7.4. High-level XML helpers (pugixml boost)
- 7.5. Regular expression library
- 7.6. Boost package for REGEX
- 7.7. PEG parser generator
- 7.8. Documentation generator
- 8. Entity Component System
- 9. Concurrency
- 10. AST and Macros
- 10.1. Runtime type information library
- 10.1.1. Type aliases
- 10.1.2. Constants
- 10.1.3. Enumerations
- 10.1.4. Handled structures
- 10.1.5. Typeinfo macros
- 10.1.6. Handled types
- 10.1.7. Initialization and finalization
- 10.1.8. Type access
- 10.1.9. Rtti context access
- 10.1.10. Program access
- 10.1.11. Module access
- 10.1.12. Annotation access
- 10.1.13. Compilation and simulation
- 10.1.14. File access
- 10.1.15. Structure access
- 10.1.16. Data walking and printing
- 10.1.17. Function and mangled name hash
- 10.1.18. Context and mutex locking
- 10.1.19. Runtime data access
- 10.1.20. Tuple and variant access
- 10.1.21. Iteration
- 10.2. AST manipulation library
- 10.2.1. Type aliases
- 10.2.2. Enumerations
- 10.2.3. Handled structures
- 10.2.4. Call macros
- 10.2.5. Typeinfo macros
- 10.2.6. Handled types
- 10.2.7. Classes
- 10.2.8. Call generation
- 10.2.9. Visitor pattern
- 10.2.10. Expression generation
- 10.2.11. Adapter generation
- 10.2.12. Adapter application
- 10.2.13. Adding objects to objects
- 10.2.14. Program and module access
- 10.2.15. Textual descriptions of the objects
- 10.2.16. Searching
- 10.2.17. Iterating
- 10.2.18. Cloning
- 10.2.19. Mangled name
- 10.2.20. Size and offset
- 10.2.21. Evaluations
- 10.2.22. Error reporting
- 10.2.23. Location and context
- 10.2.24. Use queries
- 10.2.25. Log
- 10.2.26. Removal
- 10.2.27. Properties
- 10.2.28. Infer
- 10.2.29. Module queries
- 10.2.30. Debug info helpers
- 10.2.31. AOT support
- 10.2.32. String builder writer
- 10.2.33. GC
- 10.3. Boost package for the AST
- 10.3.1. Type aliases
- 10.3.2. Function annotations
- 10.3.3. Variant macros
- 10.3.4. Structure macros
- 10.3.5. Classes
- 10.3.6. Containers
- 10.3.7. Textual descriptions of the objects
- 10.3.8. Queries
- 10.3.9. Annotations
- 10.3.10. Expression generation
- 10.3.11. Type generation
- 10.3.12. Type casts
- 10.3.13. Setup
- 10.4. decltype macro and template function annotation
- 10.5. Template application helpers
- 10.5.1. Structures
- 10.5.2. Call macros
- 10.5.3. Template rules
- 10.5.4. Template application
- 10.5.5. Expression helpers
- 10.5.6. Expression generation
- 10.5.7. Block helpers
- 10.5.8. Global variable helpers
- 10.5.9. Hygienic names
- 10.5.10. Quoting macros
- 10.5.11. Type pointer helpers
- 10.5.12. Structure helpers
- 10.5.13. Class generation
- 10.6. AST quasiquoting infrastructure
- 10.7. Boost package for macro manipulations
- 10.8. Type macro and template structure support
- 10.9. DECS, AST block to loop
- 10.10. Position-based AST queries
- 10.11. AST type usage collection
- 10.12. AST pattern matching
- 10.12.1. Enumerations
- 10.12.2. Structures
- 10.12.3. Call macros
- 10.12.4. Match execution
- 10.12.5. Result builders
- 10.12.6. Value extraction
- 10.12.7. Name and type extraction
- 10.12.8. Argument filtering
- 10.12.9. Block scanning
- 10.12.10. Constant construction
- 10.12.11. AST reconstruction
- 10.12.12. AST normalization
- 10.13. Constant expression checker and substitution
- 10.1. Runtime type information library
- 11. Annotations and Contracts
- 11.1. Miscellaneous contract annotations
- 11.2. Apply reflection pattern
- 11.3. defer and defer_delete macros
- 11.4. if_not_null macro
- 11.5. is_local_xxx ast helpers
- 11.6. safe_addr macro
- 11.7. static_let macro
- 11.8. lpipe macro
- 11.9. Assert once
- 11.10. Loop unrolling
- 11.11. Bitfield operator overloads
- 11.12. Bitfield name traits
- 11.13. Enumeration traits
- 11.14. Type trait macros
- 11.15. C++ bindings generator
- 12. Classes and Interfaces
- 13. Testing and Debugging
- 14. Code Quality and Refactoring
- 15. Image and Font Processing
- 15.1. Image loading, writing, and resizing (stb_image)
- 15.2. High-level image API (stbimage_boost)
- 15.3. Raster operations (pixel copy, convert, SIMD gather/scatter)
- 15.3.1. Gather
- 15.3.2. Scatter
- 15.3.3. Scatter with mask
- 15.3.4. Store with mask
- 15.3.5. Gather-scatter
- 15.3.6. Gather-scatter with mask
- 15.3.7. Gather-store with mask
- 15.3.8. Gather-store with stride
- 15.3.9. Byte gather-store
- 15.3.10. Copy reversed
- 15.3.11. Copy rect
- 15.3.12. Channel conversion
- 15.3.13. BPC conversion
- 15.3.14. Span raster
- 15.3.15. Fill rect
- 15.3.16. Alpha blit
- 15.4. TrueType font loading and rasterization (stb_truetype)
- 15.5. TrueType font API (stbimage_ttf)
- 15.5.1. Structures
- 15.5.2. Low-level initialization
- 15.5.3. Low-level scale
- 15.5.4. Low-level metrics
- 15.5.5. Low-level glyph shape
- 15.5.6. Low-level bitmap rendering
- 15.5.7. Low-level packing
- 15.5.8. Font loading
- 15.5.9. Font scale
- 15.5.10. Font metrics
- 15.5.11. Font glyph shape
- 15.5.12. Font bitmap rendering
- 15.5.13. Text measurement and rendering
- 16. Audio and MIDI
- 16.1. Low-level audio bindings (miniaudio)
- 16.1.1. Constants
- 16.1.2. Enumerations
- 16.1.3. Handled structures
- 16.1.4. Audio device
- 16.1.5. Decoder
- 16.1.6. Resampler
- 16.1.7. Channel converter
- 16.1.8. Volume mixer
- 16.1.9. Limiter
- 16.1.10. HRTF
- 16.1.11. I3DL2 Reverb
- 16.1.12. Convolution Reverb
- 16.1.13. Chorus
- 16.1.14. Delay
- 16.1.15. Per-voice effects
- 16.1.16. SF2 voice
- 16.2. Audio playback, mixing, 3D spatial audio, and effects
- 16.2.1. Type aliases
- 16.2.2. Constants
- 16.2.3. Enumerations
- 16.2.4. Structures
- 16.2.5. Audio system lifecycle
- 16.2.6. Sound playback
- 16.2.7. Sound control
- 16.2.8. 3D audio
- 16.2.9. Reverb
- 16.2.10. Chorus
- 16.2.11. Attenuation
- 16.2.12. Status monitoring
- 16.2.13. Command batching
- 16.2.14. PCM stream
- 16.2.15. Decoding
- 16.2.16. Sound ID
- 16.2.17. Internal stream management
- 16.3. WAV file reading and writing
- 16.1. Low-level audio bindings (miniaudio)
- 17. Strudel (Live Coding)
- 17.1. Event payload and ADSR/delay-time resolvers
- 17.2. Cycle-space time primitives: TimeSpan, Hap, and cycle helpers
- 17.3. Pattern algebra, combinators, and fluent control API
- 17.3.1. Type aliases
- 17.3.2. Pattern construction
- 17.3.3. Time manipulation
- 17.3.4. Combinators
- 17.3.5. Setter primitives
- 17.3.6. Fluent control: dynamics and routing
- 17.3.7. Fluent control: 3D positioning (HRTF)
- 17.3.8. Fluent control: effects sends
- 17.3.9. Fluent control: filters
- 17.3.10. Fluent control: envelope
- 17.3.11. Fluent control: synthesis and shaping
- 17.3.12. Fluent control: modulation FX
- 17.3.13. Fluent control: SF2
- 17.3.14. Signals
- 17.4. Mini-notation tokenizer, parser, and fluent-DSL entry points
- 17.5. Musical scales and note-name helpers
- 17.6. Audio synthesis: oscillators, drums, filters, and effects
- 17.7. Sample bank and audio file loading
- 17.8. Voice allocation, effect bus routing, and per-tick mixing
- 17.9. Top-level playback harness: tracks, BPM/CPS, and threaded audio
- 17.10. MIDI file parser
- 17.11. MIDI file playback with GM preset mapping
- 17.12. SoundFont 2 file parser
- 17.13. SoundFont 2 per-voice runtime: envelope, LFO, modulators, biquad
- 17.14. Live-reload state preservation