Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wait a minute, how does this interpreter allow multi-threaded execution without web workers?


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...


Thread switching? Multi-threaded just means it allows concurrent threads; they're not necessarily parallel: https://talks.golang.org/2012/waza.slide




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: