Arc Forumnew | comments | leaders | submitlogin
2 points by rocketnia 1663 days ago | link | parent

It's great to see you again! Sometimes I've wondered about the status of Semi-Arc. Looks like you've been working on a number of other Lisp implementations in the meantime! Pretty exciting. Thanks for sharing this update with us.

As someone who ported Rainbow line by line to JavaScript, I have to say, the size of the codebase can be quite daunting. A smaller implementation sounds a lot easier to work on.



5 points by suzuki 1662 days ago | link

It is my pleasure.

As I referred in README.md, the implementation of this arc's continuations is based on https://github.com/nukata/little-scheme-in-java. If you are planning to port this arc to JavaScript, I suggest reading https://github.com/nukata/little-scheme-in-typescript which implements the continuations in the same way in TypeScript.

And in the latter, the display function https://github.com/nukata/little-scheme-in-typescript/blob/v...

  c('display', 1, x => {
      write(stringify(fst(x), false));
      return new Promise(resolve => {
          runOnNextLoop(() => resolve(None));
      });
  },
is applied asynchronously, in a sense, as follows: https://github.com/nukata/little-scheme-in-typescript/blob/v...

  case ContOp.ApplyFun: // exp2 is a function.
      [exp, env] = applyFunction(exp2, args, k, env);
      if (exp instanceof Promise)
          exp = await exp;
      break;
This means the web page is still interactive during the evaluation effectively. Here is an example: https://nukata.github.io/little-scheme-in-typescript/example. Click the "Load" button twice and you will see two "yin-yang puzzle" threads run on the page. Click the "Stop at Writing" button twice to stop them.

-----