Functional language for intensional polymorphism and first-class staging
Top 39.9% on sourcepulse
Spiral is a statically typed, functional programming language designed for high-performance computing, particularly targeting novel AI hardware. It aims to bridge the gap between expressive, high-level languages like Lisp and low-level, performant languages like C by offering first-class staging, intensional polymorphism, and fine-grained control over memory allocation and inlining. Its primary use case is the development of machine learning libraries for specialized hardware.
How It Works
Spiral employs a staged functional programming paradigm, distinguishing between a top-down segment (ML-style type system with unification) and a bottom-up segment (partial evaluation). This dual approach allows users to leverage powerful static type checking for most of their code while enabling low-level control and metaprogramming capabilities through partial evaluation. Key features include join points for function specialization, a flexible type system with support for higher-ranked types and GADTs, and macros for language interop and code generation.
Quick Start & Requirements
Highlighted Details
noinline_
for join points and \v
for Cuda array declarations.Maintenance & Community
The project is actively developed by mrakgr, with recent updates adding GADTs and higher-ranked types. There is a YouTube channel with a playlist dedicated to Spiral.
Licensing & Compatibility
The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.
Limitations & Caveats
1 month ago
Inactive