Using JavaScript is a new approach for embedded development, especially with node.js platform. But there are also other interesting JavaScript platforms worth to check out. I read about Finnish developed the open source “duct tape” and thought to check that out: Duktape is an embeddable Javascript engine, with a focus on portability and compact footprint. Duktape should be aksi easy to integrate into a C/C++ project so that you can use the Duktape API to call Ecmascript functions from C code and vice versa. Duktape is an open source JavaScript engine, which is used to IOT’s in addition to the gaming industry, and consumer electronics devices such as set-top boxes.Duktape fits in a small device  (256kB flash and 64kB system RAM) better thanGoogle’s V8 JavaScript engine used by node.js.

So the next step was was to test this Duktape. To start testing, I first went to http://duktape.org/ to download the source code packet (file duktape-1.5.0.tar.xz). That .xz ending made me to wonder what is the right software to expand it. Finally I expandex .xz with 7-Zip on Windows PC and copied duktape-1.5.0.tar to Linux system. Then I run tar xvf duktape-1.5.0.tar to get the files out. Then I read getting started guide to have smooth starting.

I compiled the source code with following command:

make -f Makefile.cmdline

I followed the next testings successfully until I go to instructions to run $ ./duk fib.js command, but it did not work because my dirctory did not seem to have fib.js file. So instead of that I run./duk mande.js command, that worked well. I also tried example where JavaScript was embedded to C program, and it worked as expected. This Duktape is looking very promising.

But I also keep in mind that there are multiple Javascript engines targeting similar use cases as Duktape, at least: Espruino, JerryScript, MuJS, quad-wheel, tiny-js and v7.



Be the first to post a comment.

Leave a Comment

Your email address will not be published. Required fields are marked *