Hiss

Toy programming language and bytecode compiler.

Poorly-drawn Hiss logo

Hiss is my WIP hobby programming language. It features a bytecode compiler written in Haskell and a virtual machine written in Zig. Hiss is named in honor of a copperhead snake discovered in the basement of my parents’ house, which was then serving as my bedroom.

I’m building Hiss to learn more about compilers, interpreters, and functional programming. (So here’s your disclaimer: it’s neither well-tested nor stable and will almost certainly never be recommended for production use.)

Try Hiss for yourself on the playground. Check out its source code on GitHub.

Example

Here’s a sample Hiss program that computes the Collatz stopping time of 27:

// computes k mod n
mod(n, k) = if k < n
            then k
            else mod(n, k-n)

mod2 = mod(2) // partial application of mod

// returns stopping time of n
collatz(n, steps) = if n == 1
                    then steps
                    else if mod2(n) == 0
                         then collatz(n/2, steps + 1)
                         else collatz(3*n + 1, steps + 1)

main() = collatz(27, 0) // should output 111

Try running this program on the playground!

More details

Hiss is:

It supports some cool features from functional programming:

Hiss is open-sourced on GitHub. It has two main components:

hissc and hissvm are still in progress, but they already include:

Planned work includes