SPECTRALANG_
SpectraLang logo

A language designed for AI/ML workloads and first-class API services.

SpectraLang is an open-source, JIT-compiled programming language for AI/ML workloads and API services. Tensors, autodiff and differentiable regions are language-level constructs, not libraries — from tensor graphs to production APIs, all in one toolchain.

[ TENSOR-FIRST AI/ML CORE ] [ FIRST-CLASS API SERVICES ] [ JIT EXECUTION ]

[ active development — not yet a stable production language ]

// SECTION 01 — WORKSTREAMS

TWO FIRST-CLASS_TRACKS

One language, two production workstreams that are first-class in the language and the standard library.

[01] AI/ML CORE

std.tensor
  • First-class tensors with shape and dtype constraints (Tensor<T, R>)
  • Reverse-mode autodiff and differentiable regions as language-level constructs
  • SSA-based IR with optimization passes and JIT execution
  • ML framework layer: layers, losses, optimizers, datasets, dataloaders
  • ONNX import/export, NumPy .npy interchange, Python/FFI bridges
  • Experiment tracking, distributed-training foundations, reproducibility tooling

[02] API PLATFORM

spectra.api
  • First-class async/await with a platform-aware reactor (epoll / IOCP / kqueue)
  • spectra.api package: HTTP/1.1 server and client, JSON, routing, middleware
  • Typed HTTP primitives: Request, Response, Method, Status, Header, Cookie
  • Database drivers for PostgreSQL, SQLite, and Redis (in development)
  • TLS, authentication, validation, and structured error handling on the roadmap
  • Observability: OpenTelemetry tracing, Prometheus metrics, health checks

// SECTION 02 — SOURCE

REAL CODE,_TRANSLATED

Bundled examples straight from the repository — comments translated to English, code untouched.

spectralang run examples/syntax_quickstart.spectra
module syntax_quickstart
from std.io import println
func welcome(name: string) returns string {
    return f"Hello, {name}!"
}
public func main() returns int {
    let name    = "SpectraLang"
    let message = welcome(name)
    println(message)
    let total = 0
    for item in [1, 2, 3] {
        total = total + item
    }
    if total > 5 and not total == 0 {
        println("clear syntax")
    } else {
        println("keep exploring")
    }
    return 0
}

* comments and messages translated to English for clarity — the code itself is unchanged from the bundled examples in the https://github.com/Hyska-Software/SpectraLang repository

// SECTION 03 — SETUP

INSTALL_IT

Grab the latest release for your platform — fetched live from GitHub — or build from source.

[ FETCHING LATEST RELEASE FROM GITHUB ... ]

[ BUILD FROM SOURCE ]

  1. STEP 01Clone the repository

    $> git clone https://github.com/Hyska-Software/SpectraLang.git
  2. STEP 02Enter the workspace

    $> cd SpectraLang
  3. STEP 03Build the full workspace (compiler, runtime, CLI, LSP)

    $> cargo build
  4. STEP 04Install the spectralang CLI on your PATH

    $> cargo install --path tools/spectra-cli

[ CLI ESSENTIALS ]

  • spectralang compile <paths>Compile Spectra modules (default).
  • spectralang check <paths>Type-check modules and report diagnostics without executing.
  • spectralang run <paths>Compile modules and execute the entry point via JIT.
  • spectralang lint <paths>Run lint checks and report warnings or denied rules.
  • spectralang bench <paths>Compile with timing metrics and optional JSON report.
  • spectralang fmt <paths>Format Spectra source files.
  • spectralang replStart an interactive Spectra prompt.
  • spectralang new <path>Scaffold a new Spectra project.
  • spectralang package <action>Resolve, lock, build, publish, and consume packages.
  • spectralang release-infoReport CLI and package release channel metadata.

// SECTION 05 — FAQ

FREQUENTLY_ASKED

Direct answers about SpectraLang — what it is, how to install it, and what you can build with it.

[Q01]What is SpectraLang?

SpectraLang is an open-source, JIT-compiled programming language designed for AI/ML workloads and first-class API services. It makes tensors, reverse-mode autodiff and differentiable regions language-level constructs instead of libraries, and ships an HTTP server/client stack (spectra.api) in its standard library.

SOURCE: Introduction reference

[Q02]Is SpectraLang open source?

Yes. SpectraLang is 100% open source and released under the MIT License. The full toolchain — compiler, runtime, CLI and LSP — lives in the public Hyska-Software/SpectraLang repository on GitHub.

SOURCE: GitHub repository

[Q03]How do I install SpectraLang?

SpectraLang ships prebuilt binaries: a Windows installer (stable), Linux .deb packages and macOS ARM64/x64 binaries (experimental). You can also build the entire toolchain from source with cargo in four commands. See the install page for platform assets and build steps.

SOURCE: Installation guide

[Q04]How is SpectraLang different from Python for machine learning?

Unlike Python, where tensors and autodiff are imported libraries, SpectraLang implements them as language-level constructs: typed tensors (Tensor<T, R>) with shape and dtype constraints, reverse-mode autodiff, SSA-based IR with JIT execution, and ONNX import/export for interop. The language reference documents the tensor and ML framework layers in detail.

SOURCE: Standard library reference

[Q05]Can I build web APIs with SpectraLang?

Yes. The spectra.api package provides a first-class HTTP/1.1 server and client, routing, middleware, JSON and typed Request/Response primitives, backed by a platform-aware async reactor (epoll / IOCP / kqueue). Database drivers for PostgreSQL, SQLite and Redis are in development.

SOURCE: API platform docs

[Q06]Which platforms does SpectraLang support?

Windows is the stable target, with Linux (.deb and tarballs) and macOS (ARM64 and x64) builds available as experimental. The CLI works uniformly across all three: compile, run, check, lint, bench, fmt, repl, new, package and release-info.

SOURCE: CLI reference

[Q07]What can I build with the standard library?

The standard library covers std.io, std.string, std.math, std.convert, std.collections, std.tensor, std.ml, std.time and more. The ML framework layer includes layers, losses, optimizers, datasets and dataloaders, plus experiment tracking and distributed-training foundations.

SOURCE: Stdlib reference