Friday Hack Chat: JavaScript on Microcontrollers

Microcontrollers today are much more powerful and much more capable than the 8051s from back in the day. Now, they have awesome peripherals and USB device interfaces. It’s about time a slightly more modern language was used to program these little chips.

During this Friday’s Hack Chat, we’re going to be talking about JavaScript on microcontrollers. [Gordon Williams] will be joining us to talk about Espruino. This is a tiny JavaScript interpreter that runs on the little embedded chips, has a debug interface, and allows you to program your board on any platform without any external programming hardware.

[Gordon] is the key developer of Espruino, and so far he’s launched a full-sized Espruino, and a pico Espruino on Kickstarter, both with amazing success. The software stack has been extremely popular as well — it’s been ported to the ESP8266 and dozens of other microcontrollers that will soon be in the Internet of Things.

During the Hack Chat, we’ll be discussing interpreted languages on microcontrollers, interpreter design and optimization, with a special emphasis on creating devices with Espruino and putting Espruino boards on the Internet with WiFi, Bluetooth, and other crazy radios. As always, we have a spreadsheet open to everyone if you’d like to ask a question.

Here’s How To Take Part:

join-hack-chatOur Hack Chats are live community events on the Hackaday.io Hack Chat group messaging. Hack Chats are mostly, usually, and this week noon, Pacific time on Friday. Here’s a time and date converter!

Log into Hackaday.io, visit that page, and look for the ‘Join this Project’ Button. Once you’re part of the project, the button will change to ‘Team Messaging’, which takes you directly to the Hack Chat.

You don’t have to wait until Friday; join whenever you want and you can see what the community is talking about.

15 thoughts on “Friday Hack Chat: JavaScript on Microcontrollers

  1. Although not Javascript, I remember way back when (more than a decade ago) I used played around with the Basic Stamp by Parallax which had an on-board interpreter so that you could write a script in PBASIC without the need to compile anything. It is also worth mentioning a present day variant in the form of Silicon Labs Blue Gecko which has custom script interpretation capability as well in the form of BGScript.

    1. I remember PBASIC from the 1990s. Once I had outgrown the Basic Stamp, I switched to PicBasic Pro from meLabs. PBP (which is still available) was the Arduino equivalent of its time, translating Basic source code into PIC assembly.

  2. Parallax Used to also sell a java based “stamp” called the javelin. I worked with a friend to implement an inverted pendulum on a Javelin with fuzzy logic. Never quote worked, and life drew us away from the project… but if I was going to do an interpreted language on a micro controller… java would be higher among my choices than JavaScript.

  3. I’m fluent in many programming languages and I would have to say that Javascript is perhaps the worst of them. It came to prominence as a compensation for the lack of dynamic content capability in html.

    Somehow it has managed to not be replaced and worse… it’s spreading.

    1. -sigh- Yeah I’m not that happy seeing javascript everywhere. Through convention, it’s unavoidable for web client-side programming, and 3rd party libraries make it tolerable and even clever sometimes, but it’s brutal and not performant on the server side. I hated working with node.js. But many people are doing cool stuff with it… so it could just be my age.

    2. Yes, Not “Bare Metal”. Yes, Non-optimized Architecture. Yes, reliant on monolithics like Firefox, Chrome, Safari (and the occasional branched Node.js)

      Ultimately we have to consider; the Learning curve. “Up and running” vs. “O notation comprehension, Read the “Structure and Interpretation of Computer Programs” (Sick-Pee)

      Very few folks with a highly specialized skillsets working collaboratively would take a corporate effort to get something great out the door. (Consider this the Linux Kernel compiles every night and passes all the tests; only to find it’s in a completely deadlocked state with zero User-land accessibility.)

      Was Plan 9 OS too ambitious? (Well Plan 9 for userspace works.now.) Was LISP based computers better than Von Neumann?
      One might NOT like; (IDEs over Vi over Emacs over vi over grep over ex over sed & awk).

      Yes! It would be magical to have a Lexer/Parser to take Javascript backward through PyJS to CPython then to RPython/PyPy/Stackless taking THAT to bytecode THEN hit it with inverting dragonegg.llvm or clang then finally pushing around function calls to ASM that the Metal recognizes AND has the EXACT optimization routines to generate the microcode binary.

      Of course it would be really easy if we all had 128-qubit systems running a happy friendly non-cloud AI.

      BASIC,FORTRAN,COBOL,Pascal,Delphi, Visual C++,Perl,Ook!,BrainF*ck,

      Hindsight 20/20.

      Listen, if a language gets people interested in Micro Controllers (without relying on TrustZone blackbox craziness of ARM Cortex-A class Craple, ADM, NTEL PS3/4, XBone, INTendo stuff) it’s a good thing.

      P.S. There are Industrial Enterprise Routers and Switches that are running Busybox and the front-end UI is managed by PHP. (One can test via non-privileged prompt; Ctrl-D,Ctrl-E,Ctrl-B,Ctrl-U,Ctrl-G.) Because they didn’t want to pay for a commercial RTOS.

      Yes, We got old. [old school dev]

  4. JavaScript is actually great for micros. Event based and single threaded done right.

    Also, there’s plenty of room on the micros of today to make using an expressive language a great fit.

    People give JavaScript a hard time due to how hard it used to be to build against the DOM. Now though, it’s the only language that’s fast to develope in, has a standards body and remains backward compatible.

    Today I worked in Go and python – getting those languages to work with the web is a joke. It’s slow and painful – in the land of IOT – that’s just silly.

    JavaScript in the esp32 is amazingly fun to work with.

    1. Agree. JS may be terrible in the browser, but Espruino is the best way to make quick prototypes of anything, and it’s much better than MicroPython. Like all interpreted languages on microcontrollers, it’s slow, but embedding native code is very easy (the official IDE has a built-in assembler and a cloud-based compiler). I use it on ESP8266s and on my STM32F4 Discovery board, and I’m trying to port it to the STM32F103 (used in ST-Link dongles and “blue pill” boards).

    1. Tessel is a Raspberry Pi-like SBC running Node.js, while Espruino runs on an actual microcontroller. Also, Espruino’s firmware has been ported to a lot of chips, including many STM32s, the ESP8266 & ESP32, and BBC’s Microbit.

  5. I’m not sure that fragmenting the community is beneficial in the long run. Lots of alternatives are popping up, but it means less people are able to help each other too.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s