Like its predecessor the ESP8266, the ESP32 has been growing in popularity and making waves as it goes. Lua was made popular for embedded prototyping via the NodeMCU project, and now other languages like Python, JavaScript and ClojureScript are entering the embedded sphere too. This extremely well-designed and beautifully laid-out dev board is specifically designed for use with Esprit (a fork of Espruino specifically for ClojureScript), although any ESP32-WROVER can be used. You could also use this board for general ESP32 development.
Clojure is a language that has been growing in popularity over time. It’s still relatively uncommon, as it’s a variant of LISP that runs on the Java runtime (which are words I didn’t think could go together in a sentence). ClojureScript is a source code compiler which converts Clojure into JavaScript. Like many LISPs, Clojure uses a REPL (a read-evaluate-print loop) for development and interaction — if you’ve used NodeMCU or Python, this is the same thing as running in interactive mode. Anything you type is evaluated and executed as soon as you hit return.
This can make prototyping very easy, especially for newcomers who can immediately see results without having to worry about including header files, getting a compiler working, etc. For embedded development, it means you can flash an LED with just a couple quick lines of code. This makes the learning curve much more gradual, and motivates users to keep learning and exploring.
The developer of this board, Mike Fikes, recently gave a talk about it at Clojure/north 2020:
Because Espruino is a JavaScript interpreter, it needed the ClojureScript runtime library added in order to be used with ClojureScript. Squeezing this into the ESP32 was a challenge, until he realized that the ESP32 comes in two variants — the ESP32-WROOM and the ESP32-WROVER. The ROVER has a lot more RAM and made it possible to use with a ClojureScript REPL. All that was needed was tweaks to the size of the heap and changes to the partitioning of the ESP32’s flash storage. The result was a fork of Espruino called Esprit, which you can find on GitHub here. This is what is running on this board by default when powered up.
This is a really neat, unique approach to development on the ESP32, and it shows how powerful the dual-core Tensilica processor inside the ESP32 is. Languages like MicroPython and JavaScript are making their way into embedded development, and Esprit now brings another neat option to the table! If you’ve ever used Clojure, or are interested in learning it, make sure to check the product page out for more details!
source https://blog.tindie.com/2020/07/clojurescript-on-esp32-why-not/
No comments:
Post a Comment