Running LISP on an ESP8266

LISP is a polarizing language. Either you love it or you hate it. But we’ll put aside our personal preferences to bring you a good hack. In this case a LISP environment running on an ESP8266. [Dmitry] is on the “love it” side of the fence — he’s been waiting for an excuse to code up a LISP interpreter for a while, and he found one in the ESP8266.

there-is-always-a-way-2Actually, [Dmitry] is running LISP inside JavaScript, which is itself presumably coded up in C, before it’s assembled to run on an ESP8266. (It’s turtles all the way down!) This means that he can piggy-back on JavaScript’s garbage collection and console handling and so on. After picking a suitably small LISP implementation (actually a Scheme dialect for those of you who know the difference), he went to work.

One weekend bled into the next, but he got the system running, connected to the network, and had LEDs blinking! In the end, he even managed to squeeze in some optimization for memory’s sake. Pretty cool, and because it takes advantage of an already complete system, it can even be made pretty useful. Not bad for a few weekends’ work!

And finally, if Lots of Irritating Silly Parentheses is your idea of a good time, but the wealth of computing resources available on an ESP8266 seem overkill, have a look at Microlisp, running on an AVR. Or go to the opposite extreme, and run a LISP OS on a Raspberry Pi. Whatever you do, don’t forget to close your parentheses! (We’re told that’s a traditional LISPer farewell.)

23 thoughts on “Running LISP on an ESP8266

    1. Heh, that doesn’t look like one, but you can get fully electronic adapters. Though the first one would have to be parallel to serial. But you’re right, that green one and the PS/2 to serial it’s plugged into are probably the ones solely intended for dual protocol mouses. The wiring of which was never standardised, so given mouse, even if you know it was dual protocol, might not work with random adapter.

      I wonder though, if you’re using a USB keyboard or mouse whether you could use a PS/2 mouse adapter for an extra charge port on machines with PS/2 holes.

      1. Having regular quality time with your family is important. I think that this idea that seems so prevelant these days that one should pretty much stop their hobbyist activities when they are married or for the duration of their children’s childhood is harmful. You certainly shouldn’t be giving up the things you love for a spouse. It’s part of who you are. If she doesn’t like that then who does she actually love and why are you married to her? Also, let the kids see you building stuff. Seeing adults doing things is how they learn that they might want to do them themselves!

        It’s no wonder we live in such a dumbed down society. People have been forgetting to pass their skills and interests down to their kids!

    1. Hey, thanks for the comment. Yeah I should’ve added a disclaimer: I’m a software engineer, and I work hard to be good at it, but I know nothing about hardware. So, when it comes to hardware, I suck absolutely and completely.

      It just happened that I work in a hardware-related fields, but actually there are other people in the team who work with the hardware; and I’m just doing software parts (and I’m trying to do that well).

      Of course I managed to get LED blinking by attaching it to the MCU’s pins in a naive way, but not much more than that. Nevertheless, thanks.

    2. Thanks for the comment. Yeah I probably should’ve added a disclaimer: I’m a software engineer, and I work hard to be good at it, but I know pretty much nothing about the hardware. So, when it comes to the hardware, I suck absolutely and completely. It just happened so that I work in hardware-related fields, but actually there are other people in the team who work with the hardware; and I’m just doing software parts (and I’m trying to do that well).

      Of course I managed to get LED blinking by attaching it to the MCU’s pins in a naive way, but not much more than that. Sorry about attaching LEDs in a wrong way.

  1. C’mon HaD, know more than to disparage a particular language like LISP; especially a language that has existed so long because it does have a reason to exist! Bare LISP has undeniable positive attributes for certain applications; concepts like “Extensible” and “Reentrant” come to mind.

    1. 1984: Situation, 6 incompatible versions of Lisp. Solution, Common Lisp introduced, eventually becoming an ANSI standard…

      Present Day: There are now 20+ incompatible versions of Lisp.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s