3 ms·
Wait a minute, how does this interpreter allow multi-threaded execution without web workers?
by peetle 12y ago
Wait a minute, how does this interpreter allow multi-threaded execution without web workers?
- icebraining 12y agoThread switching? Multi-threaded just means it allows concurrent threads; they're not necessarily parallel: https://talks.golang.org/2012/waza.slide https://talks.golang.org/2012/waza.slide
- jaz303 12y agoIt 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-substitution-denotational-big-step-small-step/ http://matt.might.net/articles/writing-an-interpreter-substi...