Let’s Play: Lisp E:1

So a while back, not sure when exactly, I purchased a book on AI for some unknown reason; Paradigms of eh… something something Artificial Intelligence… something something. Anyway, it is highly regarded not just for AI stuff (Though Lisp apparently isn’t the default choice for AI anymore), it’s also supposed to be a great book on programming in general. At least that’s what I was sold on… I think. I also wanted it so I could get a deeper understanding of functional programming. I actually had “shelved” this book (Being I bought the Kindle version I don’t know how I would “shelve” it) for one of my many manymany… jumps to other languages.

For the last year or so I’ve been putting a lot of time into finding some language that fit me right. Most people would have taken a pretty straight forward approach:

  • What is it that I want to achieve?
  • What is it that would make me happy?
  • What is that would solve whatever issues I have with C#?

Instead I decided to just flail my arms, and grab onto whatever I could. And did I ever grab. Ela, Nemerle, F#, Racket, Clojure, Opa, Smalltalk, Prolog, D, Haskell… and probably a dozen others I can’t remember. As I said, “arms flailing”. It’s not that they are bad languages. Actually to my surprise they all are pretty good. Problems like IDE support, community strength, ability to find hosting (COMPLETE BITCH), and clear cut libraries for web development were things that came up a lot. For example D: Probably the most impressive language I have ever seen hands down. The meta programming potential is off the charts. Problem? Web development is not really the goal of most D users.

So I kept finding myself trying to make F# work. After all, I’ve been dealing with the .Net stack for over a decade, AND it is a by gosh true functional language. It should be a no brainer… but as nice of a language it is, the support sucks. It took Microsoft… 4? years in order for MS Test to be able to pick and run Unit Tests. FOUR @#!%ing years. Not to mention how mediocre the Intellisense support which has only become livable in 2012. And if you think I’m just being a #%^@ to Microsoft because I can; That’s nowhere near the truth. My anger comes from failed expectations from a company I expect the best from. Fact of the matter is: If you like C#, it’s probably one of the best supported languages out there… from what I’ve seen it’s the best. But to me, it just doesn’t work for me anymore.

When I finally decided to drop the F# for good, I found myself frustrated to say the least. This basically meant I had to go with a far less supported, open source language for .Net (Which there are a couple of really good ones) that just doesn’t have the support (Understandably) that C# has, or I’d have to for sure put .Net behind me for good outside of work. This also meant I would have to leave my beloved Resharper behind. And if you’ve never used Resharper before, you have no idea how hard it is to walk away from that too.

So within the last couple weeks, I’ve taken another look into the Lisp in a Box for Windows, I was well on my way. Now my only obstacle between myself and Lisp was Emacs.

Now before any Emacs users get all Nerd Raged, understand that I’ve spent most of my programming life in the comfy, heavily GUI based world of Visual Studios. Emacs is about the closest to Not Visual Studio that I can imagine exists. It’s like the evil Visual Studio double from that other dimension in Star Trek. The one with a mustache and goatee. Pretty much everything is either keyboard based, or at least keyboard accessible. Being that Emacs itself pre-dates the household available mouse, I’m guessing somewhere along someone said, “We’ve lived without mice this long, so %@#! ’em!” Well maybe not that harsh, but whatever. Point being, I thought I was pretty pro keyboard until I met Emacs. Was I wrong. Even with the estimated 1.4 bagillion (+/- .1 bagillion) key shortcuts Resharper has, I wasn’t prepared the least bit. The first 15 minutes almost had me convinced that this was in fact one of the many literary levels of Hell. It’s not just that Emacs uses key combinations, it’s that when paired with Lisp tools like SLIME it becomes a nightmarish extravaganza of “WHAT THE #$@# JUST HAPPENED!?!”

Oh sorry you meant to hit Ctrl + x, Ctrl + b for a pretty display of open files? Too bad because you didn’t hold Ctrl for b, and now you have to chose some random !#@ one line command prompt to find the file by pressing up and down.

Oops? Did you mean Ctrl+x, 2 so you could split the screen? Sucks for you since you press Ctrl + x, 1 which kills all but one screen.

The level of frustration reached a limit reserved only for POS video baby monitors that CANCEL OUT EVERY @#*$ING WIRELESS SIGNAL FOR A 12 BLOCK RADIUS. So as you can imagine, it didn’t go so well this first time. HOWEVER, like the good little monkey that I am, I was able to finally get down some useful controls:

Ctrl + x, 2 : Open up another screen within Emacs for a split screen look… For a real laugh, do this over and over again. Emacs will just keep splitting screens… still can’t figure out how to close them one by one though.
Ctrl + x, o : Switch between open screens within the current Emacs instance
Ctrl + c, Tab : Auto complete… An odd departure from what I’m used to from Visual Studio. Instead of a small selection box, it temporarily opens up another window with various possible keywords to choose from
Ctrl + x, Left Arrow/Right Arrow: Cycle through every “buffer”. Buffer being the generic name for “open stuff” which can be files, or programs like SLIME.
Ctrl + x, Ctrl + b: Get a list of all “buffers” to chose from
Ctrl + x, 1: Close all windows but one
Ctrl + ?, ?: Somehow open up three more windows of the same REPL (basically like a real time compiler and intrpreter) and be able to see yourself typing the same @$#*ing thing in for windows at the same time.

As you can see, I have a long way to go though. However, I am happy to say that I can at least now use the book.