Re:Esprit Board for Exploring ClojureScript on ESP32 Processors
by mfikes on Wednesday June 03, 2020 @12:26PM
(#23405243)
I haven't. But I suspect that's next. If you compare things like Lumo / Planck (ClojureScript) to Babashka (GraalVM-based Clojure), you can clearly see the perf benefits of going native.
This stuff is arguably just an initial foray into the embedded world. You could imagine a Clojure dialect or compiler that emits WASM, or C, or even native code.
Re:Esprit Board for Exploring ClojureScript on ESP32 Processors
by tincholio on Wednesday June 03, 2020 @02:29PM
(#23406934)
There is an older approximation of that, in Ferret (https://ferret-lang.org/ ), which compiles a dialect of Clojure to c++, and can be used in embedded (IIRC it does have some pretty hefty limitations, but it's very cool nonetheless).
Re:Esprit Board for Exploring ClojureScript on ESP32 Processors
by intpx on Wednesday June 03, 2020 @09:24AM
(#23403057)
am I wrong or is the code the interesting thing here-- and not specific to this devboard? Is there anything special about this board other than it 1. looks nice 2. supports the project 3. has the requisite 8+ Mib of PSRAm 4. has a silkscreen bug?
genuinely asking as I am really still trying to figure out what i don't know about microcontrollers and embedded devices
I also looked at the schematics, which is your standard ESP devboard layout.
Edit: I'm not an expert, but have used tons of ESP based dev boards so there are a couple very frequent issues I've observed. Usually I have had trouble if the USB-UART chip is not wired correctly or doesn't reset quick enough. Lower baud rate makes it work. Also, the GPIO numbers on silk screen may not be correct, so double check those.
But, your assessment is correct... the software is definitely the interesting bit (the challenges associated with getting ClojureScript to run on that hardware, with a REPL, etc.)
Re:Esprit Board for Exploring ClojureScript on ESP32 Processors
by mfikes on Wednesday June 03, 2020 @12:19PM
(#23405159)
The primary challenge is RAM. The (simplistic) approach I took with establishing a ClojureScript REPL is to have the standard library available, and that requires a lot more RAM than most Espruino boards have. Even with the ESP32, I had to make a few tweaks to Espruino in order to make more of the ESP32's RAM available.
Perhaps a more sophisticated approach could be devised involving "faulting in" ClojureScript standard library functions on demand as they are used, and by doing this use less RAM and reduce startup latency. If that were done, things would run on a broader range of chips (less RAM needed).
This stuff is arguably just an initial foray into the embedded world. You could imagine a Clojure dialect or compiler that emits WASM, or C, or even native code.
> Note: You don't need to use this particilar board to run ClojureScript.
> Any ESP32 WROVER with 8 MiB SPIRAM is capable of running a ClojureScript REPL
https://github.com/mfikes/esprit-board/#esprit-board
I also looked at the schematics, which is your standard ESP devboard layout.
Edit: I'm not an expert, but have used tons of ESP based dev boards so there are a couple very frequent issues I've observed. Usually I have had trouble if the USB-UART chip is not wired correctly or doesn't reset quick enough. Lower baud rate makes it work. Also, the GPIO numbers on silk screen may not be correct, so double check those.
I created the board for an upcoming Clojure/north 2020 talk https://clojurenorth.com/mike-fikes.html
But, your assessment is correct... the software is definitely the interesting bit (the challenges associated with getting ClojureScript to run on that hardware, with a REPL, etc.)
Perhaps a more sophisticated approach could be devised involving "faulting in" ClojureScript standard library functions on demand as they are used, and by doing this use less RAM and reduce startup latency. If that were done, things would run on a broader range of chips (less RAM needed).
Might be an interesting target for Janet though!
Normally 1MB is "gobs" in the microcontroller world. The ~8MB in the WROVERs is a crazy amount of RAM for an mcu.
How much support is there for getting access to features like bluetooth or I2C from Clojure?
(The submitted project is with ClojureScript that compiles to JavaScript, not Clojure, to be extra specific in case someone misses the difference)