Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the major differences between Emacs Lisp and Common Lisp? [closed]

I want to learn the lisp language, since my editor is emacs, I prefer emacs lisp.

Can anyone give me some suggestions to learn lisp, emacs lisp, or common lisp?

What are the major differences between those two?

like image 620
user1087032 Avatar asked Dec 08 '11 15:12

user1087032


People also ask

Is Emacs Lisp A Common Lisp?

Gnu emacs is written almost entirely in Common Lisp! Unfortunately, this version of Common Lisp is so incomplete that it won't be sufficient for programming in our class. Instead, you can run and use lisp within emacs.

What is Emacs Lisp used for?

Emacs Lisp is a dialect of the Lisp programming language used as a scripting language by Emacs (a text editor family most commonly associated with GNU Emacs and XEmacs). It is used for implementing most of the editing functionality built into Emacs, the remainder being written in C, as is the Lisp interpreter.

Is Emacs Lisp compiled or interpreted?

Emacs Lisp has a compiler that translates functions written in Lisp into a special representation called byte-code that can be executed more efficiently.


2 Answers

There's quite a bit of crossover, especially at the beginner level, so whichever you start with will mostly transfer to the other.

Some of the major differences:

  • ELisp traditionally used dynamic scoping rules; Common Lisp uses lexical scoping rules. With dynamic scoping, a function can access local variables declared in calling functions and has generally fallen out of favor. Starting with Emacs 24, Emacs allows optional lexical scoping on a file-by-file basis (and all files in the core distribution are progressively being converted).

  • Dynamically scoped ELisp doesn't have closures, which makes composing functions and currying difficult. There's a apply-partially function that works similarly to currying. Note that the lexical-let form introduced in Emacs 24 makes it possible to produce closures via lexical scoping.

  • Much of the Common Lisp library that has been built up over time isn't available in elisp. A subset is provided by the elisp cl package

  • elisp doesn't do tail-call optimization.

like image 71
ataylor Avatar answered Oct 02 '22 05:10

ataylor


These Emacs-Wiki pages offer some info about the relation between the two Lisps and their differences:

  • http://www.emacswiki.org/emacs/CommonLisp
  • http://www.emacswiki.org/emacs/EmacsLisp
  • http://www.emacswiki.org/emacs/EmacsLispLimitations
like image 28
Drew Avatar answered Oct 02 '22 06:10

Drew