gsh/evaluator/evaluator

The evaluator module is the core module of the GSH REPL.

Because Gleam is statically typed and compiled, we cannot evaluate raw AST dynamically like Elixir’s IEx. Instead, this module acts as a synthetic runtime, taking the user’s input, injecting historical state (imports, bindings, types, functions), and generating a unique gsh_eval_X.gleam file for execution.

Key Capabilities:

Values

pub fn evaluate(
  input: String,
  bindings: List(binding.Binding),
  imports: List(String),
  types: List(String),
  functions: List(String),
  debug: Bool,
  prompt_count: Int,
) -> result.Evaluation
Search Document