mix kettlecorn.eval (kettlecorn v0.1.0)

Copy Markdown View Source

Evaluates Elixir code, or Erlang with --erlang, in a fresh sandboxed VM and prints the result.

mix kettlecorn.eval 'Enum.sum(1..10)'
mix kettlecorn.eval --erlang 'lists:sum(lists:seq(1, 10)).'
mix kettlecorn.eval --file script.exs --timeout 2000 --max-memory 268435456

Options:

  • --file PATH - read source from a file instead of a code argument.
  • --erlang - evaluate Erlang instead of Elixir.
  • --timeout MS - evaluation deadline in milliseconds (default 5000). See Kettlecorn.eval/3 for timeout and cleanup behavior.
  • --max-memory BYTES - WebAssembly linear memory cap; see Kettlecorn.Sandbox for the default.
  • --runtime DIR - override normal runtime discovery; see Kettlecorn.Runtime.dir/1 for the search order.

Prints captured output followed by the inspected result. Evaluator errors exit with status 1; other returned errors exit with status 2.