Fungo

With 6k lines of code and 132 unit tests, Fungo is probably the most advanced of my projects. It is a statically typed functional programming language with a parser, type checker, and interpreter written in Rust.
The language is heavily inspired by Elixir and Go.
For demonstration purposes, I have written a simple web-based environment where you can write and run Fungo code. The code is interpreted in the browser using WebAssembly.

Example Programs

A Fungo program evaluates to the value of the last expression. This means that you can write simple programs like this:

"Hello, World!"

You can also destructure lists and tuples.

l = [1, 2, 3] [a, ...b] = l [...c, d] = l [e, _, f] = l ((a, b), (c, d), (e, f))

You can define functions using the func keyword.

fib = func(n int) int { match n { 0 -> 0, 1 -> 1, _ -> self(n - 1) + self(n - 2) } } fib(20)

© 2024 Marek Wallich