4 ms·
Reminds me of https://github.com/int3/metajs https://github.com/int3/metajs I like this kind of stuff. A particularly interesting take on this is tailspin, al
by omphalos 11y ago
Reminds me of https://github.com/int3/metajs https://github.com/int3/metajs
I like this kind of stuff.
A particularly interesting take on this is tailspin, although the repo appears have been taken down: https://github.com/wthimbleby/tailspin https://github.com/wthimbleby/tailspin
That one offered a reversible JavaScript debugger written in JavaScript, which I thought that was very impressive from a technical standpoint.
- bartqk 11y agoIt is very similar. But MetaES tries to be production ready and reliable. As far I rememember, tailspin wasn't metacircular, but just an interpreter that interprets some kind of bytecode created from JavaScript source.
- omphalos 11y agoYeah, it seemed designed for educational examples, and worked within in a VM. But I couldn't find a way to easily interop with the external JavaScript environment. It was well-tested though and passed the vast majority of test262. MetaJS has some open issues - some related to the fact that it's intended to let you step through code, which I think makes certain interop scenarios difficult (let's say for example native code calls MetaJS code and expects a return value - it's not possible to set a MetaJS breakpoint there because the native runtime isn't paused). I would be curious to know how MetaES fares under something like test262. I think a metacircular interpreter that does well in an extensive suite like that could indeed be a proper, "safe alternative to eval" (as suggested by another commenter).
- bartqk 11y agoMetaES was tested using test262. Passed most of the cases. https://github.com/metaes/metaes https://github.com/metaes/metaes - "MetaES was tested using test262 test suite. Runnable test suite is currently not added to the repository." You're right about breakpoints while code is called by native functions. That's something that should be discussed more.
- omphalos 11y agoAh, sorry I missed that! Very nice!