egel-lang.github.io

The Egel Language

Egel is an untyped concurrent functional scripting language based on eager combinator rewriting with a concise but remarkably powerful syntax.

Possible uses are:

Egel roughly falls in the same category as SASL/KRC and conceptually predates Miranda, ML, or Haskell; it combines a large number of ideas and is an esoteric language exploring dynamic functional programming through relaxing a maximal number of constraints while showcasing a novel means of calculation. Egel is also a useful language for software engineering in the small and easily combines with C/C++.

Egel’s long-term goal is mobile code, transparently shoot any combinator anywhere.

Language features

Example

To get a taste of the language, an example is shown below.

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

using Fibonacci

def main = fib 5

Want to know more? Then read the following short introduction. Or Try it online! For a list of builtin combinators look here.

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 with each other. Egel is primarily about exploiting a trivialized operational model, a program (state) can be represented as a directed acyclic graph solely and program evaluation corresponds to trampolining the combinator at the root of that graph.

Combinators and the evaluation graphs are implemented with standard reference counted objects and the implementation is written with utter disregard for performance.

A REPL, batch mode, and command mode evaluation are supported.

The interpreter is in an alpha state, everything is still subject to possible change.

The sources are on github, author’s thoughts on blogger, or in the FAQ. Also, Twitter. Read the fine manual. The operational semantics are discussed in a small technical note.

The interpreter and associated documentation is distributed under the MIT License, © 2017 Marco Devillers.

Thanks

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.

And of course, TIO for hosting the interpreter online and FSF for their gracious support in supplying access to the compile farm.