Daslang documentation Logo
0.6.4
  • Getting Started
    • Build the compiler
    • Hello, world
    • Editor support: VSCode
    • AI assistants: MCP server
    • AI assistants: LSP server
    • Next steps
  • Daslang 0.6.4 Reference Manual
    • 1. Introduction
      • 1.1. Performance.
      • 1.2. How it looks?
      • 1.3. Generic programming and type system
      • 1.4. Compilation time macros
      • 1.5. Features
    • 2. Design Philosophy
      • 2.1. Origins
      • 2.2. Audience
      • 2.3. Core Design Principles
      • 2.4. Performance Model
      • 2.5. Type System
      • 2.6. Syntax: Gen1 and Gen2
      • 2.7. AI-Driven Syntax Evolution
      • 2.8. Embedding and Beyond
      • 2.9. The Rename: daScript to daslang
      • 2.10. Competitive Landscape
      • 2.11. Summary
    • 3. The language
      • 3.1. Program Structure
        • 3.1.1. File Layout
        • 3.1.2. Module Declaration
        • 3.1.3. Require Declaration
        • 3.1.4. Options Declaration
        • 3.1.5. Top-Level Declarations
        • 3.1.6. Visibility
        • 3.1.7. Entry Points
        • 3.1.8. Expect Declaration
        • 3.1.9. Program vs. Module
        • 3.1.10. Execution Lifecycle
        • 3.1.11. Complete Example
      • 3.2. Lexical Structure
        • 3.2.1. Identifiers
        • 3.2.2. Keywords
        • 3.2.3. Operators
        • 3.2.4. Other Tokens
        • 3.2.5. Literals
        • 3.2.6. Comments
        • 3.2.7. Automatic Semicolons
      • 3.3. Values and Data Types
        • 3.3.1. Integer
        • 3.3.2. Float
        • 3.3.3. Bool
        • 3.3.4. String
        • 3.3.5. Type Conversion and Casting
        • 3.3.6. Table
        • 3.3.7. Array
        • 3.3.8. Struct
        • 3.3.9. Classes
        • 3.3.10. Variant
        • 3.3.11. Tuple
        • 3.3.12. Enumeration
        • 3.3.13. Bitfield
        • 3.3.14. Function
        • 3.3.15. Reference
        • 3.3.16. Pointers
        • 3.3.17. Smart Pointers
        • 3.3.18. Iterators
      • 3.4. Pointers
        • 3.4.1. Pointer types
        • 3.4.2. Creating pointers
        • 3.4.3. Dereferencing
        • 3.4.4. Null safety
        • 3.4.5. Deletion
        • 3.4.6. Pointer arithmetic
        • 3.4.7. Const widening when passing args
        • 3.4.8. Void pointers
        • 3.4.9. intptr
        • 3.4.10. reinterpret
        • 3.4.11. Type info
        • 3.4.12. Summary
      • 3.5. Constants, Enumerations, Global variables
        • 3.5.1. Constant
        • 3.5.2. Global variable
        • 3.5.3. Enumeration
      • 3.6. Statements
        • 3.6.1. Visibility Block
        • 3.6.2. Control Flow Statements
        • 3.6.3. Ranged Loops
        • 3.6.4. break
        • 3.6.5. continue
        • 3.6.6. return
        • 3.6.7. yield
        • 3.6.8. pass
        • 3.6.9. finally
        • 3.6.10. Local Variable Declarations
        • 3.6.11. assume
        • 3.6.12. with
        • 3.6.13. delete
        • 3.6.14. Function Declaration
        • 3.6.15. try/recover
        • 3.6.16. panic
        • 3.6.17. label and goto
        • 3.6.18. Expression Statement
        • 3.6.19. Global Variables
        • 3.6.20. enum
        • 3.6.21. typedef
      • 3.7. Expressions
        • 3.7.1. Assignment
        • 3.7.2. Operators
        • 3.7.3. Array Initializer
        • 3.7.4. Struct, Class, and Handled Type Initializer
        • 3.7.5. Tuple Initializer
        • 3.7.6. Variant Initializer
        • 3.7.7. Table Initializer
        • 3.7.8. default and new
        • 3.7.9. typeinfo
        • 3.7.10. String Interpolation
      • 3.8. Function
        • 3.8.1. Function declaration
        • 3.8.2. OOP-style calls
        • 3.8.3. Tail Recursion
        • 3.8.4. Operator Overloading
        • 3.8.5. Overloadable operators
        • 3.8.6. Unary operators
        • 3.8.7. Compound assignment operators
        • 3.8.8. Index operators
        • 3.8.9. Clone and finalize operators
        • 3.8.10. is, as, and ?as operators
        • 3.8.11. Null-coalesce operator
        • 3.8.12. Struct method operators
        • 3.8.13. Overloading the ‘.’ and ‘?.’ operators
        • 3.8.14. Overloading accessors
      • 3.9. Block
      • 3.10. Lambda
        • 3.10.1. Capture
        • 3.10.2. Iterators
        • 3.10.3. Implementation details
      • 3.11. Generator
        • 3.11.1. implementation details
      • 3.12. Struct
        • 3.12.1. Struct Declaration
        • 3.12.2. Structure Function Members
        • 3.12.3. Inheritance
        • 3.12.4. Alignment
        • 3.12.5. OOP implementation details
      • 3.13. Class
        • 3.13.1. Member Visibility
        • 3.13.2. Initializers
        • 3.13.3. Calling Parent Methods
        • 3.13.4. Runtime Type Checking (is)
        • 3.13.5. Type Casting (as, ?as)
        • 3.13.6. Class Templates
        • 3.13.7. Static methods with [class_method]
        • 3.13.8. Stack-Allocated Classes (using)
        • 3.13.9. Complete Example
        • 3.13.10. Implementation details
      • 3.14. Tuple
        • 3.14.1. Shorthand promotion
      • 3.15. Variant
        • 3.15.1. Alignment and data layout
      • 3.16. Bitfield
      • 3.17. Type Aliases
        • 3.17.1. typedef Declaration
        • 3.17.2. Publicity
        • 3.17.3. Shorthand Type Alias Syntax
        • 3.17.4. Local Type Aliases
        • 3.17.5. Generic Type Aliases (auto)
        • 3.17.6. Type Aliases with typedecl
      • 3.18. Distinct Types
        • 3.18.1. Construction and Deref
        • 3.18.2. Operators
        • 3.18.3. Overloads
        • 3.18.4. Modules and Privacy
        • 3.18.5. Runtime Erasure
        • 3.18.6. C++ Integration
      • 3.19. Array
      • 3.20. Table
      • 3.21. Iterator
        • 3.21.1. Making types iterable
        • 3.21.2. builtin iterators
        • 3.21.3. builtin iteration functions
        • 3.21.4. low level builtin iteration functions
        • 3.21.5. next implementation details
      • 3.22. Comprehension
      • 3.23. String Builder
        • 3.23.1. Basic Usage
        • 3.23.2. Supported Types
        • 3.23.3. Format Specifiers
        • 3.23.4. Escaping Curly Brackets
        • 3.23.5. Multi-line Strings
        • 3.23.6. Implementation Notes
        • 3.23.7. Relationship to print
      • 3.24. Modules
        • 3.24.1. File-path requires
        • 3.24.2. Optional requires
        • 3.24.3. Native modules
        • 3.24.4. Builtin modules
        • 3.24.5. Shared modules
        • 3.24.6. Module function visibility
      • 3.25. Move, Copy, and Clone
        • 3.25.1. Copy (=)
        • 3.25.2. Move (<-)
        • 3.25.3. Clone (:=)
        • 3.25.4. Type Compatibility
        • 3.25.5. Variable Initialization
        • 3.25.6. Struct Initialization
        • 3.25.7. Lambda Captures
        • 3.25.8. Containers
        • 3.25.9. Classes
        • 3.25.10. Custom Clone
        • 3.25.11. Quick Reference
      • 3.26. Clone
        • 3.26.1. Cloning rules and implementation details
        • 3.26.2. clone_to_move implementation
      • 3.27. Finalizer
        • 3.27.1. Rules and implementation details
      • 3.28. Temporary types
      • 3.29. Unsafe
        • 3.29.1. implicit
        • 3.29.2. other cases
      • 3.30. Generic Programming
        • 3.30.1. typeinfo
        • 3.30.2. auto and auto(named)
        • 3.30.3. type contracts and type operations
        • 3.30.4. options
        • 3.30.5. typedecl
        • 3.30.6. generic tuples and type<> expressions
      • 3.31. Pattern matching
        • 3.31.1. Enumeration Matching
        • 3.31.2. Matching Variants
        • 3.31.3. Declaring Variables in Patterns
        • 3.31.4. Matching Structs
        • 3.31.5. Using Guards
        • 3.31.6. Tuple Matching
        • 3.31.7. Matching Static Arrays
        • 3.31.8. Dynamic Array Matching
        • 3.31.9. Match Expressions
        • 3.31.10. Matching with ||
        • 3.31.11. [match_as_is] Structure Annotation
        • 3.31.12. [match_copy] Structure Annotation
        • 3.31.13. Matching AST Nodes
        • 3.31.14. Static Matching
        • 3.31.15. match_type
        • 3.31.16. Multi-Match
      • 3.32. Annotations
        • 3.32.1. Function Annotations
        • 3.32.2. Structure and Class Annotations
        • 3.32.3. Macro Registration Annotations (daslib)
        • 3.32.4. Contract Annotations (daslib)
        • 3.32.5. Annotation Syntax Details
      • 3.33. Options
        • 3.33.1. Language and Syntax
        • 3.33.2. Lint Control
        • 3.33.3. Optimization
        • 3.33.4. Memory
        • 3.33.5. AOT
        • 3.33.6. Safety and Strictness
        • 3.33.7. Multiple Contexts
        • 3.33.8. Debugging and Profiling
        • 3.33.9. RTTI
        • 3.33.10. Logging
        • 3.33.11. Print Control
        • 3.33.12. Miscellaneous
        • 3.33.13. Module-Registered Options
      • 3.34. Macros
        • 3.34.1. Compilation passes
        • 3.34.2. Invoking macros
        • 3.34.3. AstFunctionAnnotation
        • 3.34.4. AstBlockAnnotation
        • 3.34.5. AstStructureAnnotation
        • 3.34.6. AstEnumerationAnnotation
        • 3.34.7. AstVariantMacro
        • 3.34.8. AstReaderMacro
        • 3.34.9. AstCallMacro
        • 3.34.10. AstPassMacro
        • 3.34.11. AstTypeMacro
        • 3.34.12. AstTypeInfoMacro
        • 3.34.13. AstForLoopMacro
        • 3.34.14. AstCaptureMacro
        • 3.34.15. AstCommentReader
        • 3.34.16. AstSimulateMacro
        • 3.34.17. AstVisitor
      • 3.35. Reification
        • 3.35.1. Simple example
        • 3.35.2. Quote macros
        • 3.35.3. Escape sequences
      • 3.36. AST Matching
        • 3.36.1. Simple example
        • 3.36.2. Macros
        • 3.36.3. Tags
        • 3.36.4. Wildcards
        • 3.36.5. Type matching
        • 3.36.6. Constant constructors and folding
        • 3.36.7. Generic function matching
        • 3.36.8. Result type
      • 3.37. Built-in Functions
        • 3.37.1. Invocation
        • 3.37.2. Assertions
        • 3.37.3. Debug
        • 3.37.4. Panic
        • 3.37.5. Memory & Type Utilities
        • 3.37.6. Array Operations
        • 3.37.7. Table Operations
        • 3.37.8. Iterator Operations
        • 3.37.9. Conversion Functions
        • 3.37.10. Clone
        • 3.37.11. Lock Operations
        • 3.37.12. Serialization
        • 3.37.13. Smart Pointer
        • 3.37.14. Memory Mapping
        • 3.37.15. Vector Construction
        • 3.37.16. Move Helpers
        • 3.37.17. Miscellaneous
      • 3.38. Lint Tools
        • 3.38.1. Quick start
        • 3.38.2. Standalone utility
        • 3.38.3. Suppressing specific warnings
        • 3.38.4. Repo-level .lint_config
        • 3.38.5. Important notes
        • 3.38.6. Paranoid rules
        • 3.38.7. Performance rules
        • 3.38.8. Style rules
        • 3.38.9. Tests
    • 4. The Runtime
      • 4.1. Context
        • 4.1.1. Initialization and shutdown
        • 4.1.2. Macro contexts
        • 4.1.3. Locking
        • 4.1.4. Lookups
        • 4.1.5. Memory allocation and garbage collection
      • 4.2. Locks
        • 4.2.1. Context locks
        • 4.2.2. Array and Table locks
      • 4.3. Very safe context
        • 4.3.1. The problem: aliased references
        • 4.3.2. What very_safe_context does
        • 4.3.3. Iteration and container moves
      • 4.4. Type Mangling
        • 4.4.1. Primitive types
        • 4.4.2. Qualifiers and modifiers
        • 4.4.3. Pointers
        • 4.4.4. Composite prefixes
        • 4.4.5. Container types
        • 4.4.6. Fixed-size arrays (dim)
        • 4.4.7. Callable types
        • 4.4.8. Structures, handled types, and enumerations
        • 4.4.9. Type aliases
        • 4.4.10. Named arguments
        • 4.4.11. Bitfields
        • 4.4.12. Special / internal types
        • 4.4.13. Remove-qualifiers (generics)
        • 4.4.14. Interop function signatures
        • 4.4.15. Querying mangled names at runtime
    • 5. Embedding and Integration
      • 5.1. Quick Start
        • 5.1.1. Virtual machine overview
        • 5.1.2. Minimal host program
        • 5.1.3. Key types
        • 5.1.4. Calling daslang functions with arguments
        • 5.1.5. Next steps
      • 5.2. C++ API Reference
        • 5.2.1. Creating a module
        • 5.2.2. Binding C++ types
        • 5.2.3. Cast infrastructure
        • 5.2.4. Binding C++ functions
        • 5.2.5. Binding C++ enumerations
        • 5.2.6. Function side effects
        • 5.2.7. Callbacks — blocks, functions, lambdas
        • 5.2.8. File access
        • 5.2.9. Project file resolution
      • 5.3. C API Reference
        • 5.3.1. When to use the C API
        • 5.3.2. Explicit-length strings
        • 5.3.3. Initialization and shutdown
        • 5.3.4. Text output
        • 5.3.5. Dynamic modules
        • 5.3.6. File access
        • 5.3.7. Compilation
        • 5.3.8. Simulation and context
        • 5.3.9. Function evaluation
        • 5.3.10. Argument helpers
        • 5.3.11. Calling lambdas and blocks
        • 5.3.12. Binding C functions
        • 5.3.13. Binding types
        • 5.3.14. String allocation
        • 5.3.15. Context variables
        • 5.3.16. Type introspection
        • 5.3.17. Serialization
        • 5.3.18. AOT checking
        • 5.3.19. Module groups
        • 5.3.20. Side effects
      • 5.4. External Modules
        • 5.4.1. Overview
        • 5.4.2. Module types
        • 5.4.3. The .das_module descriptor
        • 5.4.4. Module resolution order
        • 5.4.5. Building a C++ module
        • 5.4.6. Building a pure daslang module
        • 5.4.7. Using an external module from a host application
        • 5.4.8. Installing external modules
        • 5.4.9. Example: dascript-demo
        • 5.4.10. In-tree modules vs external modules
      • 5.5. Project Files (.das_project)
        • 5.5.1. How it works
        • 5.5.2. Using project files
        • 5.5.3. Writing a project file
        • 5.5.4. Callback reference
        • 5.5.5. Sandboxing example
      • 5.6. Advanced Topics
        • 5.6.1. AOT compilation
        • 5.6.2. Class adapters
        • 5.6.3. Coroutines (generators)
        • 5.6.4. Dynamic script generation
        • 5.6.5. Standalone contexts
        • 5.6.6. Serialization
        • 5.6.7. Sandboxing
        • 5.6.8. File access customization
    • 6. Writing GPU shaders in Daslang
      • 6.1. Overview
      • 6.2. Quick start: a compute shader
      • 6.3. Shader stages
      • 6.4. Resources and stage I/O
      • 6.5. Built-in variables
      • 6.6. Textures and storage images
      • 6.7. Type and layout mapping
      • 6.8. Supported language surface
      • 6.9. Reflection
        • 6.9.1. SPIR-V shader reflection (dasSpirv): API-neutral descriptor + push-constant layout, host-consumed
      • 6.10. Tutorials
    • 7. Utils
      • 7.1. daslang-live — Live-Reload Application Host
        • 7.1.1. Designing for live reload
        • 7.1.2. Quick start
        • 7.1.3. Mode detection
        • 7.1.4. Lifecycle
        • 7.1.5. Core API
        • 7.1.6. Reload annotations
        • 7.1.7. State persistence
        • 7.1.8. Helper modules
        • 7.1.9. Transports
        • 7.1.10. CLI reference
        • 7.1.11. Examples
        • 7.1.12. Tips and gotchas
      • 7.2. dastest — Test Framework
        • 7.2.1. Quick start
        • 7.2.2. Running tests
        • 7.2.3. Command-line arguments
        • 7.2.4. Writing tests
        • 7.2.5. Assertions
        • 7.2.6. Sub-tests
        • 7.2.7. Benchmarks
        • 7.2.8. Benchmark output formats
        • 7.2.9. Folder filtering with .das_test
        • 7.2.10. Test file conventions
      • 7.3. dascov — Code Coverage
        • 7.3.1. Quick start
        • 7.3.2. Usage modes
        • 7.3.3. Output formats
        • 7.3.4. Integration with dastest
        • 7.3.5. Programmatic use
      • 7.4. lint — Paranoid, Performance, and Style
        • 7.4.1. Quick start
        • 7.4.2. Flags
        • 7.4.3. Repo-level defaults
        • 7.4.4. Compile policies
        • 7.4.5. Rule list
        • 7.4.6. Suppression
        • 7.4.7. Planned CI gate
      • 7.5. daspkg — Package Manager
        • 7.5.1. Quick start
        • 7.5.2. Why daspkg?
        • 7.5.3. Commands
        • 7.5.4. Package sources
        • 7.5.5. The .das_package manifest
        • 7.5.6. Install flow
        • 7.5.7. Global modules
        • 7.5.8. Project layout
        • 7.5.9. Lock file
        • 7.5.10. Package index
        • 7.5.11. Use-case examples
        • 7.5.12. Version model
        • 7.5.13. Requirements
        • 7.5.14. Architecture
      • 7.6. MCP Server — AI Tool Integration
        • 7.6.1. Quick start
        • 7.6.2. Tools
        • 7.6.3. ast-grep / tree-sitter setup
        • 7.6.4. Architecture
        • 7.6.5. Protocol
        • 7.6.6. Configuring Claude Code permissions
      • 7.7. LSP Server — Editor & AI Diagnostics
        • 7.7.1. Quick start
        • 7.7.2. Diagnostics
        • 7.7.3. Navigation
        • 7.7.4. Configuration
        • 7.7.5. Architecture
        • 7.7.6. Tests
      • 7.8. detect-dupe — Cross-file similar-function detector
        • 7.8.1. What it reports
        • 7.8.2. Quick start
        • 7.8.3. Flags
        • 7.8.4. Pattern filter
        • 7.8.5. Canonical form
        • 7.8.6. Modes
        • 7.8.7. Export / import
        • 7.8.8. MCP integration
        • 7.8.9. Implementation
        • 7.8.10. Notes
        • 7.8.11. Out of scope
      • 7.9. find_dupe — AI judge for detect-dupe clusters
        • 7.9.1. Install
        • 7.9.2. API key
        • 7.9.3. Smoke test
        • 7.9.4. Workflow
        • 7.9.5. Flags
        • 7.9.6. Output schema
        • 7.9.7. MCP integration
        • 7.9.8. Pricing
        • 7.9.9. Implementation
        • 7.9.10. See also
      • 7.10. Profiler — Runtime Profiling
        • 7.10.1. Quick start — performance profiler
        • 7.10.2. Quick start — memory-leak tracker
        • 7.10.3. Enabling the profiler
        • 7.10.4. Command-line flags
        • 7.10.5. Performance mode details
        • 7.10.6. Memory-leak mode details
        • 7.10.7. Writing your own profiler agent
        • 7.10.8. Performance impact
        • 7.10.9. See also
      • 7.11. dasllama-server — an OpenAI-compatible server over dasLLAMA
        • 7.11.1. Run
        • 7.11.2. Per-box tuning
        • 7.11.3. Endpoints
        • 7.11.4. Testing
        • 7.11.5. Not yet implemented
      • 7.12. Memory Leak Detection — Diagnostics Cheat Sheet
        • 7.12.1. At a glance
        • 7.12.2. Picking the right tool
        • 7.12.3. 1. daslang leak profiler (--das-profiler-leaks)
        • 7.12.4. 2. C++ heap report (-track-allocations -heap-report)
        • 7.12.5. 3. gc_node leak detection (automatic)
        • 7.12.6. 4. Smart-pointer tracking (--track-smart-ptr <hexId>)
        • 7.12.7. 5. JobStatus / Channel / LockBox tracker
        • 7.12.8. 6. HandleRegistry (dasHV handle objects)
        • 7.12.9. See also
    • 8. Tutorials
      • 8.1. Language Tutorials
        • 8.1.1. Hello World
        • 8.1.2. Variables and Types
        • 8.1.3. Operators
        • 8.1.4. Control Flow
        • 8.1.5. Functions
        • 8.1.6. Arrays
        • 8.1.7. Strings
        • 8.1.8. Structs
        • 8.1.9. Enumerations and Bitfields
        • 8.1.10. Tables
        • 8.1.11. Tuples and Variants
        • 8.1.12. Function Pointers
        • 8.1.13. Blocks
        • 8.1.14. Lambdas and Closures
        • 8.1.15. Iterators and Generators
        • 8.1.16. Modules and Program Structure
        • 8.1.17. Move, Copy, and Clone
        • 8.1.18. Classes and Inheritance
        • 8.1.19. Generic Programming
        • 8.1.20. Lifetime and Cleanup
        • 8.1.21. Error Handling
        • 8.1.22. Unsafe and Pointers
        • 8.1.23. String Builder and Formatting
        • 8.1.24. Pattern Matching
        • 8.1.25. Annotations and Options
        • 8.1.26. Contracts
        • 8.1.27. Testing with dastest
        • 8.1.28. LINQ — Language-Integrated Query
        • 8.1.29. Functional Programming
        • 8.1.30. JSON
        • 8.1.31. Regular Expressions
        • 8.1.32. Operator Overloading
        • 8.1.33. Algorithm
        • 8.1.34. Entity Component System (DECS)
        • 8.1.35. Job Queue (jobque)
        • 8.1.36. Pointers
        • 8.1.37. Utility Patterns (defer + static_let)
        • 8.1.38. Random Numbers
        • 8.1.39. Dynamic Type Checking
        • 8.1.40. Coroutines
        • 8.1.41. Serialization (archive)
        • 8.1.42. Testing Tools (faker + fuzzer)
        • 8.1.43. Interfaces
        • 8.1.44. Compiling and Running Programs at Runtime
        • 8.1.45. Debug Agents
        • 8.1.46. Cross-Context Services with apply_in_context
        • 8.1.47. Data Walking with DapiDataWalker
        • 8.1.48. Compile-Time Field Iteration with apply
        • 8.1.49. Async / Await
        • 8.1.50. Structure-of-Arrays (SOA)
        • 8.1.51. Delegates
        • 8.1.52. Option<T> and Result<T, E>
        • 8.1.53. Command-Line Argument Parsing (clargs)
        • 8.1.54. Glob Pattern Matching
        • 8.1.55. LINQ over DECS
        • 8.1.56. C#-style LINQ query syntax (%linq!)
        • 8.1.57. TOML
        • 8.1.58. Logger
      • 8.2. Building from the Installed SDK
        • 8.2.1. Building Projects Against the Installed SDK
      • 8.3. C Integration Tutorials
        • 8.3.1. C Integration: Hello World
        • 8.3.2. C Integration: Calling daslang Functions
        • 8.3.3. C Integration: Binding C Types
        • 8.3.4. C Integration: Callbacks and Closures
        • 8.3.5. C Integration: Unaligned ABI & Advanced
        • 8.3.6. C Integration: Sandbox
        • 8.3.7. C Integration: Context Variables
        • 8.3.8. C Integration: Serialization
        • 8.3.9. C Integration: AOT
        • 8.3.10. C Integration: Threading
        • 8.3.11. C Integration: Type Introspection
        • 8.3.12. C Integration: Mock ECS
        • 8.3.13. C Integration: Shared Modules
        • 8.3.14. C Integration: Passing Arrays
        • 8.3.15. C Integration: Static StbImage Module
      • 8.4. C++ Integration Tutorials
        • 8.4.1. C++ Integration: Hello World
        • 8.4.2. C++ Integration: Calling Functions
        • 8.4.3. C++ Integration: Binding Functions
        • 8.4.4. C++ Integration: Binding Types
        • 8.4.5. C++ Integration: Binding Enumerations
        • 8.4.6. C++ Integration: Low-Level Interop
        • 8.4.7. C++ Integration: Callbacks
        • 8.4.8. C++ Integration: Binding Methods
        • 8.4.9. C++ Integration: Operators and Properties
        • 8.4.10. C++ Integration: Custom Modules
        • 8.4.11. C++ Integration: Context Variables
        • 8.4.12. C++ Integration: Smart Pointers
        • 8.4.13. C++ Integration: AOT Compilation
        • 8.4.14. C++ Integration: Serialization
        • 8.4.15. C++ Integration: Custom Annotations
        • 8.4.16. C++ Integration: Sandbox
        • 8.4.17. C++ Integration: Coroutines
        • 8.4.18. C++ Integration: Dynamic Scripts
        • 8.4.19. C++ Integration: Class Adapters
        • 8.4.20. C++ Integration: Standalone Contexts
        • 8.4.21. C++ Integration: Threading
        • 8.4.22. C++ Integration: Namespace Integration
        • 8.4.23. C++ Integration: Binding shared_ptr via Handle<T>
      • 8.5. Macro Tutorials
        • 8.5.1. Macro Tutorial 1: Call Macros
        • 8.5.2. Macro Tutorial 2: When Expression
        • 8.5.3. Macro Tutorial 3: Function Macros
        • 8.5.4. Macro Tutorial 4: Advanced Function Macros
        • 8.5.5. Macro Tutorial 5: Tag Function Macros
        • 8.5.6. Macro Tutorial 6: Structure Macros
        • 8.5.7. Macro Tutorial 7: Block Macros
        • 8.5.8. Macro Tutorial 8: Variant Macros
        • 8.5.9. Macro Tutorial 9: For-Loop Macros
        • 8.5.10. Macro Tutorial 10: Capture Macros
        • 8.5.11. Macro Tutorial 11: Reader Macros
        • 8.5.12. Macro Tutorial 12: Typeinfo Macros
        • 8.5.13. Macro Tutorial 13: Enumeration Macros
        • 8.5.14. Macro Tutorial 14: Pass Macro
        • 8.5.15. Macro Tutorial 15: Type Macro
        • 8.5.16. Macro Tutorial 16: Template Type Macro
        • 8.5.17. Macro Tutorial 17: Quasi-quotation Reference
        • 8.5.18. Macro Tutorial 18: with_ — locked binding of container slots
        • 8.5.19. Macro Tutorial 19: Custom module options
      • 8.6. dasHV (HTTP / WebSocket) Tutorials
        • 8.6.1. HV-01 — Simple HTTP Requests
        • 8.6.2. HV-02 — Advanced HTTP Requests
        • 8.6.3. HV-03 — HTTP Server Basics
        • 8.6.4. HV-04 — Advanced HTTP Server Features
        • 8.6.5. HV-05 — Cookies and Form / File Upload
        • 8.6.6. HV-06 — WebSockets
        • 8.6.7. HV-07 — SSE and Streaming
        • 8.6.8. HV-08 — HTTPS and WSS (TLS)
      • 8.7. dasLLAMA (CPU LLM Inference) Tutorials
        • 8.7.1. dasLLAMA-00 — The Problem Statement
        • 8.7.2. dasLLAMA-01 — Hello, Generation
        • 8.7.3. dasLLAMA-02 — Chat and Templates
        • 8.7.4. dasLLAMA-03 — Sampling
        • 8.7.5. dasLLAMA-04 — Sessions, the KV Cache, and Memory
        • 8.7.6. dasLLAMA-05 — Performance
        • 8.7.7. dasLLAMA-06 — The Architecture Registry
        • 8.7.8. dasLLAMA-07 — Speech to Text
        • 8.7.9. dasLLAMA-08 — Audio Chat
        • 8.7.10. dasLLAMA-09 — Embeddings
      • 8.8. dasOPENAI (OpenAI-compatible API) Tutorials
        • 8.8.1. OPENAI-01 — Your First Chat
        • 8.8.2. OPENAI-02 — Conversations and Parameters
        • 8.8.3. OPENAI-03 — Structured Outputs (JSON mode)
        • 8.8.4. OPENAI-04 — Tools and Function Calling
        • 8.8.5. OPENAI-05 — Embeddings and Models
        • 8.8.6. OPENAI-06 — Audio (Speech and Transcription)
        • 8.8.7. OPENAI-07 — Streaming Chat
        • 8.8.8. OPENAI-08 — Vision (Image Input)
        • 8.8.9. OPENAI-09 — Image Generation
        • 8.8.10. OPENAI-10 — Moderations
        • 8.8.11. OPENAI-11 — Legacy Completions
      • 8.9. dasPUGIXML (XML) Tutorials
        • 8.9.1. PUGIXML-01 — Parsing & Navigation
        • 8.9.2. PUGIXML-02 — Building XML
        • 8.9.3. PUGIXML-03 — XPath Queries
        • 8.9.4. PUGIXML-04 — Struct Serialization
        • 8.9.5. PUGIXML-05 — LINQ over XML
      • 8.10. dasStbImage (Image I/O) Tutorials
        • 8.10.1. STBIMAGE-01 — Loading and Inspecting Images
        • 8.10.2. STBIMAGE-02 — Saving and Encoding Images
        • 8.10.3. STBIMAGE-03 — Image Transforms
        • 8.10.4. STBIMAGE-04 — Pixel Access and Format Conversion
        • 8.10.5. STBIMAGE-05 — Drawing and Alpha Blending
        • 8.10.6. STBIMAGE-06 — TrueType Fonts
        • 8.10.7. STBIMAGE-07 — HDR Images
      • 8.11. dasSQLITE (SQL) Tutorials
        • 8.11.1. SQL-01 — Hello dasSQLITE
        • 8.11.2. SQL-02 — Declare a Table, Insert
        • 8.11.3. SQL-03 — Auto-Increment Primary Key
        • 8.11.4. SQL-04 — Reading Rows with _sql
        • 8.11.5. SQL-05 — Parameter Binding
        • 8.11.6. SQL-06 — Error Handling
        • 8.11.7. SQL-07 — Anatomy of _sql
        • 8.11.8. SQL-08 — _where Predicates: the Full Surface
        • 8.11.9. SQL-09 — _select Projections
        • 8.11.10. SQL-10 — _order_by and _order_by_descending
        • 8.11.11. SQL-11 — take and skip: Paging
        • 8.11.12. SQL-12 — distinct
        • 8.11.13. SQL-12b — Set operations
        • 8.11.14. SQL-13 — Aggregates: sum/avg/…
        • 8.11.15. SQL-14 — _group_by and _having
        • 8.11.16. SQL-15 — _join (inner equi-join)
        • 8.11.17. SQL-16 — All Join Shapes
        • 8.11.18. SQL-17 — Subqueries
        • 8.11.19. SQL-18 — NULL Handling: Option<T> Everywhere
        • 8.11.20. SQL-19 — UPDATE
        • 8.11.21. SQL-20 — DELETE
        • 8.11.22. SQL-21 — UPSERT
        • 8.11.23. SQL-22 — Transactions
        • 8.11.24. SQL-23 — Foreign keys
        • 8.11.25. SQL-24 — Indexes
        • 8.11.26. SQL-25 — Defaults + computed columns
        • 8.11.27. SQL-26 — Custom type adapters
        • 8.11.28. SQL-27 — BLOB round-trip
        • 8.11.29. SQL-28 — JSON and BLOB columns
        • 8.11.30. SQL-29 — Column metadata
        • 8.11.31. SQL-30 — Listing tables
        • 8.11.32. SQL-31 — Views
        • 8.11.33. SQL-32 — User-defined SQL scalar functions
        • 8.11.34. SQL-33 — PRAGMA tuning
        • 8.11.35. SQL-34 — Backup, VACUUM, integrity check
        • 8.11.36. SQL-35 — Streaming results with _each_sql
        • 8.11.37. SQL-36 — ATTACH DATABASE: cross-DB queries
        • 8.11.38. SQL-37 — Bulk operations: making writes fast
        • 8.11.39. SQL-38 — Concurrency: threads, contention
        • 8.11.40. SQL-39 — schema_from: struct mirrors the DB
        • 8.11.41. SQL-40 — FTS5 full-text search
        • 8.11.42. SQL-41 — Triggers: DB-level callbacks
        • 8.11.43. SQL-42 — multi-version ETL with schema_from
        • 8.11.44. SQL-43 — versioned schema migrations
      • 8.12. dasAudio (Audio) Tutorials
        • 8.12.1. AUDIO-01 — Hello Sound
        • 8.12.2. AUDIO-02 — Playing Audio Files
        • 8.12.3. AUDIO-03 — Sound Control
        • 8.12.4. AUDIO-04 — 3D Spatial Audio
        • 8.12.5. AUDIO-05 — Reverb and Effects
        • 8.12.6. AUDIO-06 — Streaming Audio
        • 8.12.7. AUDIO-07 — WAV File I/O
        • 8.12.8. AUDIO-08 — MIDI Files
        • 8.12.9. AUDIO-09 — Playback Status
        • 8.12.10. AUDIO-10 — Global Controls
        • 8.12.11. AUDIO-11 — Recording from the Microphone
      • 8.13. dasMinfft (FFT / DCT) Tutorials
        • 8.13.1. MINFFT-01 — Real FFT
        • 8.13.2. MINFFT-02 — DCT Basics
        • 8.13.3. MINFFT-03 — 2D DCT and JPEG Compression
      • 8.14. daStrudel (Live-Coding) Tutorials
        • 8.14.1. STRUDEL-01 — Hello Pattern
        • 8.14.2. STRUDEL-02 — Mini-Notation Fundamentals
        • 8.14.3. STRUDEL-03 — Mini-Notation Advanced
        • 8.14.4. STRUDEL-04 — Time Manipulation
        • 8.14.5. STRUDEL-05 — Euclidean Rhythms
        • 8.14.6. STRUDEL-06 — Stacking & Combining
        • 8.14.7. STRUDEL-07 — Per-Voice FX & Combinators
        • 8.14.8. STRUDEL-08 — Effects & Filters
        • 8.14.9. STRUDEL-09 — Signals & Modulation
        • 8.14.10. STRUDEL-10 — ADSR & Envelope Shaping
        • 8.14.11. STRUDEL-11 — Scales & Music Theory
        • 8.14.12. STRUDEL-12 — Synthesis
        • 8.14.13. STRUDEL-13 — Samples
        • 8.14.14. STRUDEL-14 — SF2 SoundFont Playback
        • 8.14.15. STRUDEL-15 — MIDI Files
        • 8.14.16. STRUDEL-16 — Live-Reloading Patterns
        • 8.14.17. STRUDEL-17 — HRTF: 3D Positional Override for Pan
        • 8.14.18. STRUDEL-18 — SFX Lab: a procedural sound-effect workbench
        • 8.14.19. STRUDEL-19 — One-Shots: Fire-and-Forget Stings on Events
      • 8.15. OpenGL / WebGL2 Tutorials
        • 8.15.1. 01 - The Rotating Triangle
        • 8.15.2. 02 - The Mandelbrot Set
        • 8.15.3. 03 - Signed-Distance-Field Raymarcher
        • 8.15.4. 04 - The Synthwave Cube
        • 8.15.5. 05 - The Cube Swarm
        • 8.15.6. 06 - The Skybox
        • 8.15.7. 07 - The Particle Swarm
        • 8.15.8. 08 - The Shadow Map
        • 8.15.9. 09 - Multisample Anti-Aliasing
        • 8.15.10. 10 - Deferred Shading + MRT
        • 8.15.11. 11 - HDR + Bloom
        • 8.15.12. 12 - glTF PBR Capstone
      • 8.16. JSON-RPC 2.0 Tutorials
        • 8.16.1. JSONRPC-01 — Building Requests, Parsing Responses
        • 8.16.2. JSONRPC-02 — Implementing a Server with dispatch_line
        • 8.16.3. JSONRPC-03 — §6 Batches: Many Messages in One Wire
      • 8.17. dasPEG (Parser Generator) Tutorials
        • 8.17.1. PEG-01 — Hello Parser
        • 8.17.2. PEG-02 — Arithmetic Calculator
        • 8.17.3. PEG-03 — CSV Parser
        • 8.17.4. PEG-04 — Email Validator
        • 8.17.5. PEG-05 — JSON Parser
        • 8.17.6. PEG-06 — Debugging and Options
        • 8.17.7. PEG-07 — C64 BASIC Interpreter
      • 8.18. dasImgui Tutorials
        • 8.18.1. dasImgui tutorials
    • 9. Kernel tuning — [tune] and the per-app tune sidecar
      • 9.1. Overview
      • 9.2. The annotations
        • 9.2.1. [tune_perm(...)]
        • 9.2.2. [tune(gen="key", fallback="suffix")]
        • 9.2.3. [tune_companion(fn="sibling", gen="key")]
      • 9.3. The mode contract
      • 9.4. Tuner wiring — [tune_scope]
      • 9.5. Application policy — [tune_policy] and --tune
      • 9.6. Standalone builds
      • 9.7. Sidecar location and staleness
      • 9.8. Runtime status — tune_status()
      • 9.9. What a tune shows
        • 9.9.1. Progress events
      • 9.10. Writing a harness
      • 9.11. Sidecar format
    • 10. daslang environment variables
      • 10.1. Threading — the job queue
      • 10.2. JIT
      • 10.3. Kernel tuning
      • 10.4. Lint
      • 10.5. Diagnostics
      • 10.6. Ambient variables daslang reads but does not own
      • 10.7. Adding one
    • 11. dasLLAMA environment variables
      • 11.1. Engine
      • 11.2. Metal backend
      • 11.3. Vulkan backend
      • 11.4. Accelerate / AMX backend
      • 11.5. Harness — tuner and probes
      • 11.6. Benchmarks
      • 11.7. Profiling and baselines
      • 11.8. Tests
      • 11.9. Examples and tutorials
      • 11.10. daslang core knobs dasLLAMA honours
    • 12. How dasLLAMA is measured
      • 12.1. The pairing rule
      • 12.2. Categories
      • 12.3. What is timed
      • 12.4. Threads and pinning
      • 12.5. Tuning
      • 12.6. Identity: what exactly ran, on what
      • 12.7. Anomalies
      • 12.8. What is not claimed
      • 12.9. Reproducing
    • 13. Function flattening — [flatten] for branchless / callless backends
      • 13.1. Overview
      • 13.2. The transform
      • 13.3. The fast-math opt-out
      • 13.4. Supported subset
      • 13.5. Boundaries (loud errors)
      • 13.6. The leaf-primitive whitelist
      • 13.7. Public API
    • 14. LINQ-fold patterns — what _fold(...) recognizes
      • 14.1. How dispatch works
      • 14.2. Pre-dispatch normalizations
      • 14.3. Source-side entry points
      • 14.4. Array-source patterns
      • 14.5. Decs-source patterns
        • 14.5.1. Decs-decs equi-join
        • 14.5.2. Array-array equi-join
      • 14.6. XML-source patterns
      • 14.7. Zip patterns
      • 14.8. What falls back
        • 14.8.1. Decs-bridge fall-off diagnostic
      • 14.9. See also
    • 15. C#-style LINQ query syntax (%linq!)
      • 15.1. Clauses
      • 15.2. Sources
      • 15.3. Range variable
      • 15.4. Filtering (where)
      • 15.5. Let bindings
      • 15.6. Projections
      • 15.7. Ordering
      • 15.8. Grouping
      • 15.9. Query continuation (into)
      • 15.10. Join
      • 15.11. Multiple from (SelectMany)
        • 15.11.1. Correlated from (flatten)
      • 15.12. Iterator vs array output
      • 15.13. Comments in the body
      • 15.14. Current limitations
    • 16. daslang strudel vs strudel.cc — Feature Comparison
      • 16.1. Scope and philosophy
      • 16.2. What we have
      • 16.3. What we don’t have (yet)
      • 16.4. Behavioural differences
        • 16.4.1. ADSR defaults are tempo-aware
        • 16.4.2. Per-voice vs per-orbit FX
        • 16.4.3. Orbit bus model
        • 16.4.4. Reverb quality
        • 16.4.5. Mini-notation parsing
        • 16.4.6. fast at non-integer ratios
        • 16.4.7. Scheduler and voice pool
      • 16.5. Extensions over strudel.cc
        • 16.5.1. HRTF positional override
        • 16.5.2. Host-driven / adaptive control
        • 16.5.3. One-shot patterns (fire-and-forget stings)
      • 16.6. Naming map (quick reference)
  • Daslang Standard Library 0.6.4
    • 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
      • 1.21. AI and language models
    • 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. 16/8-bit lattice converts
        • 2.1.14. 16/8-bit lattice integer dots
        • 2.1.15. GC0 infrastructure
        • 2.1.16. Smart ptr infrastructure
        • 2.1.17. Macro infrastructure
        • 2.1.18. Profiler
        • 2.1.19. System infrastructure
        • 2.1.20. Memory manipulation
        • 2.1.21. Binary serializer
        • 2.1.22. Path and command line
        • 2.1.23. Time and date
        • 2.1.24. Platform queries
        • 2.1.25. String formatting
        • 2.1.26. Argument consumption
        • 2.1.27. Lock checking
        • 2.1.28. Bit operations
        • 2.1.29. Intervals
        • 2.1.30. RTTI
        • 2.1.31. Initialization and finalization
        • 2.1.32. Algorithms
        • 2.1.33. Memset
        • 2.1.34. Malloc
        • 2.1.35. Compilation and AOT
        • 2.1.36. GC
      • 2.2. Math library
        • 2.2.1. Constants
        • 2.2.2. Handled structures
        • 2.2.3. Horizontal reduce (float2, float3, float4)
        • 2.2.4. all numerics (uint*, int*, float*, double)
        • 2.2.5. float* and double
        • 2.2.6. float* only
        • 2.2.7. float3 only
        • 2.2.8. float2, float3, float4
        • 2.2.9. Noise functions
        • 2.2.10. lerp/mad/clamp
        • 2.2.11. Matrix operations
        • 2.2.12. Matrix initializers
        • 2.2.13. Matrix manipulation
        • 2.2.14. Quaternion operations
        • 2.2.15. Packing and unpacking
      • 2.3. Math bit helpers
        • 2.3.1. float in int,uint
        • 2.3.2. int,uint in float
        • 2.3.3. int64,uint64 in double
        • 2.3.4. bit-cast vec4f
      • 2.4. Boost package for math
        • 2.4.1. Structures
        • 2.4.2. Intersections
        • 2.4.3. Matrices
        • 2.4.4. Plane
        • 2.4.5. Color conversions
        • 2.4.6. Color packing and unpacking
      • 2.5. Random generator library
        • 2.5.1. Constants
        • 2.5.2. Seed and basic generators
        • 2.5.3. Random iterators
        • 2.5.4. Specific distributions
    • 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.2.1. Split and join
        • 3.2.2. Formatting
        • 3.2.3. Queries and comparisons
        • 3.2.4. Search and match
        • 3.2.5. Replace
        • 3.2.6. Prefix and suffix
        • 3.2.7. String similarity
      • 3.3. Soft-failing string-to-numeric conversions returning Result<T; ConversionError>
        • 3.3.1. Enumerations
        • 3.3.2. Soft-failing conversions
      • 3.4. Temporary string utilities
        • 3.4.1. Function annotations
        • 3.4.2. Temporary string builders
        • 3.4.3. Temporary string conversion
      • 3.5. UTF-8 utilities
        • 3.5.1. Constants
        • 3.5.2. Encoding and decoding
        • 3.5.3. Iteration
        • 3.5.4. Length and measurement
        • 3.5.5. Validation
        • 3.5.6. Unicode word/case primitives
      • 3.6. Base64 encoding and decoding
        • 3.6.1. Encoding
        • 3.6.2. Decoding
      • 3.7. Long string embedding macro
        • 3.7.1. Reader macros
    • 4. I/O and Serialization
      • 4.1. File input output library
        • 4.1.1. Glob and pattern matching
      • 4.2. System clipboard
        • 4.2.1. Type aliases
        • 4.2.2. Enumerations
        • 4.2.3. Structures
        • 4.2.4. UTF-8 system clipboard
      • 4.3. Network socket library
        • 4.3.1. Handled structures
        • 4.3.2. Low level NetworkServer IO
      • 4.4. HTTP and WebSocket library (libhv)
        • 4.4.1. Enumerations
        • 4.4.2. Handled structures
        • 4.4.3. Handled types
        • 4.4.4. WebSocket client
        • 4.4.5. WebSocket server lifecycle
        • 4.4.6. WebSocket channel send
        • 4.4.7. Handle operations
        • 4.4.8. HTTP route registration
        • 4.4.9. HTTP server configuration
        • 4.4.10. HTTP response helpers
        • 4.4.11. HTTP client requests
        • 4.4.12. Message and header access
        • 4.4.13. Request configuration
        • 4.4.14. Cookies
        • 4.4.15. Form data
        • 4.4.16. SSE response writer
      • 4.5. High-level HTTP and WebSocket wrappers
        • 4.5.1. Classes
        • 4.5.2. HTTP request helpers
      • 4.6. OpenAI-compatible API client (chat, embeddings, audio, vision, …)
        • 4.6.1. Structures
        • 4.6.2. Client and transport
        • 4.6.3. Chat completions
        • 4.6.4. Embeddings
        • 4.6.5. Models
        • 4.6.6. Legacy completions
        • 4.6.7. Audio (TTS and STT)
        • 4.6.8. Moderations
        • 4.6.9. Image generation
        • 4.6.10. Vision
      • 4.7. URI manipulation library based on UriParser
        • 4.7.1. Handled structures
        • 4.7.2. Initialization and finalization
        • 4.7.3. Escape and unescape
        • 4.7.4. Uri manipulations
        • 4.7.5. File name conversions
        • 4.7.6. GUID
      • 4.8. Boost package for the URI parser
        • 4.8.1. Split and compose
        • 4.8.2. Component accessors
      • 4.9. ANSI terminal color and style helpers
        • 4.9.1. Configuration
        • 4.9.2. Colors
        • 4.9.3. Styles
      • 4.10. Terminal capability probes
        • 4.10.1. Constants
        • 4.10.2. Terminal detection
        • 4.10.3. Terminal geometry
      • 4.11. General purpose serialization
        • 4.11.1. Structures
        • 4.11.2. Classes
        • 4.11.3. Serialization
        • 4.11.4. Memory archive
      • 4.12. Command-line utilities
        • 4.12.1. Executable path
      • 4.13. Structured JSON Lines logger
        • 4.13.1. Setup
        • 4.13.2. Level filters
        • 4.13.3. Output control
        • 4.13.4. Log calls
        • 4.13.5. Stdout hook
    • 5. Data Structures
      • 5.1. Boost package for array manipulation
        • 5.1.1. Temporary arrays
        • 5.1.2. Empty check
        • 5.1.3. Sub-array view
      • 5.2. Boost package for the builtin sort
        • 5.2.1. Call macros
        • 5.2.2. Partial sorting
        • 5.2.3. Heap operations
      • 5.3. Flat hash table
      • 5.4. Cuckoo hash table
        • 5.4.1. Hash functions
      • 5.5. SOA (Structure of Arrays) transformation
        • 5.5.1. Structures
        • 5.5.2. Function annotations
        • 5.5.3. Structure macros
        • 5.5.4. SOA field access
      • 5.6. Packed boolean array
        • 5.6.1. Structures
        • 5.6.2. Iteration
      • 5.7. Monadic Option<T> — a value-or-nothing tagged pair
        • 5.7.1. Structures
        • 5.7.2. Constructors
        • 5.7.3. Queries
        • 5.7.4. Transforming
        • 5.7.5. Extraction
        • 5.7.6. Side effects
        • 5.7.7. Pairing
        • 5.7.8. Operators
      • 5.8. Monadic Result<T, E> — a value-or-error tagged pair
        • 5.8.1. Structures
        • 5.8.2. Constructors
        • 5.8.3. Queries
        • 5.8.4. Transforming
        • 5.8.5. Extraction
        • 5.8.6. Side effects
        • 5.8.7. Bridges to Option
        • 5.8.8. Operators
    • 6. Algorithms and Functional
      • 6.1. Miscellaneous algorithms
        • 6.1.1. Search
        • 6.1.2. Array manipulation
        • 6.1.3. Table manipulation
      • 6.2. Functional programming library
        • 6.2.1. Transformations
        • 6.2.2. Aggregation
        • 6.2.3. Search and split
        • 6.2.4. Iteration
        • 6.2.5. Generators
        • 6.2.6. Predicates
      • 6.3. LINQ
        • 6.3.1. Sorting data
        • 6.3.2. Top-N selection
        • 6.3.3. Set operations
        • 6.3.4. Concatenation operations
        • 6.3.5. Generation operations
        • 6.3.6. Aggregation operations
        • 6.3.7. Filtering data
        • 6.3.8. Partitioning data
        • 6.3.9. Joining
        • 6.3.10. Grouping
        • 6.3.11. Querying data
        • 6.3.12. Element operations
        • 6.3.13. Transform operations
        • 6.3.14. Conversion operations
        • 6.3.15. Comparators and keys
      • 6.4. Boost module for LINQ
        • 6.4.1. Call macros
      • 6.5. LINQ fold macros (_fold / _old_fold)
        • 6.5.1. Call macros
      • 6.6. Pattern matching
        • 6.6.1. Call macros
        • 6.6.2. Structure macros
    • 7. Data Formats
      • 7.1. JSON manipulation library
        • 7.1.1. Type aliases
        • 7.1.2. Structures
        • 7.1.3. Value conversion
        • 7.1.4. Read and write
        • 7.1.5. Memory management
        • 7.1.6. JSON properties
        • 7.1.7. Broken JSON
      • 7.2. Boost package for JSON
        • 7.2.1. Field annotations
      • 7.3. JSON-RPC 2.0 envelope + parser, transport-agnostic
        • 7.3.1. Constants
        • 7.3.2. Structures
        • 7.3.3. Envelope builders
        • 7.3.4. Server-side parsers
        • 7.3.5. Outgoing request builders
        • 7.3.6. Response parsers
        • 7.3.7. Framing helper
        • 7.3.8. High-level dispatch
      • 7.4. TOML 1.0 parser and writer
        • 7.4.1. Parsing
        • 7.4.2. Writing
      • 7.5. XML parser (pugixml)
        • 7.5.1. Constants
        • 7.5.2. Enumerations
        • 7.5.3. Handled structures
        • 7.5.4. Document operations
        • 7.5.5. Node lookup
        • 7.5.6. Node navigation
        • 7.5.7. Node mutation
        • 7.5.8. Attribute access
        • 7.5.9. Copy and move
        • 7.5.10. Value reading
        • 7.5.11. Value writing
        • 7.5.12. XPath compilation and evaluation
        • 7.5.13. XPath selection
        • 7.5.14. XPath node set operations
        • 7.5.15. Construction and RAII
        • 7.5.16. Handle validity and comparison
      • 7.6. High-level XML helpers (pugixml boost)
        • 7.6.1. Block-based iteration
        • 7.6.2. Iterator-based iteration
        • 7.6.3. LINQ source
        • 7.6.4. RAII document handling
        • 7.6.5. Quick accessors
        • 7.6.6. Builder helpers
        • 7.6.7. Builder EDSL
        • 7.6.8. String conversion
        • 7.6.9. XPath helpers
        • 7.6.10. Serialization
        • 7.6.11. Type conversion operators
      • 7.7. Regular expression library
        • 7.7.1. Type aliases
        • 7.7.2. Enumerations
        • 7.7.3. Structures
        • 7.7.4. Compilation and validation
        • 7.7.5. Access
        • 7.7.6. Match & replace
        • 7.7.7. Generation
      • 7.8. Boost package for REGEX
        • 7.8.1. Reader macros
      • 7.9. PEG parser generator
        • 7.9.1. Grammar basics
        • 7.9.2. Built-in terminals
        • 7.9.3. Operators and combinators
        • 7.9.4. Options
        • 7.9.5. Return types
        • 7.9.6. Error handling
        • 7.9.7. Left recursion
        • 7.9.8. Performance
      • 7.10. Documentation generator
        • 7.10.1. Structures
        • 7.10.2. Document writers
        • 7.10.3. Descriptions
        • 7.10.4. Label makers
        • 7.10.5. RST section makers
        • 7.10.6. Group operations
        • 7.10.7. Naming helpers
      • 7.11. Markdown generation helpers
        • 7.11.1. Enumerations
        • 7.11.2. Tables
        • 7.11.3. Text helpers
    • 8. Entity Component System
      • 8.1. DECS, Daslang entity component system
        • 8.1.1. Type aliases
        • 8.1.2. Constants
        • 8.1.3. Structures
        • 8.1.4. Comparison and access
        • 8.1.5. Access (get/set/clone)
        • 8.1.6. Entity status
        • 8.1.7. Debug and serialization
        • 8.1.8. Stages
        • 8.1.9. Deferred actions
        • 8.1.10. GC and reset
        • 8.1.11. Iteration
        • 8.1.12. Request
      • 8.2. Boost package for DECS
        • 8.2.1. Function annotations
        • 8.2.2. Call macros
        • 8.2.3. Structure macros
      • 8.3. DECS debug state reporting
    • 9. Concurrency
      • 9.1. Jobs and threads
        • 9.1.1. Handled structures
        • 9.1.2. Channel, JobStatus, Lockbox, Stream
        • 9.1.3. Queries
        • 9.1.4. Event tracing
        • 9.1.5. Internal invocations
        • 9.1.6. Construction
        • 9.1.7. Atomic
      • 9.2. Boost package for jobs and threads
        • 9.2.1. Function annotations
        • 9.2.2. Invocations
        • 9.2.3. Iteration
        • 9.2.4. Passing data
        • 9.2.5. Receiving data
        • 9.2.6. Synchronization
        • 9.2.7. Parallel execution
        • 9.2.8. LockBox operations
        • 9.2.9. Internal capture details
      • 9.3. Self-describing jobque profiling
        • 9.3.1. Constants
        • 9.3.2. Trace sessions
        • 9.3.3. Categories
        • 9.3.4. Markers
      • 9.4. Cross-context evaluation helpers
        • 9.4.1. Function annotations
      • 9.5. Coroutines and additional generator support
        • 9.5.1. Type aliases
        • 9.5.2. Function annotations
        • 9.5.3. Call macros
        • 9.5.4. Top level coroutine evaluation
      • 9.6. Async/await coroutine macros
        • 9.6.1. Function annotations
        • 9.6.2. Awaiting
        • 9.6.3. Running async tasks
    • 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. Lint suppression
        • 10.1.22. 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. Compilation and file access
        • 10.2.9. Call generation
        • 10.2.10. Visitor pattern
        • 10.2.11. Expression generation
        • 10.2.12. Adapter generation
        • 10.2.13. Adapter application
        • 10.2.14. Adding objects to objects
        • 10.2.15. Program and module access
        • 10.2.16. Textual descriptions of the objects
        • 10.2.17. Searching
        • 10.2.18. Iterating
        • 10.2.19. Cloning
        • 10.2.20. Mangled name
        • 10.2.21. Size and offset
        • 10.2.22. Evaluations
        • 10.2.23. Error reporting
        • 10.2.24. Location and context
        • 10.2.25. Use queries
        • 10.2.26. Log
        • 10.2.27. Removal
        • 10.2.28. Properties
        • 10.2.29. Infer
        • 10.2.30. Module queries
        • 10.2.31. Debug info helpers
        • 10.2.32. AOT support
        • 10.2.33. String builder writer
        • 10.2.34. 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.4.1. Function annotations
        • 10.4.2. Call macros
      • 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.6.1. Structures
        • 10.6.2. Clone operations
        • 10.6.3. Conversion
      • 10.7. Boost package for macro manipulations
        • 10.7.1. Structures
        • 10.7.2. Function annotations
        • 10.7.3. Implementation details
        • 10.7.4. Block analysis
        • 10.7.5. Expression analysis
      • 10.8. Type macro and template structure support
        • 10.8.1. Structures
        • 10.8.2. Function annotations
        • 10.8.3. Structure macros
        • 10.8.4. Enum helpers
        • 10.8.5. Template structure instantiation
        • 10.8.6. Type inference helpers
        • 10.8.7. String constant access
        • 10.8.8. Work tracking
        • 10.8.9. Type macro arguments
      • 10.9. DECS, AST block to loop
        • 10.9.1. Block to loop conversion
      • 10.10. Position-based AST queries
        • 10.10.1. Structures
        • 10.10.2. Classes
        • 10.10.3. Cursor queries
        • 10.10.4. Result inspection
      • 10.11. AST type usage collection
        • 10.11.1. Structures
        • 10.11.2. Collecting type information
      • 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. Call matching
        • 10.12.6. Result builders
        • 10.12.7. Value extraction
        • 10.12.8. Name and type extraction
        • 10.12.9. Argument filtering
        • 10.12.10. Block scanning
        • 10.12.11. Constant construction
        • 10.12.12. AST reconstruction
        • 10.12.13. AST normalization
        • 10.12.14. Hygienic names
      • 10.13. Constant expression checker and substitution
        • 10.13.1. Function annotations
        • 10.13.2. Macro helpers
    • 11. Annotations and Contracts
      • 11.1. Miscellaneous contract annotations
        • 11.1.1. Function annotations
        • 11.1.2. Type queries
      • 11.2. Apply reflection pattern
        • 11.2.1. Call macros
      • 11.3. defer and defer_delete macros
        • 11.3.1. Function annotations
        • 11.3.2. Call macros
        • 11.3.3. Defer
        • 11.3.4. Stub
      • 11.4. with_ macro: locked array/table element binding
        • 11.4.1. Call macros
      • 11.5. if_not_null macro
        • 11.5.1. Call macros
      • 11.6. is_local_xxx ast helpers
        • 11.6.1. Scope checks
      • 11.7. safe_addr macro
        • 11.7.1. Function annotations
        • 11.7.2. Safe temporary address
        • 11.7.3. Temporary pointers
        • 11.7.4. Temporary values
      • 11.8. static_let macro
        • 11.8.1. Function annotations
        • 11.8.2. Static variable declarations
      • 11.9. lpipe macro
        • 11.9.1. Call macros
      • 11.10. Assert once
        • 11.10.1. Function annotations
        • 11.10.2. Assertion
      • 11.11. Loop unrolling
        • 11.11.1. Function annotations
        • 11.11.2. Unrolling
      • 11.12. Bitfield operator overloads
        • 11.12.1. Bitfield element access
        • 11.12.2. Iteration
      • 11.13. Bitfield name traits
        • 11.13.1. Function annotations
        • 11.13.2. Iteration
      • 11.14. Enumeration traits
        • 11.14.1. Typeinfo macros
        • 11.14.2. Handled enumerations
        • 11.14.3. Enumeration iteration
        • 11.14.4. Enumeration conversion
      • 11.15. Type trait macros
        • 11.15.1. Call macros
        • 11.15.2. Typeinfo macros
      • 11.16. C++ bindings generator
        • 11.16.1. Generation of bindings
    • 12. Classes and Interfaces
      • 12.1. Class method macros
        • 12.1.1. Function annotations
      • 12.2. instance_function function annotation
        • 12.2.1. Function annotations
      • 12.3. Interfaces
        • 12.3.1. Variant macros
        • 12.3.2. Structure macros
      • 12.4. C#-like multicast delegate type macro
        • 12.4.1. Structures
        • 12.4.2. Delegate type macro
      • 12.5. Dynamic RTTI type casts
        • 12.5.1. Variant macros
        • 12.5.2. Dynamic casts
      • 12.6. Generic return type instantiation
        • 12.6.1. Call macros
    • 13. Testing and Debugging
      • 13.1. Debug agent API
        • 13.1.1. Handled structures
        • 13.1.2. Agent lifecycle
        • 13.1.3. Cross-context invocation
        • 13.1.4. Agent construction
        • 13.1.5. Agent tick and state collection
        • 13.1.6. Instrumentation
        • 13.1.7. Data and stack walking
        • 13.1.8. Context inspection
        • 13.1.9. Breakpoints
        • 13.1.10. Memory
      • 13.2. Instrumenting profiler
        • 13.2.1. Profiler control
      • 13.3. Profiler cross-context helpers
        • 13.3.1. Context profiler control
      • 13.4. Debug expression evaluator
        • 13.4.1. Structures
        • 13.4.2. Evaluation
      • 13.5. Faker
        • 13.5.1. Structures
        • 13.5.2. Constructor
        • 13.5.3. Random values
        • 13.5.4. Random strings
        • 13.5.5. Date and time
      • 13.6. Fuzzer
        • 13.6.1. Fuzzer tests
      • 13.7. Debug Adapter Protocol data structures
        • 13.7.1. Structures
        • 13.7.2. JSON deserialization
        • 13.7.3. JSON serialization
        • 13.7.4. JSON field accessors
    • 14. Code Quality and Refactoring
      • 14.1. Paranoid lint pass
        • 14.1.1. Lint operations
      • 14.2. Repo-level lint configuration
        • 14.2.1. Structures
        • 14.2.2. Configuration
        • 14.2.3. Structured findings
      • 14.3. Code validation annotations
        • 14.3.1. Function annotations
      • 14.4. Automated refactoring tools
        • 14.4.1. Function annotations
        • 14.4.2. Call macros
        • 14.4.3. Refactoring operations
      • 14.5. Consume argument optimization
        • 14.5.1. Function annotations
      • 14.6. Call argument removal annotation
        • 14.6.1. Function annotations
      • 14.7. Source code formatter
        • 14.7.1. Formatting
      • 14.8. File-based source code formatter
        • 14.8.1. File formatting
    • 15. Image, Font and Model Processing
      • 15.1. Image loading, writing, and resizing (stb_image)
        • 15.1.1. Enumerations
        • 15.1.2. Image loading
        • 15.1.3. Image info
        • 15.1.4. Memory management
        • 15.1.5. Load settings
        • 15.1.6. HDR gamma and scale
        • 15.1.7. File writing
        • 15.1.8. Write to memory
        • 15.1.9. Write settings
        • 15.1.10. Image resizing
        • 15.1.11. Animated PNG (APNG) writer
      • 15.2. High-level image API (stbimage_boost)
        • 15.2.1. Structures
        • 15.2.2. Image construction
        • 15.2.3. Image loading
        • 15.2.4. Pixel access
        • 15.2.5. Image properties
      • 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.4.1. Constants
        • 15.4.2. Handled structures
        • 15.4.3. Font loading
        • 15.4.4. Font packing
        • 15.4.5. Font metrics
        • 15.4.6. Codepoint metrics
        • 15.4.7. Codepoint bitmaps
        • 15.4.8. Glyph shape
      • 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
      • 15.6. glTF 2.0 loader (dasGLTF): GLB/.gltf parse, accessor decode, node hierarchy, skinning and keyframe animation into a backend-neutral scene
        • 15.6.1. The scene model
        • 15.6.2. Animation and skinning
    • 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. Capture
        • 16.1.6. Decoder
        • 16.1.7. Resampler
        • 16.1.8. Channel converter
        • 16.1.9. Volume mixer
        • 16.1.10. Limiter
        • 16.1.11. HRTF
        • 16.1.12. I3DL2 Reverb
        • 16.1.13. Convolution Reverb
        • 16.1.14. Chorus
        • 16.1.15. Delay
        • 16.1.16. Per-voice effects
        • 16.1.17. 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. HRTF
        • 16.2.10. Reverb
        • 16.2.11. Chorus
        • 16.2.12. Attenuation
        • 16.2.13. Status monitoring
        • 16.2.14. Command batching
        • 16.2.15. PCM stream
        • 16.2.16. Decoding
        • 16.2.17. Sound ID
        • 16.2.18. Internal stream management
      • 16.3. WAV file reading and writing
        • 16.3.1. WAV I/O
      • 16.4. Microphone capture and record-to-WAV
        • 16.4.1. Structures
        • 16.4.2. Recording
    • 17. AI and Language Models
      • 17.1. dasLLAMA LLM inference: models, sessions, generation, chat
        • 17.1.1. Types
        • 17.1.2. Model loading and sessions
        • 17.1.3. Prefix cache
        • 17.1.4. Tokenizer
        • 17.1.5. Evaluation and sampling
        • 17.1.6. Generation
        • 17.1.7. Embeddings
        • 17.1.8. Chat
        • 17.1.9. Tool calling
    • 18. Strudel (Live Coding)
      • 18.1. Event payload and ADSR/delay-time resolvers
        • 18.1.1. Structures
        • 18.1.2. ADSR and delay resolution
      • 18.2. Cycle-space time primitives: TimeSpan, Hap, and cycle helpers
        • 18.2.1. Structures
        • 18.2.2. Cycle math
      • 18.3. Pattern algebra, combinators, and fluent control API
        • 18.3.1. Type aliases
        • 18.3.2. Pattern construction
        • 18.3.3. Time manipulation
        • 18.3.4. Combinators
        • 18.3.5. Setter primitives
        • 18.3.6. Fluent control: dynamics and routing
        • 18.3.7. Fluent control: 3D positioning (HRTF)
        • 18.3.8. Fluent control: effects sends
        • 18.3.9. Fluent control: filters
        • 18.3.10. Fluent control: envelope
        • 18.3.11. Fluent control: synthesis and shaping
        • 18.3.12. Fluent control: modulation FX
        • 18.3.13. Fluent control: SF2
        • 18.3.14. Signals
      • 18.4. Mini-notation tokenizer, parser, and fluent-DSL entry points
        • 18.4.1. Enumerations
        • 18.4.2. Structures
        • 18.4.3. Tokenizer and parser
        • 18.4.4. Fluent DSL constructors
        • 18.4.5. Cycle-rate variants
      • 18.5. Musical scales and note-name helpers
        • 18.5.1. Scale and note selection
      • 18.6. Audio synthesis: oscillators, drums, filters, and effects
        • 18.6.1. Constants
        • 18.6.2. Enumerations
        • 18.6.3. Structures
        • 18.6.4. Pitch conversion
        • 18.6.5. Noise generators
        • 18.6.6. Drum renderers
        • 18.6.7. Oscillator type
        • 18.6.8. Voice FX chain
        • 18.6.9. Oscillator voice
        • 18.6.10. Vowel filter
        • 18.6.11. Voice rendering
      • 18.7. Sample bank and audio file loading
        • 18.7.1. Structures
        • 18.7.2. Loading
        • 18.7.3. Rendering
      • 18.8. Voice allocation, effect bus routing, and per-tick mixing
        • 18.8.1. Structures
        • 18.8.2. Orbit effects
        • 18.8.3. Orbit levels
        • 18.8.4. Reverb quality override
        • 18.8.5. Scheduler lifecycle
      • 18.9. Top-level playback harness: tracks, BPM/CPS, and threaded audio
        • 18.9.1. Structures
        • 18.9.2. Lifecycle
        • 18.9.3. Playback control
        • 18.9.4. Tempo and timing
        • 18.9.5. Volume
        • 18.9.6. Asset loading
        • 18.9.7. Track management
        • 18.9.8. One-shots
        • 18.9.9. Orbit levels
        • 18.9.10. State serialization
        • 18.9.11. Debug and diagnostics
      • 18.10. MIDI file parser
        • 18.10.1. Enumerations
        • 18.10.2. Structures
        • 18.10.3. Parsing
        • 18.10.4. Track operations
        • 18.10.5. Binary readers
      • 18.11. MIDI file playback with GM preset mapping
        • 18.11.1. Structures
        • 18.11.2. Lifecycle
        • 18.11.3. Playback control
        • 18.11.4. Audio setup
        • 18.11.5. Asset loading
        • 18.11.6. Event processing
        • 18.11.7. Drum and GM preset rendering
      • 18.12. SoundFont 2 file parser
        • 18.12.1. Constants
        • 18.12.2. Enumerations
        • 18.12.3. Structures
        • 18.12.4. Loading
        • 18.12.5. Preset and zone lookup
        • 18.12.6. Generator access
        • 18.12.7. Unit conversion
        • 18.12.8. Modulator source helpers
      • 18.13. SoundFont 2 per-voice runtime: envelope, LFO, modulators, biquad
        • 18.13.1. Enumerations
        • 18.13.2. Structures
        • 18.13.3. Envelope
        • 18.13.4. LFO
        • 18.13.5. Modulators
        • 18.13.6. Voice creation
      • 18.14. Live-reload state preservation
    • 19. GUI (Dear ImGui)
      • 19.1. Boost macro layer
        • 19.1.1. Boost macro layer — DSL for declarative widget composition
        • 19.1.2. Boost runtime — widget state structs, registry, and dispatcher
      • 19.2. Builtin widgets
        • 19.2.1. Built-in widgets — inputs, selection, color, plots, output
        • 19.2.2. Built-in containers — windows, child regions, tabs, menus, popups
        • 19.2.3. ID stack — push/pop, scoped, hashing
        • 19.2.4. Layout helpers — splits, columns, docking, spacing
        • 19.2.5. Style helpers — colors, vars, push/pop, themes
        • 19.2.6. Icon set
      • 19.3. Live reload and transport
        • 19.3.1. Live-reload lifecycle and synthetic-IO bypass driver
        • 19.3.2. Transport — pluggable lambda-based IPC for imgui commands
      • 19.4. Testing toolkit
        • 19.4.1. Playwright — block-form test harness for daslang-live + dasImgui apps
        • 19.4.2. Visual aids — tutorial-mode overlays, mouse trail, narration, key HUD
      • 19.5. External types
        • 19.5.1. imgui::ImGuiCol
        • 19.5.2. imgui::ImGui*Flags
        • 19.5.3. imgui::ImGuiCond
        • 19.5.4. imgui::ImVec2 / imgui::ImVec4 / imgui::ImColor
        • 19.5.5. imgui::ImGuiViewport
        • 19.5.6. imgui::ImGuiSizeCallbackData
        • 19.5.7. glfw::GLFWwindow
        • 19.5.8. imgui::ImTextureRef
        • 19.5.9. imgui::ImGuiTextFilter
      • 19.6. Internal binding families
        • 19.6.1. Render helpers
        • 19.6.2. Vertex shading
        • 19.6.3. Layout & item sizing
        • 19.6.4. Item hit-test & geometry
        • 19.6.5. Item assembly (ItemAdd + ButtonBehavior)
        • 19.6.6. Behavior-flag buttons
        • 19.6.7. Axis layout primitives (splitter & scrollbar)
        • 19.6.8. Tree-node behavior
        • 19.6.9. Separator & low-level text
        • 19.6.10. Combo internals
        • 19.6.11. Popups, tooltips & menus
        • 19.6.12. ID stack seed & override
        • 19.6.13. Focus scope & activation
        • 19.6.14. Item flags
        • 19.6.15. Logging & capture
  • External modules
    • dasImguiNodeEditor
      • Where to go
      • What’s there
      • Versioning
    • dasImguiImplot
      • Where to go
      • What’s there
      • Versioning
    • dasVulkan
      • Where to go
      • What’s there
      • Versioning
    • dasVideo
      • Where to go
      • What’s there
      • Licensing
    • dasDuckDB
      • Where to go
      • What’s there
    • dasPostgreSQL
      • Where to go
      • What’s there
Daslang documentation
  • Daslang 0.6.4 Reference Manual
  • 8. Tutorials
  • 8.18.1. dasImgui tutorials
  • 8.18.1.21. Main menu bar
  • View page source

8.18.1.21. Main menu bar

Two related v2 additions live together in this tutorial. The first is main_menu_bar(IDENT) { ... } — the screen-top bar (BeginMainMenuBar / EndMainMenuBar), distinct from menu_bar(IDENT) { ... } which attaches to the current window (BeginMenuBar, requires ImGuiWindowFlags.MenuBar). The second is the menu_item / menu_label split for the leaves under a menu:

  • menu_item(IDENT, (text=, shortcut=, enabled=)) — toggleable. ToggleState.value flips on click.

  • menu_label(IDENT, (text=, shortcut=, selected=, enabled=)) — static. ClickState.click_count accumulates; selected is a fixed check-mark (not driven by the click).

menu_label is the right rail for section headers (selected=false, enabled=false), permanent-check labels (selected=true), and any “do something, don’t toggle” menu entry.

main_menu_bar(MAIN_BAR) {
    menu(FILE_MENU, (text = "File", enabled = true)) {
        menu_item(MI_DARKMODE, (text = "Dark mode", shortcut = "Ctrl+D"))
        menu_item(MI_AUTOSAVE, (text = "Auto-save", shortcut = ""))
        separator(FILE_SEP)
        menu_label(FILE_HEADER, (text = "(recent files)",
                                 shortcut = "", selected = false,
                                 enabled = false))
        menu_label(FILE_RECENT1, (text = "demo.das"))
        menu_label(FILE_STAR, (text = "Star this project",
                               shortcut = "", selected = true))
    }
}

Source: modules/dasImgui/examples/tutorial/main_menu_bar.das.

8.18.1.21.1. Walkthrough

Your browser doesn't support HTML5 video. Download the recording.
  1options gen2
  2options _comment_hygiene = true
  3
  4require imgui
  5require imgui_app
  6require opengl/opengl_boost
  7require live/glfw_live
  8require live/live_api
  9require live/live_commands
 10require live/live_vars
 11require live_host
 12require imgui/imgui_live
 13require imgui/imgui_boost_runtime
 14require imgui/imgui_boost_v2
 15require imgui/imgui_widgets_builtin
 16require imgui/imgui_containers_builtin
 17require imgui/imgui_visual_aids
 18
 19// =============================================================================
 20// TUTORIAL: main_menu_bar — top-level menu bar + menu_item vs menu_label split.
 21//
 22// Two related v2 additions live in this tutorial:
 23//
 24// 1. `main_menu_bar(IDENT) { ... }` is the screen-top bar (`BeginMainMenuBar`)
 25//    — distinct from `menu_bar(IDENT) { ... }` which attaches to the current
 26//    window (`BeginMenuBar`, requires `ImGuiWindowFlags.MenuBar`).
 27//
 28// 2. `menu_item` vs `menu_label`:
 29//    - menu_item(IDENT, (text=, shortcut=, enabled=)) → toggleable.
 30//      ToggleState.value mutates on click.
 31//    - menu_label(IDENT, (text=, shortcut=, selected=, enabled=)) → static.
 32//      ClickState.click_count accumulates; `selected` is a fixed check-mark.
 33//
 34// Use menu_label for section headers (`selected=false, enabled=false`),
 35// permanent-check labels (`selected=true`), and any "do something, don't
 36// toggle" menu entry.
 37//
 38// STANDALONE: daslang.exe modules/dasImgui/examples/tutorial/main_menu_bar.das
 39// LIVE:       daslang-live modules/dasImgui/examples/tutorial/main_menu_bar.das
 40//
 41// DRIVE (when running live):
 42//   curl -X POST -d '{"name":"imgui_click","args":{"target":"MAIN_BAR/FILE_MENU/MI_DARKMODE"}}' \
 43//        localhost:9090/command
 44// =============================================================================
 45
 46[export]
 47def init() {
 48    live_create_window("dasImgui main_menu_bar tutorial", 800, 480)
 49    live_imgui_init(live_window)
 50    let io & = unsafe(GetIO())
 51    GetStyle().FontScaleMain = 1.4
 52}
 53
 54[export]
 55def update() {
 56    if (!live_begin_frame()) return
 57    begin_frame()
 58
 59    ImGui_ImplGlfw_NewFrame()
 60    apply_synth_io_override()
 61    NewFrame()
 62
 63    // The bar sits at screen top, NOT inside any window().
 64    main_menu_bar(MAIN_BAR) {
 65        menu(FILE_MENU, (text = "File", enabled = true)) {
 66            // Toggleable — clicking flips MI_DARKMODE.value.
 67            menu_item(MI_DARKMODE, (text = "Dark mode", shortcut = "Ctrl+D"))
 68            menu_item(MI_AUTOSAVE, (text = "Auto-save", shortcut = ""))
 69            separator(FILE_SEP)
 70            // Section header — static, disabled, no check.
 71            menu_label(FILE_HEADER, (text = "(recent files)",
 72                                     shortcut = "", selected = false,
 73                                     enabled = false))
 74            menu_label(FILE_RECENT1, (text = "demo.das"))
 75            menu_label(FILE_RECENT2, (text = "tour.das"))
 76            separator(FILE_SEP2)
 77            // Permanent check — selected=true makes it always-checked.
 78            menu_label(FILE_STAR, (text = "Star this project",
 79                                   shortcut = "", selected = true))
 80            menu_item(MI_QUIT, (text = "Quit", shortcut = "Ctrl+Q"))
 81        }
 82        menu(EDIT_MENU, (text = "Edit", enabled = true)) {
 83            // menu_label for an action — emits click_count, no toggle.
 84            menu_label(EDIT_UNDO, (text = "Undo", shortcut = "Ctrl+Z"))
 85            menu_label(EDIT_REDO, (text = "Redo", shortcut = "Ctrl+Y",
 86                                   selected = false, enabled = false))
 87        }
 88    }
 89
 90    SetNextWindowPos(ImVec2(60.0, 80.0), ImGuiCond.Always)
 91    SetNextWindowSize(ImVec2(680.0, 320.0), ImGuiCond.Always)
 92    window(BODY, (text = "State readout", closable = false,
 93                  flags = ImGuiWindowFlags.None)) {
 94        text("Click items in the bar above; the snapshot updates below.")
 95        separator(BODY_SEP)
 96        text("MI_DARKMODE.value = {MI_DARKMODE.value}")
 97        text("MI_AUTOSAVE.value = {MI_AUTOSAVE.value}")
 98        text("EDIT_UNDO.click_count = {EDIT_UNDO.click_count}")
 99        text("MI_QUIT.value = {MI_QUIT.value}")
100    }
101
102    end_of_frame()
103    Render()
104    var w, h : int
105    live_get_framebuffer_size(w, h)
106    glViewport(0, 0, w, h)
107    glClearColor(0.10f, 0.10f, 0.12f, 1.0f)
108    glClear(GL_COLOR_BUFFER_BIT)
109    live_imgui_render()
110
111    live_end_frame()
112}
113
114[export]
115def shutdown() {
116    live_imgui_shutdown()
117    live_destroy_window()
118}
119
120[export]
121def main() {
122    init()
123    while (!exit_requested()) {
124        update()
125    }
126    shutdown()
127}

8.18.1.21.1.1. Requires

Baseline boost layer (imgui/imgui_boost_v2 re-exports imgui/imgui_containers_builtin). No extra modules.

8.18.1.21.1.2. main_menu_bar vs menu_bar

The two bar variants pick opposite anchor strategies:

  • main_menu_bar(IDENT) { ... } attaches to the viewport — sits at the top of the screen, persists across windows, ImGui draws the chrome. Use it when there’s exactly one bar in the app.

  • menu_bar(IDENT) { ... } attaches to the current window — appears inside that window’s titlebar area. The host window must have ImGuiWindowFlags.MenuBar set, or the menu_bar render is a no-op. Use it for per-document menus inside a tabbed editor, the imgui_demo’s own menu bar, or any window-local command surface.

Both expose the same menu() / menu_item / menu_label children; only the anchor differs.

8.18.1.21.1.3. menu_item vs menu_label

menu_item and menu_label look identical visually (text + optional shortcut + optional check-mark) but back different state structs:

  • menu_item carries ToggleState — the value bool flips on every click. Use it for boolean app-state toggles (“Dark mode”, “Auto-save”, “Show hidden files”).

  • menu_label carries ClickState — the click_count int accumulates without touching selected. Use it for actions (“Undo”, “Quit”, “About”) and for static labels with a fixed check (selected=true) or no check at all.

