JavaScript realizer

After listening to Anton Kovalyov’s talk at GothamJS, I thought that a couple of examples of “your code” vs “what JS engine thinks your code is” he was showing were actually very good.

I think linting (and hinting) is not the only way to improve the code and maybe a tool that can convert user’s code to code that JS engine will be actually executing might be eye opening for many developers.

Tool like that would allow developers to see the reality behind the JS standard quirks, would demystify some of the syntax techniques and would help with understanding the semicolon insertions, various scope problems, == vs === difference and so on.

That being said, such tool probably needs some form of minification happening when code is deployed to production, because syntax might be quite verbose and some expansions can be compressed back (see jshint’s eqnull).

I’d love to see an “easy way” of making it happen just using existing engines and all, but not sure if it is possible - parsers don’t necessarily do that so it requires serialization back into JS after compilation and maybe even optimizations.

If you know a good way to do that, please post a comment here.

Maybe  it can even make Anton and Douglas Crockford talk to each other ;)