The Egel Language

Egel is a very small toy language based on untyped eager combinator rewriting.

Possible uses are:

Egel roughly falls in the same category as Q and conceptually predates Miranda, ML, or Haskell.

The programming style is similar to functional programming though the operational semantics is slightly novel.

Language features

Example code

namespace Fibonnaci (
  using System
  def fib =
    [ 0 -> 1
    | 1 -> 1
    | N -> fib (N-2) + fib (N-1) ]

using Fibonnaci

def main = fib 5

The Egel interpreter

The Egel interpreter is implemented in C++ and designed to swiftly go from reading the sources to evaluation, though these goals are somewhat at odds which each other.

The interpreter is mostly written to explore how far you can push an implementation of a term rewrite system based on a directed acyclic graph in idiomatic C++. Combinators and the evaluation graphs are implemented with reference counted objects and most of the implementation is written with utter disregard for performance. That has drawbacks but it also gives a highly robust system which can be seamlessly integrated into other C/C++ programs. Lastly, the interpreter employs bytecode in a small instruction set for maximal portability.

The interpreter seems to have something between a naive Lisp and Python performance. A REPL and batch mode evaluation is supported.

The interpreter is in an alpha state. It can symbolically rewrite but small bugs are still regularly discovered.

Roadmap and mobile code

Egel is developed as a hobby project to explore some ideas the author has. The intention is to grow the language to support different math libraries and then move towards making the code mobile.

You can find the sources on github. I blog about my progress on blogger. I started on a FAQ.


I would like to thank Linus Torvalds for Linux, the GNU team for their command line tools and compiler chain, Bram Molenaar for VIM, GNOME for their desktop, and Redhat for providing me with a great operating system for the last twenty years.