4. Embedding and Integration
This section explains how to embed the daslang scripting language into a host application written in C++ or C (and, by extension, any language that can call C functions). It is organized from simple to advanced:
Quick Start — minimal host program, compilation, and evaluation
C++ API Reference — modules, function/type/enum bindings, cast infrastructure
C API Reference — the
daslang/c_api/c_api.hheader for C-only hosts and FFIAdvanced Topics — AOT compilation, standalone contexts, class adapters
For step-by-step walk-throughs with complete, compilable source code, see the C++ integration tutorials and C integration tutorials.
- 4.1. Quick Start
- 4.2. C++ API Reference
- 4.3. C API Reference
- 4.3.1. When to use the C API
- 4.3.2. Initialization and shutdown
- 4.3.3. Text output
- 4.3.4. File access
- 4.3.5. Compilation
- 4.3.6. Simulation and context
- 4.3.7. Function evaluation
- 4.3.8. Argument helpers
- 4.3.9. Calling lambdas and blocks
- 4.3.10. Binding C functions
- 4.3.11. Binding types
- 4.3.12. String allocation
- 4.3.13. Context variables
- 4.3.14. Serialization
- 4.3.15. AOT checking
- 4.3.16. Module groups
- 4.3.17. Side effects
- 4.4. Advanced Topics