News for hackers. Stuff that matters.
Re:Step-by-step JavaScript interpreter, written in JavaScript by peetle on Thursday October 09, 2014 @05:33PM (#8435124)
Wait a minute, how does this interpreter allow multi-threaded execution without web workers?
Re:Step-by-step JavaScript interpreter, written in JavaScript by jaz303 on Thursday October 09, 2014 @06:51PM (#8435419)
It uses a small-step interpreter [1]. Rather than capturing the interpreter's state on the native call stack, small-step interpreters explicitly model said state using stacks of objects - one per active AST node - and environments. Because they're no longer bound to the stack of the implementation language, execution may be cycled, paused and resumed at will.

[1] http://matt.might.net/articles/writing-an-interpreter-substi...

Re:Step-by-step JavaScript interpreter, written in JavaScript by icebraining on Thursday October 09, 2014 @05:54PM (#8435215)
Thread switching? Multi-threaded just means it allows concurrent threads; they're not necessarily parallel: https://talks.golang.org/2012/waza.slide