Combine selected= and enabled= on menu_label to get section headers (selected=false, enabled=false greys the entry and shows no check) or permanent-check items (selected=true, enabled=true shows the check and stays clickable).

8.18.1.21.1.4. Driving from outside

The full menu hierarchy is routable once a menu is open:

curl -X POST -d '{"name":"imgui_click","args":{"target":"MAIN_BAR/FILE_MENU/MI_DARKMODE"}}' \
     localhost:9090/command

The bar’s own header (MAIN_BAR) has a degenerate bbox (the chrome has no clickable “header”). The first-level menu() children (MAIN_BAR/FILE_MENU, MAIN_BAR/EDIT_MENU) DO register routable headers. Submenu items only register a bbox while their parent menu is open, so external drivers wanting to click a menu_item have to open the parent first (synth click on the header, wait one frame, then click the child). The walkthrough above does exactly this with real clicks, dropping straight DOWN the open menu’s column onto each item: a diagonal travel to an item that sits off-axis from its header would clip a sibling header, and ImGui hover-switches the open menu mid-travel (the click then lands in the wrong menu). Menu items span the full menu width, so a vertical drop at the header’s center-x always lands on the item.

8.18.1.21.1.5. Snapshot shape

MI_DARKMODE.value is the live toggle bool; EDIT_UNDO.click_count is the accumulating action counter. Both surface in the snapshot under their qualified path:

curl -X POST -d '{"name":"imgui_snapshot"}' localhost:9090/command \
    | jq '.globals."MAIN_BAR/FILE_MENU/MI_DARKMODE".payload'

The tutorial’s body window prints both per-frame so the state changes are visible alongside the menu interactions.

See also

Full source: modules/dasImgui/examples/tutorial/main_menu_bar.das

Integration tests: modules/dasImgui/tests/test_menu_main.das and modules/dasImgui/tests/test_menu_label_static.das.

Boost macros — the macro layer.

Previous Next

© Copyright 2018-2026, Gaijin Entertainment.

Built with Sphinx using a theme provided by Read the Docs.