
Espruino -- a JavaScript Arduino - denysonique
http://www.kickstarter.com/projects/48651611/espruino-javascript-for-things?ref=live
======
jgrahamc
Unfortunate that they used a name ending in 'uino' since this is in no way an
Arduino and not compatible with Arduino in terms of code or pin out. So no
existing code or examples will work with it and none of the exiting Arduino
shields.

Also, I think their code examples are disingenuous: their Arduino code could
be greatly simplified. (e.g. why does the JavaScript code not include any port
initialization but the Arduino code does; why have two digitalWrites in the
Arduino code, but one in the JavaScript)?

~~~
gfwilliams
Hi, I'm the guy behind it... Just wanted to stand up for it a bit - the -uino
postfix is really because of the hobby electronics association. I wanted to do
something a bit different by adding the prototype area, and I found the
Arduino form factor was too big for any sensible hand-held projects. The board
is still small enough that it can sit on a simple adaptor PCB for Arduino
shields though. I'll try and put one online when the campaign ends.

Also port initialisation is automatic so pinMode is not required - it's a huge
potential gotcha for learners, and it seemed wise to remove the need for it.
You can still use it if you want to though.

~~~
aberkowitz
The "-uino" suffix is pretty blatantly associated with the arduino platform.
To go out there and claim you're using it for the "hobby electronics
association" is pretty disingenuous.

~~~
jpwright
Agreed, and it's worth pointing out that this is what Arduino has to say on
the matter:

"Note that while we don't attempt to restrict uses of the "duino" suffix, its
use causes the Italians on the team to cringe (apparently it sounds terrible);
you might want to avoid it. (It's also trademarked by a Hungarian company.)"

[http://arduino.cc/en/Main/FAQ](http://arduino.cc/en/Main/FAQ)

------
exDM69
Is this really a good idea? Yes, JavaScript is popular but if you're running
on a microcontroller and already short of resources, is it really worth it to
spend a lot of your cycles interpreting JavaScript?

A lot of microcontroller code has some real time requirements. Even some of
the simplest Arduino code out there. Even in beginner projects, it is rather
common to do something like software debouncing for pushbuttons or
multiplexing for led matrices, both of which require millisecond resolution
timing precision. A garbage collector pause in the middle of it would ruin
everything. And a noob wouldn't understand why.

Also, isn't JavaScript already running on the new ARM Cortex M3 -based Arduino
board?

To say something positive, I think the Google Blockly visual programming
language is a very good idea for something like this, especially if targeted
at noobs and/or kids. If you're unfamiliar with it, the picture with the
puzzle pieces tells it all. There are puzzle pieces of different shapes for
different syntactic structures (you can see expression and statement pieces),
and the colors of the pieces are different types (in the picture, green is a
boolean, I think).

~~~
hershel
some of the JavaScript engines, most notably MicroSoft's JavaScript Engine,
use reference counting for determining when memory can be freed.[1]. Some
implementations of reference counting work well in hard real time systems[2].

So it's too early to tell if espruino would fit real time systems.

And regarding wasted cycles: for this project, it doesn't matter much. Unless
you make stuff in volume ,micro controllers are cheap.

[1][http://www.fasterj.com/articles/javascript.shtml](http://www.fasterj.com/articles/javascript.shtml)

[2][http://liu.diva-
portal.org/smash/record.jsf?pid=diva2:20899](http://liu.diva-
portal.org/smash/record.jsf?pid=diva2:20899)

~~~
exDM69
> some of the JavaScript engines, most notably MicroSoft's JavaScript Engine,
> use reference counting for determining when memory can be freed.[1]

Interesting, I was unaware of this. How does Microsoft's JavaScript engine
deal with cyclic data structures, which reference counting can't deal with?
The best I understood from your link is that it just leaks cyclic structures?
Does the JS spec really allow this?

> So it's too early to tell if espruino would fit real time systems.

It's too early to tell but IMO it's a critical aspect of microcontrollers.
Many if not most microcontroller applications have some degree of real time
requirements, which limits your choices for software runtime systems.

~~~
hershel
I don't know how MS does solve the cycle problem.

Many data structures don't have cycles. I believe it's pretty true for many
embedded systems.

------
dmbass
Maybe I'm missing something, but why does Javascript require new hardware? Can
you not run whatever software this is running on another µC... say the one on
an Arduino board? Obviously the drivers are different but you have to write
them for this hardware anyway.

~~~
gfwilliams
This should work on the larger Arduino boards (the Due and 2560) and it
already works on a bunch of other hardware too.

To be honest the new board is just to do something a bit different - and to
give backers of the KickStarter something fun that they couldn't just go out
and buy.

------
outside1234
I think this is a little bit off. What _I_ want is an embedded device that
runs node.js and npm, not just JavaScript. That enables you to use JavaScript
and C (using a native npm module) and get the best of both worlds.

~~~
gfwilliams
There's Beaglebone, Raspberry Pi, and also now Tessel that do that. The
previous two have had node.js support for ages but I think have been lacking
any kind of real advertising because they're more general purpose.

All of those appear to be fully-fledged computers though, and Espruino's not
really aiming to compete with them.

Instead, you get to use JavaScript on a very small, low-power microcontroller
than will sensibly run off a small battery for days on end.

Some people will want one thing, some will want another - and hopefully they
can both coexist. If we get it right they'll both help each other and we can
end up with a large library of JavaScript code for embedded devices :)

~~~
hershel
>> sensibly run off a small battery for days on end.

Could you please offer more details? what kind of application, what kind of
battery and estimated power consumption ?

~~~
zokier
Quick back of the envelope calculation shows about two days (~50 hours) on
2xAA alkaline batteries when running the micro-controller on full power (~50mA
current consumption according to the datasheet).

Of course aggressive power management (ie putting the mcu to sleep) could
significantly extend the battery life. According to the datasheet the current
consumption at sleep can be as low as 0.5mA, full two orders of magnitude
difference. The standby current is in microampere range.

In comparison BBB consumes "210-460mA @5V", which would correspond to 1-3
hours on 2xAA alkalines (assuming ideal voltage converter).

------
angersock
Ecmaboard, or CallbackCard would've been more fitting.

Maybe $Board.

------
codereflection
How is this any different from running Johnny-Five
([https://github.com/rwaldron/johnny-five](https://github.com/rwaldron/johnny-
five)) on an Arduino? Do we really need a board dedicated to JavaScript? There
are SO many Arduino compatible boards out there already...

~~~
gfwilliams
Johnny-Five requires a PC (it runs JavaScript on the host computer). On
Espruino you can program it, then unplug the PC and it keeps working.

One of the big benefits (apart from running on its own) is that you don't have
the latency of USB, so can respond to things far more quickly.

~~~
codereflection
You're right, I had completely forgotten about that part. Currently Node.js
can be used to control an Arduino, but it cannot run on it directly (like it
can on a Raspberry Pi).

------
themstheones
Should've called it Ecmuino.

------
rglover
Pledged to get a board. Looks like it would be fun to play with.

