DWIM

Last updated

DWIM (do what I mean) computer systems attempt to anticipate what users intend to do, correcting trivial errors automatically rather than blindly executing users' explicit but potentially incorrect input.

Contents

Software

The term was coined by Warren Teitelman in his DWIM package for BBN Lisp, part of his PILOT system, sometime before 1966. [1] [2] [3]

InterLisp

Teitelman's DWIM package "correct[ed] errors automatically or with minor user intervention", [2] similarly to autocorrection for natural language.

Teitelman and his Xerox PARC colleague Larry Masinter later described the philosophy of DWIM in the Interlisp programming environment (the successor of BBN Lisp):

Although most users think of DWIM as a single identifiable package, it embodies a pervasive philosophy of user interface design: at the user interface level, system facilities should make reasonable interpretations when given unrecognized input. ...the style of interface used throughout Interlisp allows the user to omit various parameters and have these default to reasonable values...

DWIM is an embodiment of the idea that the user is interacting with an agent who attempts to interpret the user's request from contextual information. Since we want the user to feel that he is conversing with the system, he should not be stopped and forced to correct himself or give additional information in situations where the correction or information is obvious. [4]

Critics of DWIM claimed that it was "tuned to the particular typing mistakes to which Teitelman was prone, and no others" and called it "Do What Teitelman Means" or "Do What Interlisp Means", [5] or even claimed DWIM stood for "Damn Warren's Infernal Machine." [6]

Emacs

The concept of DWIM has been adopted in augmented form within the context of the GNU Emacs text editor to describe the design philosophy of Emacs Lisp functions or commands that attempt to intelligently "do the right thing" depending on context. [7] The Emacs wiki gives the example of a file copy command that is able to deduce the destination path from a split window configuration that contains two dired buffers, one of which displays the source path; this behaviour also generalises to many applicable dired actions that take two directory paths for arguments.

DWIM behaviour, when available, is often mentioned in a command's name; e.g. GNU Emacs has a comment-dwim function that comments out a selected region if uncommented, or uncomments it when already commented out, while using comment characters and indentation appropriate for the programming language environment and current context. [8] [9]

This kind of DWIM is often not directly concerned with correcting user error but rather guessing user intent from available context. For example, the Emacs Magit package evinces this design philosophy pervasively. Among its numerous diff commands, there is a magit-diff-dwim command, which requires no further input from the user but simply guesses what the user wants to analyse based on the location of the cursor. The Magit User Manual describes the behaviour of magit-diff-dwim simply: "Show changes for the thing at point", [10] "point" being the Emacs term for the cursor.

See also

Related Research Articles

The editor war is the rivalry between users of the Emacs and vi text editors. The rivalry has become an enduring part of hacker culture and the free software community.

<span class="mw-page-title-main">Emacs Lisp</span> Dialect of Lisp used as the primary implementation and extension language for Emacs

Emacs Lisp is a dialect of the Lisp programming language used as a scripting language by Emacs. It is used for implementing most of the editing functionality built into Emacs, the remainder being written in C, as is the Lisp interpreter. Emacs Lisp is also termed Elisp, although there are also older, unrelated Lisp dialects with that name.

An integrated development environment (IDE) is a software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, and a debugger. Some IDEs, such as IntelliJ IDEA, Eclipse and Lazarus contain the necessary compiler, interpreter or both; others, such as SharpDevelop and NetBeans, do not.

In computing, the utility diff is a data comparison tool that computes and displays the differences between the contents of files. Unlike edit distance notions used for other purposes, diff is line-oriented rather than character-oriented, but it is like Levenshtein distance in that it tries to determine the smallest set of deletions and insertions to create one file from the other. The utility displays the changes in one of several standard formats, such that both humans or computers can parse the changes, and use them for patching.

<span class="mw-page-title-main">Gnus</span>

Gnus, or Gnus Network User Services, is a message reader which is part of GNU Emacs. It supports reading and composing both e-mail and news and can also act as an RSS reader, web processor, and directory browser for both local and remote filesystems.

Interlisp is a programming environment built around a version of the programming language Lisp. Interlisp development began in 1966 at Bolt, Beranek and Newman in Cambridge, Massachusetts with Lisp implemented for the Digital Equipment Corporation (DEC) PDP-1 computer by Danny Bobrow and D. L. Murphy. In 1970, Alice K. Hartley implemented BBN LISP, which ran on PDP-10 machines running the operating system TENEX. In 1973, when Danny Bobrow, Warren Teitelman and Ronald Kaplan moved from BBN to the Xerox Palo Alto Research Center (PARC), it was renamed Interlisp. Interlisp became a popular Lisp development tool for artificial intelligence (AI) researchers at Stanford University and elsewhere in the community of the Defense Advanced Research Projects Agency (DARPA). Interlisp was notable for integrating interactive development tools into an integrated development environment (IDE), such as a debugger, an automatic correction tool for simple errors, and analysis tools.

<span class="mw-page-title-main">Keyboard shortcut</span> Series of computer keys to quickly invoke a software program or perform a preprogrammed action

In computing, a keyboard shortcut also known as hotkey is a series of one or several keys to quickly invoke a software program or perform a preprogrammed action. This action may be part of the standard functionality of the operating system or application program, or it may have been written by the user in a scripting language. Some integrated keyboards also include pointing devices; the definition of exactly what counts as a "key" sometimes differs.

