This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The docstrings for keys and vals don't indicate that you can do this. Is this accidential or intentional?
I vaguely recall Alex Miller indicating at some point that this capability was deemed useful and is intentionally allowed. Yes, this is an appeal to authority, but nevertheless, it makes a fairly convincing argument.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To set up a REPL that has cljs.core available, we need to re-partition the ESP32 and allocate more memory in Espruino for "JsVars".
The default Espruino bootloader.bin, pre-built variants of partitions_esprinuo.bin and rebuilt espruino_esp32.bin, and the ClojureScript runtime core.bin are also available here.
bootloader.bin gets flashed to 0x1000, partitions_espruino.bin gets flashed to 0x8000, and espruino_esp32.bin gets flashed to 0x10000 as per a usual ESP32 Espruino setup, and we put the ClojureScript runtime at 0x2C0000:
Loading :advanced Code into an Unmodified WROVER running Espruino
You can load ClojureScript :advanced code directly into an ESP32 WROVER running Espruino for execution upon boot, by creating a binary and flashing it to the JavaScript "boot ROM" area. This has the same effect as when loading code via the Espruino Web IDE, in the "Direct to Flash (execute code at boot)" mode, but flashing is much quicker and more reliable.
Note: To do this, you'll need an ESP32 WROVER with SPI PSRAM, as opposed to just a WROOM, as the ClojureScript in this example uses more RAM than is available in the WROOM.
Create :advanced Code
Here is a small program that uses enough to pull in data structures, etc, leading to nearly 100 KiB: