Skip to the content.

Fun Programming Language Documentation

Welcome to the Fun programming language! Fun is a purely functional programming language with type inference, built in Go with Tree-sitter parsing and LSP support.

Quick Navigation

What is Fun?

Fun is a functional programming language designed for:

Key Features

Functional Programming

Type System

Developer Tools

Getting Started

  1. Install: Clone and build the project
  2. Try REPL: Run ./fun for interactive development
  3. Run Programs: ./fun examples/basic/main
  4. IDE Setup: Install the VS Code extension

Example

import lib from `./lib`

# computes the sum of integers from 1..n
sum_range : Lam<Int, Int>
sum_range = fix(\rec -> \n ->
    when n == 0 is
        True t -> 0;
        False f -> n + rec(lib.dec(n))
)

sum_range(100) # result: 5050

Community


Start with the Language Guide to learn Fun programming!