Warning
Heavy Development Phase: Sigma is currently in active pre-alpha development. Features, syntax, and APIs are subject to breaking changes without notice. Use with caution.
Sigma is a high-performance, strictly-typed functional programming language designed specifically for mathematical computation and linear algebra. It combines the safety and elegance of functional programming with the raw speed of Rust and the ease of use of Python.
For a detailed manual and reference, please consult the User Guide.
This project follows a quarterly release cycle. The repository is updated with substantial new features and stability improvements upon every stable release. Between releases, the main branch may contain experimental features.
- Math-First Primitives:
Complex,Vector, andMatrixtypes are built-in first-class citizens, not external libraries. - Functional Core: Immutable data, higher-order functions (
map,filter,fold), and currying by default. - Safety: Hindley-Milner type inference ensures type safety at compile-time without cluttering your code with annotations.
- Rust Runtime: A stack-based bytecode VM implemented in Rust for performance.
- Python Integration: Seamlessly call Sigma code from Python, passing Numpy arrays with Zero-Copy overhead.
Sigma is built with Rust. You'll need the latest stable Rust toolchain.
# Clone the repository
git clone https://github.com/rottenbff/sigma.git
cd sigma
# Build the CLI and Shared Library
cargo build --releaseYou can run .sg files directly using the CLI:
# Run a script
cargo run --bin sigma-cli -- path/to/script.sg
# Example
cargo run --bin sigma-cli -- demo_neural.sgSigma is designed to be embedded in Python workflows.
- Build the project as a dynamic library (creates
sigma.dllorsigma.so). - Ensure the library is in your Python path (or rename to
sigma.pydon Windows).
import sigma
import numpy as np
# Load a Sigma script
ctx = sigma.load("my_model.sg")
# Create data (Numpy arrays are passed efficiently)
data = np.array([1.0, 2.0, 3.0])
# Call a function defined in 'my_model.sg'
result = ctx.process_data(data)
print(result)Signal Processing (Gaussian Smoothing)
# Define a Gaussian function
gaussian sigma x =
(1.0 / (sqrt (2.0 * pi) * sigma)) * exp (-(x * x) / (2.0 * sigma * sigma))
# Apply smoothing to a vector
smooth data =
let kernel = map (gaussian 1.0) [-2.0, -1.0, 0.0, 1.0, 2.0] in
# ... logic to convolve kernel with data ...
data # Placeholder returnsrc/: Rust source code for Compiler, VM, and Type Checker.src/stdlib.rs: Native implementations of standard library functions.demo_*.sg: Example scripts showcasing language features.
Development of this project began in 2023. Prior to December 2025, the source code was managed and hosted self-hosted using Clay, a custom version control system I developed for my local Dell Optiplex server. The commit history on GitHub represents the migration snapshot and subsequent development.
This project is licensed under the MIT License.