Sunday, May 5, 2013

Some progress on the Wat VM

Wat is back! If you'll recall, Wat is my ultra-minimal (~500 lines of JS) interpreter for a Kernel-based language with delimited continuations as well as first-order control, and hygienic macros as well as fexprs.

I'm pretty excited by some recent and ongoing changes, which make Wat even smaller and turn it into more of a VM than a full language. Wat will provide (just) the following features:
  • delimited continuations and delimited dynamic binding (higher-order control); these will be used to build cooperative multithreading with thread-local bindings
  • try/catch/finally (first-order control) integrated with the JS stack, but suspendable by continuation capture
  • fexprs as well as in-source self-modifying-code memoizing macros (which are hygienic, as they're built on Kernel)
  • a native JS interface
And that's about it. This should give an extremely minimal yet powerful infrastructure for building JavaScript-based languages.

And I gave up on quasiquotation and Scheme-style hygienic macros again. I just cannot get them to work in a satisfying manner.

Exempli gratia, here's some initial Wat VM "microcode" for bootstrapping a vaporlanguage.

1 comment:

  1. Over on the arc forum we're wondering what went wrong with your previous post on quasiquote: http://arclanguage.org/item?id=17662

    ReplyDelete

Real names (or handles), please. Anonymous comments are likely to be ignored.