Skip to content

v2.1.0

Latest

Choose a tag to compare

@github-actions github-actions released this 11 Nov 00:36
· 2 commits to master since this release

Changes

  • Add --max-steps N to file execution and the REPL.
  • Stop before the next instruction when the execution budget is exhausted.
  • Preserve the current stack and arrays after reaching the limit.
  • Report the blocked instruction through --trace.
  • Document execution limits in the Korean, English, and Japanese README guides.

Execution step limits

Limit a program to 1,000 instructions:

yahalang run examples/truth_machine.yaha --lang ko --max-steps 1000 --error-style friendly

When the budget is exhausted and another instruction remains, execution stops with status 1. Friendly errors report:

execution step limit exceeded

Without --error-style friendly, the diagnostic is haa? haa?.

The limit counts executed instructions, including each loop condition check and loop-end instruction. Skipped code does not count. A number or array literal counts as one instruction regardless of its length.

Omitting --max-steps keeps execution unlimited. Setting it to 0 prevents any instruction from running.

REPL behavior

Each complete submission gets a fresh execution budget:

yahalang repl --lang en --max-steps 3 --error-style friendly
yaha> hayaha ppuru yaha
yaha> iya yadayada
...> ura yadayada
runtime error at line 2, instruction 1: execution step limit exceeded
yaha> :stack
[1]
yaha> :reset
yaha> hayaha ppuruppuru yaha
yaha> iiiiyaha ppururu
2
yaha> :q

The loop stops at the limit, and the REPL remains available. Existing stack values and array mutations are preserved. REPL commands such as :stack and :reset do not count toward the budget.

Tracing and scope

Combine execution limits with tracing to inspect where a program stops:

yahalang run examples/truth_machine.yaha --lang ko --max-steps 1000 --trace

The blocked instruction produces an error trace entry without being executed.

Execution limits apply to the Rust interpreter, including the REPL. They do not apply to generated C executables or limit memory usage or time spent waiting for input.


Full Changelog: v2.0.0...v2.1.0