4 ms·
Interesting. How much of the JS infrastructure do you need for this stuff to work? I'm in the middle of creating a JS port for embedded systems (yes, I know a
by bsder 13y ago
Interesting. How much of the JS infrastructure do you need for this stuff to work?
I'm in the middle of creating a JS port for embedded systems (yes, I know about Espruino. It made some fundamental decisions about object implementation that I find unacceptable) and it would be nice to be able to lean into something like this to avoid implementing huge chunks of the more advanced language bits.
Side note: I'm the person who did the first Nintendo DS port of Gambit so its interesting to see how all this comes full circle.
- guillegette 13y agoTo read this type of comments is why i check HN everyday
- jlongster 13y agoI remember hearing about the Nintendo DS work. Great stuff! What I'm working on relies on a full JS implementation. Performance is a critical feature so I need to implement as little as possible. I basically implemented a very small VM that controls JS code using exceptions. What I've done lets you run JS code with a 3-4x perf hit, but you get full stepping and debugging abilities in user-land. I'm going to release it in a few weeks! It sounds like it's not quite what you're looking for though. You're project sounds cool!
- malandrew 13y agoIs this project already public on github? Outlet and Outlet-Machine look like what you're describing but the docs on those say they are deprecated/frozen and the last commits are 1-2 years ago.
- jlongster 13y agoNo, not yet. I was exploring this indeed with outlet but discovered that wasn't the right way to do it. My technique came together very recently and I plan on releasing it soon.
- bsder 13y agoInteresting. I may have to look at your exception usage and see if I can emulate the same thing faster with some hooks directly into my VM. No point in running a VM on a VM if I can just implement the hooks directly. Your code probably isn't what I'm looking for right now. But single stepping and debugging in user-land is exactly what embedded systems need. I'll keep an eye out for your stuff.
- jlongster 13y agoYou don't need to wait for my stuff, it's all in here: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.89.9765 http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.89.9... I reworked the same technique to make it a debugger instead of continuations.