Espruino vs. All #7613
Replies: 1 comment
-
Posted at 2019-01-08 by @gfwilliams Hi, My take on this is:
These projects all consume a huge amount of time to develop and maintain - so I think it's important to look at how they're funded:
Hope that's some help! Posted at 2019-01-10 by @MaBecker Thanks Gordon, you should think about to add this great piece of information to the Espruino home page and your conference slides! Posted at 2019-01-10 by @gfwilliams Thanks - I'll make sure I add that to the links page at the least :) Posted at 2019-01-11 by MrB Many thanks Gordon. But there are some technical issues, dictated by the different design choices, which at the moment we still can not evaluate and understand the implications.
Is synchronous writing a big limit (imho yes but sometimes)? While the ram out of memory is a problem. Obviously my most technical questions will come as we encounter problems :) , for the moment I am asking only an overview to those who have already had the opportunity to use different embedded js engine. ;) MrB P.S. / Disclaimer Posted at 2019-01-14 by @gfwilliams (edit: see @neoniousTR's post below) That section on the IoW.js page isn't very truthful. We implement quite a lot of the Node.js API - not all of it for sure, but enough that a lot of http/etc runs without modification.
Not that I have found - especially as reads from something like an SD card are more predictable than a hard disk. Realistically IoW.js will probably have sync writes as well, it'll just 'hide' them by allowing a callback (which Espruino could easily do - it just hasn't been requested).
Well, it's significantly faster to execute new JS code. It's also far more memory efficient as there's no parse tree or bytecode needed, and you get line by line debug and stack traces built in as well.
I think you'll find that Espruino works better in a low-memory environment because it doesn't care if memory gets fragmented, and GC passes are rare and very fast.
Honestly, I don't have enough experience of the other options to say. I believe Espruino is more efficient at storage of small objects, and is pretty fast with string appends. Personally, I think it works well. The Bluetooth implementation on NRF52 chips is pretty good as well - I'd be extremely surprised if the other platforms really hit that level of features/stability. Only thing I'd say is when dragging in external modules you might want to look at other options (or at the very least tree-shaking your code before upload). Maybe someone else with experience of the other platforms can chime in here? Posted at 2019-06-19 by neoniousTR Hello everyone, hello Gordon, Regarding your post: you are incorrect with that the async functions of low.js will block somewhere. low.js provides 100% async read/writes. The async calls go into a different thread, which does not block the code thread. The neonious one even utilizes an additional SPI flash chip for the file system, so there is no call to esp_partition_read/write or whatever which would block. Regarding speed of byte code vs source code, the following code runs multiple minutes with Espruino, while it only runs for 5 secs on low.js:
Over all, we're trying to be 100% truthful, so if you see anything wrong in our comparison on our website, please tell me exactly what we shall change. Posted at 2019-06-19 by nogears Hi neoniousTR, thanks Posted at 2019-06-20 by AkosLukacs The ESP32-Espruino numbers seem to be valid. Did some tests (only with 100x1000 iterations, didn't want to wait minutes). All boards with 2v03, code running in memory, timing just with
Looks like the ESP32 at 4x clock speed was slower than the Cortex M4 in Pixl.JS. I think we all knew that the ESP32 port needs some optimisation. The two M4 cores run at roughly same speed if you compensate with the clock rate. @neoniousTR your board + the dev experience looks cool! Added it to the waaaa-looks-interesting-but-don't-get-one-already-have-too-much-stuff category :) Posted at 2019-06-20 by @gfwilliams Hi Thomas, Thanks for posting! Did you modify the https://www.lowjs.org/lowjs-vs-alternatives.html page? It sounds a lot better now. Neonious looks like a really neat package with the IDE. Having some non-open source parts is a clever move as well, and hopefully allows you to develop a real business around your boards while keeping the core open. Being 100% open is something I've struggled with for Espruino, and has meant that to investors the business is effectively worthless. That's impressive speed-wise. Are you actually using V8 under the hood, or is it Duktape, JerryScript or something else? It's worth noting that with an official Espruino board you can do:
And it takes 0.00004 seconds to execute - the code is converted to C with integers, compiled on a server, and the loop is optimised away by GCC. Simple JS written that way will outperform pretty much any JS interpreter because it's basically just optimised and compiled C code. It's always problematic when people compare speed - Espruino would run that code on a microcontroller with only 4kB of RAM and I believe has been ahead on memory usage since the start - but pretty much every other JS interpreter will beat it on speed. I guess on the plus side, it carves out a nice niche for Espruino - as everything get more powerful, micros capable of running Espruino just keep getting cheaper, lower power and smaller. Personally I think Neonious and Espruino cover very two different areas: Espruino was designed for and works great on low power, low memory micros, and Neonious provides a more full-featured Node.js experience with the ability to use NPM packages. Posted at 2019-06-20 by neoniousTR Well, we might have changed it, but I do not remember when. A while ago most probably. I understand you can compile JavaScript code to C. But it is not valid JavaScript anymore, it is a subset of JavaScript. But a cool feature non-the-less...It lets you do things with very small devices if you are willing to do it "the Espruino way". low.js uses DukTape, but we've added a small JIT layer (does not optimize that much, however). And we try to become 100% Node.JS. We hope to get some people in the industry use it for industrial automation and things like that. A few customers we already have here. All in all, I agree on your comparison. Posted at 2019-06-20 by @gfwilliams @AkosLukacs thanks for running those benchmarks - that's really interesting. I think with some work ESP32 speed could probably be improved a lot (just by making sure a few core functions stayed in RAM) - however even with that, it's going to get destroyed by most other JS engines. I've been meaning to add a proper JIT interpreter for a while which should give it a huge speed boost, but actually there's been very little demand for it - and even if I did it, it's something I'd probably never get around to porting to Xtensa for ESP8266/32. Posted at 2019-06-20 by neoniousTR Just wondering: Do you actually use float with Espruino instead of the standard-conform double? We are thinking about the switch, because then we can use the FPUs. But this might break some people's programs. Posted at 2019-06-20 by nogears @AkosLukacs yeah i ran this in 336.30secs on a puck.js with the full 1000x1000 and then 0.00064086914 secs with
i didnt know about the "compiled" thing, thanks @gfwilliams @gfwilliams sad to hear that 100% opensource has been a negative on your. Posted at 2019-08-08 by AkosLukacs @neoniousTR Is https://estimote.com/ related to you, or just found another company doing JS on micros? https://blog.estimote.com/post/186818671945/estimote-ai-beacon Posted at 2019-08-09 by neoniousTR Nope, we have nothing to do with estimote. Posted at 2019-08-10 by AkosLukacs Thanks, that was my guess, as it looks different than your solution. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-01-07 by MrB
I ask some help to understand the substantial differences between Espruino:
(or vs. other embedded Js engine?)
pro/semi-pro. We are testing esp32 with LoRawan & modbus but we can change mcu. We would like have also profibus but this is another issue)
other iot infrastructures ? (or... does Espruino has partnerships with other system or consortium ?)
Many Thanks
MrB
P.S.
It is not a race on who is stronger!
I would just like to understand better... ;)
Beta Was this translation helpful? Give feedback.
All reactions