rrose1 / jsonesharp

A browser-based implementation of the 1# text register machine
GNU General Public License v2.0
6 stars 6 forks source link

interpreter is too slow #1

Closed rrose1 closed 9 years ago

rrose1 commented 9 years ago

The interpreter is implemented along the same lines as the universal program itself that we have to write in 1#. This makes it much slower than it might be. For example, the program is not even parsed before execution.

So looking for various (easy) ways to optimize the interpreter's performance.

rrose1 commented 9 years ago

We should make use of HTML5's web workers to enable interruptible evaluation without "setInterval". This would require maintaining the registers as a data structure separate from the DOM, unfortunately, during evaluation. But perhaps some intermittent message passing will allow the DOM still to be animated during evaluation.

lmoss commented 9 years ago

I don't know what any of that stuff is about, sorry to say.

Larry

On Fri, Jan 30, 2015 at 5:21 PM, Robert Rose notifications@github.com wrote:

We should make use of HTML5's web workers to enable interruptible evaluation without "setInterval". This would require maintaining the registers as a data structure separate from the DOM, unfortunately, during evaluation. But perhaps some intermittent message passing will allow the DOM still to be animated during evaluation.

— Reply to this email directly or view it on GitHub https://github.com/rrose1/jsonesharp/issues/1#issuecomment-72280587.

rrose1 commented 9 years ago

v0.2 has a parser, uses an array as a registers object (instead of a branch of the DOM) and most importantly is multithreaded.

We can experiment with adding an option to slow down the computation and animate the registers in the DOM for pedagogical purposes in the future.