okay you might remember this project that i posted about last year: https://posts.decontextualize.com/solar-powered-dawn-poems-progress-report/ in which I generate poetry from a markov chain on a microcontroller using a solar panel harvester chip and some big capacitors. i originally wrote the generator with CircuitPython, which gave me 2–3 lines of poetry per discharge from the harvester.

well I just finished reimplementing the generator in C++ and now I get... ~200 lines of poetry per discharge (!)

Solar powered dawn poems: progress report

My lab notes, plus thoughts on solar powered poetics

Allison Posts
(I knew that I'd get a performance boost, but I honestly didn't expect it to be THAT much)
if i'm calculating right, my setup uses about 0.25 watts when discharging the capacitors, which is about the same amount as a macbook pro *when it's powered off* https://images.apple.com/environment/pdf/products/notebooks/15-inch_MacBookPro_w_Thunderbolt3_PER_June2017.pdf lmao
@aparrish very lovely project. Makes me want to do more little microcontroller things; I have a desk pomodoro timer which just runs off usb that it'd be interesting to figure out the power draw and battery life of
@aparrish
This could very well be a record in poetry per Wattsecond. (p/J)
@aparrish Two orders of magnitude seems about right, Python is distinctly Not Fast (which is why I'm atill so baffled that it somehow seems to have become the lingua franca of data science).
@aparrish Iron Man thought much the same.
@aparrish That is an amazing project!
@aparrish Thank you for continuing to do cool, thoughtful stuff in the face of overwhelming, soulless, energy-sucking LLM junk <3
@annika just out here trying to do my best every day 💪🏻
@aparrish
That's a beautiful project! 🤩 It sounds almost like something that could have taken place in one of @abundance 's games. Just missing bioluminescent algae
@aparrish I've not read the paper, but your improvement is similar to that shown in table 4 of Pereira, et al. (2021) https://www.devsustainability.com/p/paper-notes-energy-efficiency-across-programming-languages
Paper notes – Energy efficiency across programming languages

Which languages are the fastest and most energy efficient? The simple answer is: C, C++, Rust. The accurate answer is: it depends.

/dev/sustainability
@hugovk i am a python fan but it does seem to be singularly unsuited to being a programming language for embedded systems...
@aparrish Would be interesting to see a bot posting those
@aparrish ohhh I really like this and now I'm thinking about how I'd squeeze more corpus into less memory (maybe cache the markov model itself on the card so you need to read less??)
@esther_alter I thought about that, but there's something aesthetically desirable to me about the model getting built from scratch each time on the microcontroller itself (i'm actually using an RP2040 now which has ~256kb RAM, which with my C++ version is enough to build the model in-memory with ~20kb of headroom)
@aparrish oh yeah I get that. What if you ran a checksum against the corpus and if it's wrong do a one-time generate and write on/with the micro controller? (Idk if this solves anything it's just a very interesting problem!!)
@aparrish “quatrains/watt” should absolutely be a standard measurement going forward.

@aparrish are you still using the sd card to capture the results? When I read your post the first thing I thought of was to use bluetooth but register as a keyboard to send the output to anything nearby. I know it isn’t as cool as leaving it to write poetry for weeks in a remote location but putting it out by a bird feeder and suddenly being interrupted by a poem readout at your workstation is also kind of fun.

Great concept! I’ll be thinking about this one for the rest of summertime.

@skotchygut i'm using an RP2040 now (raspberry pi pico) and writing to its internal flash. bluetooth is still kind of a power hog (not much less than wifi as I understand it), though I have thought about BLE
@aparrish this is such an incredibly cool project!
@aparrish This is a really peaceful harmonious and inspiring project and a lovely read. Thanks for making/sharing.