remedy-lua 0.1.2

A Lua 5.4 superset in safe Rust for running untrusted scripts: exact fuel, memory and depth limits, an incremental collector, an optional typed dialect and a capability-based host API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
-- Closures made in a loop, capturing loop locals, called once or kept briefly.
local s = 0
local keep = {}
for i = 1, 300000 do
  local a, b = i, i * 2
  local f = function(x) return a + b + x end
  local g = function() a = a + 1 return a end
  s = s + f(1) + g()
  keep[i % 64 + 1] = f
end
return s