1. egel(1)
  2. egel(1)

EGEL(1) Version 0.1 | The Egel interpreter

NAME

egel - an untyped functional scripting language

SYNOPSIS

egel [- --interact] [-I path --include path] [file]
egel [-I path --include path] -e command
egel [-h --help -v --version]

DESCRIPTION

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

Egel's basic functionality can be extended with your own modules written in C++. Those modules are dynamically loaded.

OPTIONS

-h, --help
Prints brief usage information, may list debug options.
-v, --version
Prints the current version number.
-, --interact
Enter interactive mode unconditionally.
-e, --eval <command>
Evaluate the given command.
-I, --include <path>
Add an include path.

TUTORIAL

Egel is an expression language and the interpreter a symbolic evaluator.

Expressions

Egel code consist of expression which are evaluated eagerly.

Declarations

Declarations define combinators.

Modules

A module is a series of combinator declarations possibly encapsulated in a namespace. All combinators are named lowercase, there is some provisional support for unicode. Modules may import each other. The main combinator of the top module drives all computation when present.

Tying it all together:

# A Fibonacci implementation.

import "prelude.eg"

namespace Fibonacci (
  using System

  def fib =
    [ 0 -> 0
    | 1 -> 1
    | N -> fib (N- 2) + fib (N- 1) ]

)

using System

def main = Fibonacci::fib (3+2)

EXAMPLES

There are three modes in which the interpreter is used: batch, interactive, or command mode.

In batch mode, just supply the top module with a main combinator.

$ egel helloworld.eg
Hello world!

The interpreter will start in interactive mode when invoked without a module argument.

$ egel
> using System
> 1 + 1
2

Supply a command to use egel -e as a simple calculator. Double semicolons are separators.

$ egel fib.eg -e "using Fibonacci;; fib 3"
5

FILES

The following files should be in the EGEL_PATH directory.

prelude.eg calculate.eg search.eg
The standard Egel prelude and additional scripts.
os.ego fs.ego regex.ego
input/output, filesystem, regexes dynamic libraries.

ENVIRONMENT

EGEL_PATH
The directories that are searched for inclusion.
EGEL_PS0
The prompt given by the interpreter in interactive mode.

BUGS

See GitHub Issues: https://github.com/egel-lang/egel/issues

AUTHOR

MIT License (c) 2017 M.C.A. (Marco) Devillers marco.devillers@gmail.com

SEE ALSO

c++(1)

  1. August 2024
  2. egel(1)