News for hackers. Stuff that matters.
Re:Esprit Board for Exploring ClojureScript on ESP32 Processors by elwell on Wednesday June 03, 2020 @11:41AM (#23404629)
I like how Clojure can be used in more lightweight contexts by using ClojureScript instead. Did you try a Clojure (JVM or GraalVM?) implementation?
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
Re:Esprit Board for Exploring ClojureScript on ESP32 Processors by prashnts on Wednesday June 03, 2020 @09:55AM (#23403362)
I 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

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.

Re:Esprit Board for Exploring ClojureScript on ESP32 Processors by mfikes on Wednesday June 03, 2020 @11:27AM (#23404428)
Indeed, 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

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 tyingq on Wednesday June 03, 2020 @10:29AM (#23403677)
It seems to require anything that can run the "Espruino" base, so this link probably covers that: https://www.espruino.com/Other+Boards
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).

Re:Esprit Board for Exploring ClojureScript on ESP32 Processors by tyingq on Wednesday June 03, 2020 @12:25PM (#23405235)
I bet a port to the Teensy 4 would be popular for some use cases. No wifi, but 600Mhz, gobs of RAM, and ~$20.
Re:Esprit Board for Exploring ClojureScript on ESP32 Processors by cellularmitosis on Wednesday June 03, 2020 @01:02PM (#23405733)
I thought it only had 1MB of RAM?

Might be an interesting target for Janet though!

Re:Esprit Board for Exploring ClojureScript on ESP32 Processors by tyingq on Wednesday June 03, 2020 @02:40PM (#23407065)
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.

Re:Esprit Board for Exploring ClojureScript on ESP32 Processors by jes5199 on Wednesday June 03, 2020 @02:03PM (#23406563)
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?

Re:Esprit Board for Exploring ClojureScript on ESP32 Processors by capableweb on Wednesday June 03, 2020 @02:17PM (#23406732)
Seems it's using Esprit (https://github.com/mfikes/esprit) which is using Espruino (https://www.espruino.com/) who in their reference documentation for the API (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)

Re:Esprit Board for Exploring ClojureScript on ESP32 Processors by jes5199 on Wednesday June 03, 2020 @02:43PM (#23407095)
awesome! I think I'll try using Esprit instead of C in my next ESP project
Re:Esprit Board for Exploring ClojureScript on ESP32 Processors by ngcc_hk on Wednesday June 03, 2020 @08:47AM (#23402712)
Just thought I will concentrate on javascript embedded one. Disruptive.