4 ms·
Esprit Board for Exploring ClojureScript on ESP32 Processors
- ngcc_hk 6y agoJust thought I will concentrate on javascript embedded one. Disruptive.
- intpx 6y agoam 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
- prashnts 6y agoI was also curious, and from their Design repository: > 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 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.
- tyingq 6y agoIt seems to require anything that can run the "Espruino" base, so this link probably covers that: https://www.espruino.com/Other+Boards https://www.espruino.com/Other+Boards
- mfikes 6y agoThe 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).
- tyingq 6y agoI bet a port to the Teensy 4 would be popular for some use cases. No wifi, but 600Mhz, gobs of RAM, and ~$20.
- cellularmitosis 6y agoI thought it only had 1MB of RAM? Might be an interesting target for Janet though!
- tyingq 6y agoArgh, you're right. I hadn't picked up that the WROVER boards have even more RAM. Normally 1MB is "gobs" in the microcontroller world. The ~8MB in the WROVERs is a crazy amount of RAM for an mcu.
- mfikes 6y agoIndeed, the board is not required. I've added a note to the Tindie description to that effect. I created the board for an upcoming Clojure/north 2020 talk https://clojurenorth.com/mike-fikes.html 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.)
- elwell 6y agoI like how Clojure can be used in more lightweight contexts by using ClojureScript instead. Did you try a Clojure (JVM or GraalVM?) implementation?
- mfikes 6y agoI 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.
- tincholio 6y agoThere is an older approximation of that, in Ferret (https://ferret-lang.org/ 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).
- jes5199 6y agoI'm impressed! ESP32 is really the swiss-army-knife of small processors. How much support is there for getting access to features like bluetooth or I2C from Clojure?
- capableweb 6y agoSeems it's using Esprit (https://github.com/mfikes/esprit https://github.com/mfikes/esprit) which is using Espruino (https://www.espruino.com/ https://www.espruino.com/) who in their reference documentation for the API (https://www.espruino.com/Reference https://www.espruino.com/Reference) lists methods for both Bluetooth and I2C. (The submitted project is with ClojureScript that compiles to JavaScript, not Clojure, to be extra specific in case someone misses the difference)
- jes5199 6y agoawesome! I think I'll try using Esprit instead of C in my next ESP project