Scientific Features
How the compiler and stdlib support scientific computing: hypercomplex algebra, ODE/PDE hooks, and domain modules.
Scientific Features
Sounio’s compiler is designed around scientific computing needs: it contains IR-level support for numeric primitives and integrates with a large domain-focused standard library.
This page is a map of where scientific “pillars” live in the codebase.
Hypercomplex Algebra (Quat / Octonion / Sedenion)
The compiler IR contains dedicated numeric types for SIMD- and GPU-friendly math (e.g., Quat, Octonion, Sedenion), with runtime support and GPU kernel implementations.
Key locations:
- IR type definitions:
crates/souc/src/hlir/ - Native runtime helpers:
crates/souc/src/backend/native/ - GPU kernels and lowering:
crates/souc/src/codegen/gpu/
Note: surface-level APIs for these types typically live in
stdlib/modules. The compiler mostly focuses on representation + lowering.
Why Dedicated Types?
These types exist to keep scientific computation:
- predictable and optimizable (SIMD-friendly layouts)
- explicit in IR (instead of “just structs everywhere”)
- portable to GPU lowering paths where layout matters
ODE/PDE and Scientific DSL Hooks
The parser and AST include items intended for scientific DSLs (ODE/PDE, causal models, ontology alignment, etc.). Depending on feature flags and compiler mode, some of these constructs lower into library calls and/or dedicated runtime support.
Practical guidance:
- If you’re writing user-facing code, prefer the
stdlib/modules and runnable examples. - If you’re extending the language, start from the AST item definitions and the lowering path into HIR/HLIR.
Quantum, Geometry, and ML Modules
The compiler crate contains additional scientific subsystems that are typically exercised through stdlib APIs and examples:
crates/souc/src/quantum/— quantum circuit representation and helperscrates/souc/src/geometry/— geometry/constraint-style modulescrates/souc/src/ml/— ML-related infrastructure and experiments
Standard Library as the Main Surface Area
Many scientific features are primarily delivered through the standard library (ODE solvers, probabilistic tools, causal inference, ML, etc.).
docs/STDLIB_REFERENCE.mdprovides a high-level index of modules and maturity.