Dougal Campbell's geek ramblings

WordPress, web development, and world domination.

Monthly Archives: June 2012

mraleph - Explaining JavaScript VMs in JavaScript

Interesting article which explains some of the basics of how virtual machines for programming languages work, and how some of the optimizations are done to help make them performant.

The author walks through a simple program in lua, then uses JavaScript to build a VM which implements the ‘objects are tables’ semantic of the lua language. The example is small enough to serve as a good basis for instruction, while illustrating the deconstruction the kinds of things a VM actually does under the hood.

mraleph – Explaining JavaScript VMs in JavaScript