14
votes

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?

2
It's inferior in the sense that you're inferior to your superiors. It's not a qualitative term; it refers the fact that the inferior process is managed by the superior process, "reports" to the superior processes, and "receives tasking" from the superior process.Joshua Taylor

2 Answers

14
votes

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.

8
votes

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