8 ms·
JerryScript: lightweight JS engine for IoT
- aravindet 6y agoIf you are interested in lightweight JS engines, you might also want to take a look at these benchmarks: https://bellard.org/quickjs/bench.html https://bellard.org/quickjs/bench.html
- winrid 6y agoMan, V8 is amazing technology.
- kiddico 6y agoAbsolute domination. Even the jitless run is ahead in all but 2 benchmarks.
- spijdar 6y agoIt even dominates in executable size! ;-)
- MaxBarraclough 6y agoA pity SpiderMonkey wasn't included.
- nicoburns 6y agoNo JSC either.
- hajile 6y agoJSC isn't even in the same ballpark for memory usage. https://medium.com/walmartglobaltech/react-native-memory-profiling-jsc-vs-v8-vs-hermes-1626949a653b https://medium.com/walmartglobaltech/react-native-memory-pro... Apparently Apple has invested more in raw JS performance while Google has invested more in their garbage collector.
- mhd 6y agoSmallTalk is great, right?
- winrid 6y agoAre you claiming JS or V8 is heavily influenced by SmallTalk?
- mhd 6y agoOnly V8, which collected a lot of the people formerly working on the StrongTalk VM. JS is mostly influenced by Scheme, Java and infernal visions.
- winrid 6y agoThat's interesting because I had someone that read some V8 source tell me that the JS function calls were managed via messages. I wonder if that's true, and how it fits with the Jit...
- mhh__ 6y agoIf you only have 64kB what's the point of using JS? I get that I'm free not to use it, but I genuinely don't understand why these projects are popular - you nearly always end up using C in the end anyway, especially because embedded nearly always means writing to registers and specific memory addresses.
- keithnz 6y agomostly I think it appeals to non traditional embedded programmers. It has some appeal in that it is easy to send code to devices as "data" ( much the same as the advantages of embedding lua or other scripting languages ). Certainly not something I would choose though (I do IoT systems from the embedded devices -> backend -> web frontend ).
- oddity 6y agoSome people only know JS, or just don't want to learn both embedded and C at the same time. If projects like this can help people get over that initial hurdle, then all the better. Plus, writing constrained environment language implementations is quite fun.
- mhh__ 6y agoI guess so. Directed at anyone asking the question your first paragraph raises: C isn't that bad, give it a try, even if you don't use it your skills and perspective as an engineer will thank you.
- colejohnson66 6y agoPointers are quite a hard concept for a lot of people to wrap their heads around. JavaScript’s lack of them is easier to understand for them.
- jakear 6y agoIn my experience the harder thing is the stack/heap memory model. It’s easy enough to get someone to understand that the variable “points” to another variable like a house address or whatever. But, trying to explain that once a return happens the thing that was pointed to will potentially be gone entirely and you probably wont know immediately, or at least until you call another function, unless you allocated it with malloc, but in that case you need to be sure to call free at some point later, but watch out don’t call free twice, and hey there’s some analysis tools you can use with gdb to help find these types of issues, oh yeah gdb is this debugger it has its own special syntax you’ll want to learn than too, etc etc etc. It’s so much easier to say: oh, you want to make a tree? Just make some leafy nodes and make some branchy ones point to them and you’ll literally never see segfault in your life. The pointers are still there, but the trouble is gone.
- kyriakos 6y agoWhat can you run it on though? The engine weighs 160kb
- pts_ 6y agoApparently fitbits.
- divan 6y agoObligatory picture https://pbs.twimg.com/media/EVqV8l7XgAIod9y?format=jpg&name=medium https://pbs.twimg.com/media/EVqV8l7XgAIod9y?format=jpg&name=...
- timdorr 6y agoFun fact, this is running on my watch right now. Fitbit (by way of their Pebble acquisition) uses it to power their watch faces and apps. It let's developers use a high-level language like JavaScript to build for their platform, which increases developer accessibility. I've built apps on C for Pebble before which is not that fun by comparison.
- taf2 6y agoNice comparison of js engines can be found in the issues here https://github.com/jerryscript-project/jerryscript/issues/4386 https://github.com/jerryscript-project/jerryscript/issues/43...
- rurban 6y agoWhow, much faster than Bellards quickjs, and most others. Small is better.
- 5560675260 6y agoBenchmarks on Bellard's site [0] show that it's several times slower than QuickJS. Are there new developments on this front? [0] https://bellard.org/quickjs/bench.html https://bellard.org/quickjs/bench.html