Anchor News
Technology

Show HN: Fuse – statically typed functional programming language

Hi HN! I've been working on the fuse programming language, it's a statically typed purely functional language with higher-kinder types and ad-hoc polymorphism. It compiles to the GRIN whole-program optimizer, producing LLVM-generated native code. Fuse supports ADTs, Generics, Type Methods, Traits, Pattern matching etc.

Anchor News
- 2 min read
Show HN: Fuse – statically typed functional programming language

Fuse is a statically typed, purely functional language with higher-kinded types and ad-hoc polymorphism. It compiles to the GRIN whole-program optimizer, producing LLVM-generated native code.

trait Functor[A]: fun map[B](self, f: A -> B) -> Self[B]; impl List[A]: fun fold[A, B](l: List[A], z: B, f: (B, A) -> B) -> B match l: Cons(h, t) => List::fold(t, f(z, h), f) Nil => z fun sum(l: List[i32]) -> i32 List::fold(l, 0, (a, b) => a + b) impl Functor[A] for List[A]: fun map[B](self, f: A -> B) -> List[B] List::fold(self, Nil[B], (t, h) => Cons(f(h), t)) fun fmap[A, B, F: Functor](f: A -> B, x: F[A]) -> F[B] x.map(f) fun main() -> IO[Unit] let l = Cons(1, Cons(2, Cons(3, Nil))) let l2 = fmap(x => x * 2, l) print(int_to_str(List::sum(l2)))

Features

Statically typed

Type system based on System F with higher-order polymorphism. Algebraic data types, generics, and traits give you powerful tools to model your domain.

Purely functional

Every function in Fuse is a pure function. Pattern matching, higher-order functions, and do notation let you write expressive, composable code.

Type inference

Bidirectional type checking with support for higher-order types. Only function type signatures are required, for readability and verbosity. Everything else is inferred.

Clean syntax

Drawing inspiration from Rust, Python, Scala, and Haskell to bring a readable syntax to purely functional programming. Indentation-based blocks, lambda expressions, and ML-like syntax keep code clean and approachable.

Compiles to GRIN

Whole-program optimization through GRIN and code generation via LLVM produces fast, small native binaries with zero-cost abstractions.

Install Fuse

Get the Fuse toolchain on Linux (x86_64) or macOS (ARM64).

curl -fsSL https://fuselang.github.io/fuse/fuseup | sh