RAM execution example #
A runnable example and small wall-clock measurement driver, not a test suite. The program writes an array of consecutive words and then sums it. Both backends execute identical compiled code and input under the same step budget. Elapsed time covers execution, not source compilation or executable preparation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[noinline]
def
executeFast
(executable : Ram.Executable)
(budget : Nat)
(input : List (Ram.Word 64))
:
IO (Ram.RunResult (Ram.Fast.State 64))
Equations
- executeFast executable budget input = pure (executable.run budget input)
Instances For
@[noinline]
def
executeReference
(code : Ram.Code)
(budget : Nat)
(input : List (Ram.Word 64))
:
IO (Ram.RunResult (Ram.State 64))
Equations
- executeReference code budget input = pure (Ram.run code budget (Ram.State.initial input))