I know you've come across https://github.com/espruino/espruino-tools and the code it uses - I think some of this would be really good if it was integrated into that?
Specifically I'd love to get browserify (or something like it) working inside the Web IDE - ideally with some offline minification too. If it were able to drop functions that weren't used, and inline/rename ones that were (I guess this is the idea?) then it'd save a load of Espruino's RAM.
I wonder whether a better way to accomplish that (than re-packaging all of Espruino's modules) is to override the 'module getter' in browserify to just look online for the Espruino modules? As chrome doesn't have access to the local filesystem, creating a copy of all the modules there won't really help - and as the library of modules grows over time it'll become slower and slower.
Or were you doing this so that the editor you use can find the modules and follow function definitions into them?
As far as Spire, will it use EspruinoTools? I ask because a lot of work has gone into (and will continue to go into) making EspruinoTools format code in the right way for Espruino in order to avoid subtle problems. Re-implementing that code really doesn't help very much, but if you could actually make EspruinoTools provide that nice stream interface (which the WebIDE Terminal could then connect to) it would mean that people could pull in that library, or in fact use the command-line tool and pipe to stdin/out.
In the module you ask about the binary notation. It's because when accessing registers in hardware it's often a lot easier to read. It's part of ES6 so you could probably just run node --harmony and it'd work fine?
Just wondering about https://www.npmjs.com/package/espruino too - would it me possible for you to rename this to espruino-modules or similar? It's my fault for not grabbing the module name as soon as I could I guess - but personally I think it might be confusing for people having a main module called espruino that doesn't really involve communicating with Espruino at all. I think it probably makes more sense to stick the espruino-tools command-line tool under that name.
Let me think this stuff over and get back to you this evening. I'm thinking an espruino module should include everything you need to write your Espruino code in NodeJS, and a programmatic interface into the board. So basically official modules + communication layer, but no CLI tool. espruino-cli for that.
© Espruino, powered by microcosm.
Report a problem