home
< Back to Projects

Rye


A functional programming language designed for readability

Click here to see the full documentation on GitHub

Languages in broad use today have convenient shortcuts for a lot of things that programmers had to make by hand in the past.

With JavaScript's objects, a developer never has to create an associative array. Associative arrays were such a broadly useful data structure that it just made sense to weave them into language itself. No need to weigh the pros and cons of various hashing algorithms!

What makes Rye different?


When I started Rye, I asked myself what parts of functional programming were so ubiquitous that it would make sense to weave them into the language itself.

Most functional languages focus on the more arcane aspects of FP. ML-family languages, like Haskell or F#, incorporate currying and partially-applied functions, for instance.

I think it's better to start small. Rye has a few features that are accessible even to FP novices:

How it's made


The project began as a way to better understand parsing and interpreters. I was especially interested in parser combinators, a functional approach to parsing, and so rather than use a library like parsec I built my own.

The Golang gopher mascot

Rye's implementation language is Go, since it has the right balance of low-level control (like pointers and binary executables) and high-level utilities (like garbage collection), as well as a strong type system.

After a front-end of parser combinators, the back-end of the interpreter uses the tree-walk method. Tree-walk interpreters are among the simplest to implement, and are rarely used for production-grade languages, though there have been exceptions.

Try it for yourself


You can view the full documentation and source code, as well as instructions for building the interpreter, on GitHub.

Keep in mind that Rye is a hobby project, not a production-ready interpreter. Someday I may swap the tree-walk back-end for a bytecode one, or maybe even LLVM, but for now it's only for fun.