Summery: Life, Practical Common Lisp, Emacs, and Lisp

2006-10-25 12:16:00 PST

Tags: , ,

So aside from posting tid bits, and some complaints I haven't used this blog too much. So what am I up to?

School wise I'm taking a unix scripting class (prerequisite) and it's super easy and fun and an easy A. I'm also taking linear algebra and finding it hard but fun. It's neat stuff. Finally I'm taking calculus 3 which is not so much fun but also hard.

As you may have noticed from the direction of my blog posts, I've started reading the online version of Practical Common Lisp (ordered a hardcopy as well) in order to teach myself the language. It is a fantastic book and I can't recommend it enough. I love Paul Graham's essays but his ANSI Common Lisp left a lot to be desired. Practical Common Lisp takes a good approach to teaching a language by having lots of example code that the reader is expected to type in and test out. Through examples the reader is introduced to new parts of the language and complex programs are built up from the parts used to illustrate each point. This style is much preferred to other books that just give a more essayish intro to a language with minimal reader interaction. This book takes me back to a lot of the first computer books I read in high school when first learning Borland's Delphi. Those were also great books full of incremental examples. If you want to learn lisp, this is a great place to start.

Also, in order to use a nice lisp environment, I've had to start using and learning emacs. I've been a long time Vim user and fan and have shied away from emacs in the past. No more. And I'm finding on the whole I really like emacs... well, emacs + slime. It's a pretty amazing environment to code in. Being able to type functions into a file and compile each individual function independently and then go straight to a Lisp shell and interact with the function is pretty awesome and something that I've never really been able to easily do with any other language/IDE. So emacs + slime wins huge points there.

Compared to vim, you may have noticed my post/rant about how difficult getting auto-indent going (which failed) was. But to it's creadit, emacs does have smart tabbing so hitting tab anywhere will take you to where you should be. So it means one extra key per line (return + tab). I can live with that. Emacs seems to require more tinkering with files to get it setup just the way you want where as vim seems to be just about right by default.

As for vim or emacs in X (or win32 GUI), vim has a nice GTK interface where as emacs uses the very aged motif. Changing fonts isn't in the menu (M-x set-default-font Font name: 9x15), and neither is changing the color scheme (they both are in vim), but both are reasonably easily done via emacs commands, once figured out (read: googled). Also, you do have to manually install color schemes for emacs where as they ship with vim. This isn't too hard on Gentoo (emerge color-themes) but it's a bit more of a hassle for Windows on my USB stick. So some points off for usability. Emacs is more work to get up and running, but it's pretty awesome when it is. You'll also definitely want to work through the tutorial provided with emacs (C-h t) and the first chapter of Practical Common Lisp carefully. But I'm now getting the hang of it and it's pretty nice.

I doubt I'll ever switch to emacs for editing normal text files or even for programming in other languages, but it is the place to be for using Lisp. It's just too big and hulking and a bit of a hassle. Vim is so small, compact, simple, and everything I want for config file editing, text file editing, and even programing in other languages. Both have support for buffers but emacs pushes the support more and introduced it to you in the tutorial because you can't really use emacs with out understanding them. Vim (or at least vim's tutorial) doesn't focus much on them and I end up suing screen + several copies of vim for multi file editing. Again, Vim is easier to get into and learn, but emacs is probably more powerful in the long run.

As for Lisp, I'm slowly starting to get a better handle on it. It is pretty amazing it self. It has 'no syntax', you just code directly in the parse tree. It has a lot of really neat features that I've seen already that are trivial to do in Lisp and hard or impossible in other languages (anonymous functions defined and assembled in other functions, and returned as a result?). I really just can't wait to learn more. Its a lot of fun.

Leave a Reply

Valid XHTML 1.0!
Valid CSS!
Mindstab.net is proudly powered by WordPress
Entries (RSS) and Comments (RSS).
20 queries. 0.672 seconds.