Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's so inferior about inferior-lisp?

As I've started learning about lisp, emacs, and ess (Emacs Speaks Statistics), I've come across this concept of inferior-this-or-that. For instance, there's an inferior-ess-mode, inferior-lisp, and Inferior Emacs Lisp Mode.

In all these cases, it seems that some interpreted language is running within emacs, and you can interact with it within a buffer. But why are they inferior and what are they inferior to?

like image 650
Ben Ogorek Avatar asked Aug 10 '14 03:08

Ben Ogorek


2 Answers

An inferior mode refers to a mode which run as a subprocess of emacs.

For example, this is my process tree when I start emacs:

$ pstree 62238
--= 62238 smt /usr/local/Cellar/emacs/HEAD/Emacs.app/Contents/MacOS/Emacs

After I run an inferior tcl shell, this is what my process tree looks like:

$ pstree 62238
-+= 62238 smt /usr/local/Cellar/emacs/HEAD/Emacs.app/Contents/MacOS/Emacs
 \-+= 62359 smt /bin/sh /usr/bin/wish
   \--- 62361 smt /usr/bin/../../System/Library/Frameworks/Tk.framework/Version

Another way of saying this might be that "inferior" is synonymous with the prefix "sub-" in this context.

like image 88
smt Avatar answered Oct 14 '22 22:10

smt


I think the Inferior Emacs Lisp Mode (ielm) is a wrong name. That should be named Interactive Emacs Lisp Mode. With ielm Emacs Lisp is not running as an inferior Lisp. It is a read eval print loop for the built-in Emacs Lisp. GNU Emacs really names it Inferior Emacs Lisp Mode, but if you look at the sources, it uses directly the built-in Emacs Lisp eval to evaluate the expressions. It just reuses some infrastructure (comint) for dealing with inferior interpreters (like Lisps, shells, ...).

Generally Inferior Lisp means that it is a (often external) Lisp system under control from Emacs. It also does not need to be Emacs Lisp. Usually it is some other Lisp dialect like Common Lisp. Common Lisp has/had several extensions to Emacs and Common Lisp, so that it runs as an inferior Lisp with a lot of functionality of a Lisp development environment (debugger, inspector, source locator, ...):

  • ILISP (Inferior Lisp), outdated
  • ELI (Emacs-Lisp Interface), from Franz, Inc. for Allegro CL
  • SLIME (Superior Lisp Interaction Mode for Emacs)

Emacs also has a simple built-in facility for running an inferior Lisp: External Lisp.

  • inferior-ess-mode: controls a R subprocess
  • inferior-lisp: a Lisp subprocess
  • inferior-emacs-lisp-mode: the built-in Emacs Lisp as a read eval print loop
like image 39
Rainer Joswig Avatar answered Oct 14 '22 23:10

Rainer Joswig