Skip to content

Jessie meets lua/go? #60

@dckc

Description

@dckc

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:

  1. 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
  2. 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
  3. grab cases from test262; progress from the JSON subset to Justin and Jessie
  4. full fuzzing of Jessie

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions