V7 has something neat called 'NaN packing' - they use a 64 bit floating point value for everything, but then it turns out there are thousands of 'invalid' floating point 'not a number' numbers, and they use those to encode other data. It's quite an efficient way of storing data.
It does however rely pretty heavily on malloc, interprets via bytecode, and uses a mark/sweep garbage collector as far as I can tell - so I'd imagine that overall performance would be faster, but not as dependable... It might just block everything to do a GC pass in the middle of execution of something time critical - something Espruino is good at avoiding.
There's also the question of how you encode all the built-in functions. I'm not sure about this, but it seems that V7 might use RAM for each function - something that fills up RAM very quickly. Espruino's got a bit of a cludgy (at the moment) way of handling built-in functions, but it does mean that no RAM gets used at all.
It'd be interesting to do a proper comparison - but my take is that on low RAM parts, Espruino comes into its own - as you add more RAM, V7 will probably become more sensible. On ESP8266 there's not much RAM available and I think Espruino may well be a better choice.
But as you say, I hope that the whole system - the board, firmware, IDE, modules, and support - makes Espruino a much better choice :)
© Espruino, powered by microcosm.
Report a problem