                     parser: makeIotaParser(),
                     transformer: makeIotaTransformer()) { ast in
                         do {
-                            let result = try ast.evaluate(context: IotaContext())
+                            guard let program = ast as? IotaProgram else { throw IotaRuntimeError.cannotEvaluate("") }
+                            let result = try program.run()
                             return "\(result)"
                         } catch {
                             return "error"

    expression.parser = literal | variable | call

    let statement = function | expression
    let statements = statement >>> (newline.some >>> statement).some.maybe
    return statements
}


func makeIotaTransformer() -> IotaTransformer {

    let transformer = IotaTransformer()

    transformer.rule(["numeral": .simple("n")]) {
        let n = try $0.raw("n")
