-
Notifications
You must be signed in to change notification settings - Fork 26
Description
The Agoric platform runs contracts on XS, a JavaScript engine designed for embedded systems. It was chosen for its support of deterministic execution and affinity for Hardened JS, not for its speed. Contracts spend significant time marshalling data into messages and back out, as well as pattern validation.
JavaScript (especially the Jessie dialect) has a lot in common with Lua.
Why Go Rocks for Building a Lua Interpreter explains a number of performance techniques that seem to remain deterministic.
I took note of this nugget:
Freezing prevents unintentional global state and permits sharing Lua data values among concurrent lua.State interpreters without copying.
How many 10x speedups might that lend to the Agoric platform?
Tantek's polyglot cassis makes serious use of the intersection of js and php. I wonder to what extent the JS/Lua overlap could be used to bootstrap testing of a port of the zb lua interpreter to JavaScript:
- start with a handful of cases: some JSON data, a few Justin expressions.
a. stay within the subset where evaluation semantics agree
b. expand out to a few cases where they differ; have a bot fix the code to match JS semantics - have a bot generate a few hundred cases cases and separate them between those where the semantics agree and where they differ; have the bot continue to port the code
- grab cases from test262; progress from the JSON subset to Justin and Jessie
- full fuzzing of Jessie