In aspect and functional programming, advice describes a class of functions which modify other functions when the latter are run; it is a certain function, method or procedure that is to be applied at a given join point of a program.

This article provides basic comparisons for notable text editors. More feature details for text editors are available from the Category of text editor features and from the individual products' articles. This article may not be up-to-date or necessarily all-inclusive.

In user interface design, a mode is a distinct setting within a computer program or any physical machine interface, in which the same user input will produce perceived results different from those that it would in other settings. Modal interface components include the Caps lock and Insert keys on the standard computer keyboard, both of which typically put the user's typing into a different mode after being pressed, then return it to the regular mode after being re-pressed.

In computing, minimalism refers to the application of minimalist philosophies and principles in the design and use of hardware and software. Minimalism, in this sense, means designing systems that use the least hardware and software resources possible.

EINE and ZWEI are two discontinued Emacs-like text editors developed by Daniel Weinreb and Mike McMahon for Lisp machines in the 1970s and 1980s.

<span class="mw-page-title-main">Common Lisp Interface Manager</span>

The Common Lisp Interface Manager (CLIM) is a Common Lisp-based programming interface for creating user interfaces, i.e., graphical user interfaces (GUIs). It provides an application programming interface (API) to user interface facilities for the programming language Lisp. It is a fully object-oriented programming user interface management system, using the Common Lisp Object System (CLOS) and is based on the mechanism of stream input and output. There are also facilities for output device independence. It is descended from the GUI system Dynamic Windows of Symbolics' Lisp machines between 1988 and 1993.

... you can check out Common Lisp Interface Manager (CLIM). A descendant of the Symbolics Lisp machines GUI framework, CLIM is powerful but complex. Although many commercial Common Lisp implementations actually support it, it doesn't seem to have seen a lot of use. But in the past couple years, an open-source implementation of CLIM, McCLIM – now hosted at Common-Lisp.net – has been picking up steam lately, so we may be on the verge of a CLIM renaissance. – From Practical Common Lisp

Warren Teitelman was an American computer scientist known for his work on programming environments and the invention and first implementation of concepts including Undo / Redo, spelling correction, advising, online help, and DWIM (Do What I Mean).

<span class="mw-page-title-main">GNU Emacs</span> GNU version of the Emacs text editor

GNU Emacs is a free software text editor. It was created by GNU Project founder Richard Stallman, based on the Emacs editor developed for Unix operating systems. GNU Emacs has been a central component of the GNU project and a flagship project of the free software movement. Its tag line is "the extensible self-documenting text editor."

Emacs, originally named EMACS, is a family of text editors that are characterized by their extensibility. The manual for the most widely used variant, GNU Emacs, describes it as "the extensible, customizable, self-documenting, real-time display editor". Development of the first Emacs began in the mid-1970s, and work on GNU Emacs, directly descended from the original, is ongoing; its latest version is 29.3, released March 2024.

<span class="mw-page-title-main">Alice K. Hartley</span> American computer scientist (1937–2017)

Alice Hartley (1937–2017) was an American computer scientist and business woman. Hartley worked on several dialects of Lisp, implementing multiple parts of Interlisp, maintaining Macintosh Common Lisp, and developing concepts in computer science and programming language design still in use today.

Larry Melvin Masinter is an early internet pioneer and ACM Fellow. After attending Stanford University, he became a Principal Scientist of Xerox Artificial Intelligence Systems and author or coauthor of 26 of the Internet Engineering Task Force's Requests for Comments.

<span class="mw-page-title-main">Magit</span> Emacs interface for the Git version control system

Magit is an interface to the Git version control system (a Git Client), implemented as a GNU Emacs package written in Elisp. It is made available through the MELPA package repository, on which it is the most-downloaded non-library package, with over 3.7 million downloads as of February 2023.

References

  1. Warren Teitelman, "PILOT: A Step towards Man-Computer Symbiosis", M.I.T. Ph.D. Dissertation, Project MAC MAC-TR-32, September 1966. DTIC AD0638446 Archived 2012-04-18 at the Wayback Machine PDF, p. 51
  2. 1 2 Warren Teitelman, "Toward a programming laboratory", in J. N. Buxton and Brian Randell, Software Engineering Techniques, April 1970, a report on a conference sponsored by the NATO Science Committee, Rome, Italy, 27–31 October 1969, p. 108ff.
  3. Donald E. Walker, Lewis M. Norton (Eds.): Proceedings of the 1st International Joint Conference on Artificial Intelligence, Washington, DC, p 715, May 1969.
  4. Warren Teitelman, Larry Masinter, "The Interlisp Programming Environment", Computer (IEEE) 14:4:25-33, April 1981. doi : 10.1109/C-M.1981.220410 pdf
  5. Guy L. Steele Jr., Richard P. Gabriel, "The Evolution of Lisp", in History of programming languages---II, 1996, ISBN   0-201-89502-1 doi : 10.1145/234286.1057818, p. 16. pdf
  6. "DWIM".
  7. "Do What I Mean".
  8. "Comment Tips". Generally speaking, the M-; (comment-dwim) command automatically starts a comment of the appropriate type; or indents an existing comment to the right place, depending on the number of semicolons.
  9. "Comment Commands". The command to create or align a comment is M-; (comment-dwim). The word "dwim" is an acronym for "Do What I Mean"; it indicates that this command can be used for many different jobs relating to comments, depending on the situation where you use it.
  10. "Magit User Manual: 5.4 Diffing".

Further reading