HTML5 framework with metacircular code

Most of us probably is used to think that we can program only with code of the given language. You may guess that I’m going to say that there are other options. The alternative I’d like to talk about is not graphical programming with blocks, Excel or GUI configurations. I rather have on mind the tool that allows to feed Virtual Machine with instructions that in first place are produced from source code. In case of MetaES those instructions are AST. MetaES expects to see AST compatible with Mozilla Parser API. Such AST can be trivially created from pure code running esprima.parse(code), but this is not the only way.

Continue reading

ES7 await

It’s tempting to start exploring await keyword expected in ECMAScript 7 standard. We’ve tried to overcome callback hell with libraries, async.js and its variations, transpilations (sweet.js, IcedCoffeeScript) and finally Promises, which seem to be quite good finish of that research. But, still, Promises are just a library, even if standard native library, therefore there is some implementation leaking up to the business code (.then, .all etc). Going forward, ES6 yield + spawn are leaky abstraction as well and in fact a hack, because they were not designed for asynchronous calls without callback functions.

Continue reading

Metacircular dirty checking

We’ve been to few places trying to observe JavaScript values changes automatically. The examples are:

It seems that Object.observe will clear up this field for a good, but why don’t try to test if it’s possible to take different approach using MetaES interceptors.

Continue reading

MetaES introduction

MetaES is a metacircular interpreter (http://en.wikipedia.org/wiki/Meta-circular_evaluator) written in JavaScript at EcmaScript 5.1 standard, so it can run on pretty any environment that supports ES5, for example modern browsers (both with mobile), nodejs, rhino, nashorn and other ECMAScript interpreters.
For parsing JavaScript it uses esprima http://esprima.org/.

Continue reading