eyg_interpreter

Gleam implementation of the EYG language. This implementation runs on JavaScript runtimes and works in the browser.

Package VersionHex Docs

gleam add eyg_interpreter@1

This library defines two execution modes:

If in doubt use the expression module. Block is useful for creating shells (or REPLs, terminals, consoles).

import eyg/interpreter/expression
import eyg/ir/tree as ir
pub fn main() {
let source = ir.let_("x", ir.integer(5), ir.variable("x"))
let scope = []
expression.execute(source, scope)
// => value.Integer(5)
}

Further documentation can be found at https://hexdocs.pm/eyg_interpreter.

Development

gleam run # Run the project
gleam test # Run the tests