31

The last few months I've been using Emacs extensively as my main development environment and I've now come to a point at which I'd like to learn it's own Emacs Lisp to write my own little stuff for Emacs and extend it to my personal needs.

Having said that I've also wanted to learn Common Lisp for a while now, to play around with and explore a new language. My question is, where should I start from? Will Emacs Lisp give me the necessary knowledge to pick up Common Lisp later more easily or the other way round? I'm basically interested in the efficiency of each path so as to minimize the learning curve when I finally decide to move from one dialect to the other.

Rainer Joswig
  • 136,269
  • 10
  • 221
  • 346
serk01
  • 343
  • 3
  • 8

8 Answers8

15

Start with Emacs Lisp (given that you seem to have already started customizing your emacs) - it seems to be more immediately useful for you.

Do keep in mind that there is quite a bit of difference between Emacs Lisp (there is a lot of buffer management stuff, especially in the code you're likely to see in the wild) and Common Lisp (more similar to a general purpose programming language), so which ever route you take, expect some amount of "wastage"

Rohith
  • 2,043
  • 1
  • 17
  • 42
  • That makes sense. I was also thinking that if I start with Emacs Lisp I will get more immediate satisfaction out of it as I will be actively enhancing my dev environment and seeing real results from what I've learned – serk01 Oct 01 '10 at 15:33
  • Another point in favor of elisp: the `cl-macs.el` package can give you a subset of Common Lisp in emacs, and makes it much easier to have a smooth gradient between those two Lisp dialects. – Brighid McDonnell Nov 05 '12 at 18:04
13

I assume you searched SO before posting and saw the questions "What's the best way to learn LISP?" and possibly "Tips for Learning Elisp". Those are two good starting points for how to learn either one.

As far as which one to learn first, it all depends on what you want to do. If you have an idea for a project that interests you, then use the appropriate lisp to solve that. For example, if you want to add/change some functionality in your development environment, use emacs lisp. Otherwise (if it's not editor related), use common lisp.

For me, it's all about finding a project that interests you, and using that to guide which language to use.

They're each close enough that becoming familiar with one will make using the other straight forward. Emacs lisp has a lot of domain specific features (buffers, regions, text properties, files, sub-processes, etc.), and common lisp has a wide varieties of libraries to use.

Community
  • 1
  • 1
Trey Jackson
  • 73,529
  • 11
  • 197
  • 229
  • Yes I did search SO and found the posts you mentioned, but they weren't exactly related to my query. Based on your and Rohith's replies,I think I'm leaning towards going for Emacs Lisp first as it will be more directly useful to me. – serk01 Oct 01 '10 at 16:07
8

This may be useful: a comparison of Common Lisp, Scheme, Clojure, and Emacs Lisp.

John D. Cook
  • 29,517
  • 10
  • 67
  • 94
6

I'd recommend you to start with Common Lisp first since it's much more general purpose than Emacs Lisp. Once you're acquainted with Common Lisp you'll have very little trouble picking up Emacs Lisp(it's a much simpler dialect of Lisp).

You might as why I'm suggesting to start from the "more difficult" language of the two and you'd be right to ask such a question. The answer is fairly simply - much of the stuff in Emacs Lisp are fairly tied down to Emacs and you might be missing part of the big picture if you start from there.

I personally started my journey towards Lisp with the excellent book "Practical Common Lisp" which others have already recommended. It got me hook to the lisp vision and ideas and once I understood Common Lisp it was fairly easy for me to start writing Emacs Lisp code right away. I'm not sure the journey would be as smooth in the opposite direction, but everything is subjective and matter of personal preferences.

Bozhidar Batsov
  • 55,802
  • 13
  • 100
  • 117
3

I like these books:

rogersillito
  • 869
  • 1
  • 10
  • 27
Starkey
  • 9,673
  • 6
  • 31
  • 51
  • Thanks a lot but that doesn't really answer my question. Which way should I go EmacsLisp -> CommonLisp or vice versa? – serk01 Oct 01 '10 at 15:26
3

Play with and practice Emacs Lisp. You will immediately be able to do things you can see and relate to. At the same time perhaps, read a book on Common Lisp. And the Elisp manual.

The reading won't hurt and can give you more background and overview. But it depends how you like to learn etc. Reading gives you a bigger picture than what you might get starting out practicing -- lets you know where you could go, what you could do, even if you never need or want to.

Drew
  • 29,895
  • 7
  • 74
  • 104
2

I recommend that you start with EmacsLisp, as it will be more immediately useful as already stated.
And as soon as you get a good grasp on the peculiarities of the language, you could start usingeieio.

To quote the emacswiki, it is An implementation of the CommonLisp object orientation standard (CLOS) in EmacsLisp.

Best of both worlds !

julien
  • 1,879
  • 2
  • 20
  • 29
1

Probably learn both in parallel.

When learning Common Lisp I used exercises from the Structure and Interpretation of Computer Programs, which is in Scheme. This meant I was exposed to the differences between Scheme and Common Lisp early on. Similarly, learning emacs-lisp together with CL is perfectly feasible and may even help you understand scoping, since it differs between each.

justinhj
  • 11,147
  • 11
  • 58
  • 104