
Why a JavaScript engine for an IoT platform? - evthewolf
https://blog.cesanta.com/why-a-javascript-engine-presentation
======
brudgers
If you're interested in feedback, V7 might make a good "Show HN".

Guidelines:
[https://news.ycombinator.com/showhn.html](https://news.ycombinator.com/showhn.html)

------
Matthias247
I'm adding the most expected question here: How does it compare to duktape?
Feature, Performance and Requirement wise?

~~~
ithkuil
Hi, sorry we didn't have time to make a thorough comparison. Our focus is very
tiny embedded platforms and we tuned our tradeoffs for that target from the
start, while duktape looks to be going in that direction.

When you initialise V7 on an embedded platform the runtime consumes only 873
bytes. V7 can interpret code on the device or run precompiled bytecode
straight off flash memory, including all the referenced strings.

At the moment duktape offers more features that we postponed for later, such
as ES6 Proxy or TypedArray, but on the other hand V7 focuses more on dealing
with heap fragmentation by implementing a compacting GC for strings and other
memory footprint goodies.

We successfully run it on the esp8266 device. Performance is what we
sacrificed in order to focus on footprint. However it's acceptable for
scripting needs. Don't expect to compute SHA2 in pure JS while streaming your
data full wire-speed :-(

Requirement wise, V7 is completely self-contained and requires only malloc or
an equivalent shim. stdio requirement is optional and can be compiled out
easily.

The C API plays well with both null terminated strings and non-null terminated
strings, making it easier to integrate V7 with other languages or with
embedded scenarios where copying too much data around is just not an option.

