Skip to content
sigc

Architecture

Parse, type-check, execute, serve.

A .sig file travels through four stages. Every stage is a crate you can depend on, and every result is content-addressed so identical inputs never recompute.

01 parse

.sig → AST

shape & calendar errors surface here

02 type-check

AST → typed IR

operators get the dtype/index they expect

03 execute

IR → results

Polars/Arrow + Rayon + SIMD, cache lookup

04 serve

daemon / embed

nng REQ/REP or Strategy::from_file

The compile pipeline

The DSL parser reads the four-block file and emits an abstract syntax tree. Because the language is small and structured, shape and calendar mismatches are caught here — before any data is loaded. The type checker in sig_compiler then validates that every operator receives the dtype and index it expects and that every signal reference resolves, lowering the AST to an intermediate representation.

The IR is handed to sig_runtime, which evaluates the operator graph lazily over Arrow columns with Rayon parallelism and, where the CPU supports it, AVX2/AVX-512 SIMD kernels. Before computing, the runtime hashes the IR and inputs and consults the cache.

Content-addressed determinism

Every compile and run keys its outputs into a cache backed by sled and blake3. Given the same .sig file, parameters, and input data, the cache returns the same intermediate frames, and the backtest emits the same numbers down to the last basis point. Warm hits land in microseconds; cold computations are written back for next time.

The daemon

The same binary runs as sigc daemon: a long-running process that owns the cache exclusively and answers compile and run requests over nng REQ/REP on tcp://127.0.0.1:7240. There is no broker — no Redis, no Kafka, no RabbitMQ. Clients that arrive while the cache lock is held retry with exponential backoff. Production posture (circuit breakers, order rate limits, Prometheus /metrics, JSON audit logs, scheduled jobs) is declared in sigc.yaml.

The six-crate workspace

sigc

CLI and main entry point — run, daemon, and the public Strategy / Backtest API.

sig_compiler

DSL parser and type checker: .sig text to a type-checked intermediate representation.

sig_runtime

Execution engine with 120+ operators over Polars/Arrow, Rayon, and SIMD kernels.

sig_types

Core type definitions shared across the compiler, runtime, and cache.

sig_cache

Deterministic content-addressed cache on sled + blake3.

sig_lsp

Language server powering the VS Code extension: diagnostics, completion, hover.