Interrupting some JS to execute other JS isn't really something that's possible right now,...
...and it should not - at least not in a simple way - because it messes with the single threaded concept which makes programming as simple as it is...
As soon as this can happen, semaphoring is required throughout a lot of code to make sure the things are before as they are after (partial) execution of a statement. Even with the means as mentioned - Assembly, inline and compile JS - coding has to follow certain rules and respect constraints in order to not make Espruino's (execution) consistency fall apart... as obviously - as much as I connected the dots - has already happened in some way in some implementation for pixl.js... I may be mistaken, but certain chosen concepts will stand for ever. Yes, they may make certain new implementations a bit more challenging, but they have bin chosen in the first place to get even started and evolve fast and successfully to the current state.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
...and it should not - at least not in a simple way - because it messes with the single threaded concept which makes programming as simple as it is...
As soon as this can happen, semaphoring is required throughout a lot of code to make sure the things are before as they are after (partial) execution of a statement. Even with the means as mentioned - Assembly, inline and compile JS - coding has to follow certain rules and respect constraints in order to not make Espruino's (execution) consistency fall apart... as obviously - as much as I connected the dots - has already happened in some way in some implementation for pixl.js... I may be mistaken, but certain chosen concepts will stand for ever. Yes, they may make certain new implementations a bit more challenging, but they have bin chosen in the first place to get even started and evolve fast and successfully to the current state.