
Esprit Board for Exploring ClojureScript on ESP32 Processors - tosh
https://www.tindie.com/products/fikesfarm/esprit-clojurescript-repl/
======
elwell
I like how Clojure can be used in more lightweight contexts by using Clojure
_Script_ instead. Did you try a Clojure (JVM or GraalVM?) implementation?

~~~
mfikes
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.

~~~
tincholio
There 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).

------
intpx
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

~~~
tyingq
It 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
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).

~~~
tyingq
I bet a port to the Teensy 4 would be popular for some use cases. No wifi, but
600Mhz, gobs of RAM, and ~$20.

~~~
cellularmitosis
I thought it only had 1MB of RAM?

Might be an interesting target for Janet though!

~~~
tyingq
Argh, 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.

------
jes5199
I'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
Seems 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
awesome! I think I'll try using Esprit instead of C in my next ESP project

------
ngcc_hk
Just thought I will concentrate on javascript embedded one. Disruptive.

