Editing 224: Lisp

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 4: Line 4:
 
| title    = Lisp
 
| title    = Lisp
 
| image    = lisp.jpg
 
| image    = lisp.jpg
| titletext = We lost the documentation on quantum mechanics. You'll have to decode the regexes yourself.
+
| imagesize =
 +
| titletext = We lost the documentation on quantum mechanics. You'll have to decode the regexes yourself.
 
}}
 
}}
  
 
==Explanation==
 
==Explanation==
{{w|Lisp (programming language)|Lisp}} is a computer programming language with simple, highly regular syntax. The language's most notable feature is that programs take the same form as the language's primary data structure (the linked list). This blurs the line between code and data and permits programs to inspect and even alter their own source code, thereby opening up deep opportunities for {{w|metaprogramming}}. Lisp is also a {{w|Functional programming|functional programming language}} (though not purely functional, as {{w|Haskell (programming language)|some more recent languages are}}), meaning that programs are expressed in terms that are simple elaborations or extensions of the {{w|lambda calculus}}, a formal mathematical model of computation. This gives programs written in functional languages such as Lisp a distinctively abstract, mathematical form that is commonly considered difficult to fully {{w|Grok#In_computer_programmer_culture|grok}} (see [[1270: Functional]]).
+
{{Incomplete}}
 +
First some definitions. {{w|Lisp (programming language)|Lisp}} is a computer programming language, first specified in 1958. Lisp dialects use the command "car" for the operation that returns the first item in a list. {{w|Perl}} is another computer programming language, sometimes known as "the Swiss Army chainsaw of scripting languages," and well known for it's complex regexes. A regex or {{w|regular expression}} provides a concise and flexible means to "match" (specify and recognize) strings of text. They were also referenced in [[208: Regular Expressions]].
  
The phrase ''A suffusion of blue'' is a reference to {{w|Douglas Adams}}' book ''{{w|The Long Dark Tea-Time of the Soul}}''. In it, an ''{{w|I Ching}}'' calculator calculates that everything above the value of 4 is ''a suffusion of yellow''.
+
The line "It's full of 'car's" is a reference to the book and film {{w|2001 A Space Odessey}}. In 2001, the astronaut David Bowman accidentally activates a star gate and exclaims as he enters it "Oh my God - it's full of stars!"  In Lisp, "{{w|CAR_and_CDR|car}}" is a fundamental command in Lisp that returns the first item of a list.
  
In the comic, Cueball marvels at the fundamental and complete nature of the language of creation that he sees in his dream. In the Lisp programming language, "car" is a primitive (i.e. basic) function that produces the first item in a list. The line "My God, It's full of '{{w|CAR_and_CDR|car}}'s" is a pun, most likely referring to the movie {{w|2010 (film)|2010: The Year We Make Contact}}, the sequel to {{w|2001: A Space Odyssey (film)|2001: A Space Odyssey}}. In the book {{w|2001: A Space Odyssey (novel)|2001: A Space Odyssey}}, when astronaut David Bowman accidentally activates a star gate, he exclaims as he enters it "The thing's hollow — it goes on forever — and — oh my God - it's full of stars!", although he does not say anything in the first movie during the final sequence. This likely also includes a transitive reference a chapter in {{w|The Little Schemer}}, a popular introductory Lisp book, called ''*Oh My Gawd*: It's Full of Stars'', also itself a reference to 2001. From the shape of the two discs in front of Cueball, it may also be referring to Terry Pratchett's book ''The Last Hero'' where the last survivor of a ship that went under the disc says “Oh my God it’s full of elephants.
+
In the comic, Cueball marvels at the fundamental and complete nature of the language of creation that he sees in his dream, the ultimate {{w|low level language}}, before being told by God that the universe was mostly built using a {{w|high level programming language}}, perl.
  
In the second panel, Cueball remarks that, "At once, just like they said, I felt a great enlightenment." This is a reference to a pattern of observations among programmers and computer scientists that while Lisp often seems alien or arcane — even deliberately so, even to experienced hackers, even with repeated exposure over time — truly ''understanding'' Lisp in a deep, non-superficial way, results in a profound epiphany, a sudden and abiding ''illumination'' wherein one's preconceived notions about computation and programming are fundamentally transfigured, oftentimes over the course of a very short span such as during a single all-day hacking binge. Lispers commonly describe the experience as being akin to learning programming for the first time ''again''; {{w|Daniel P. Friedman}} (author of much ground-breaking research and many popular introductory texts on Lisp and programming language design) described it as "[learning] ''to think {{w|Recursive_definition|recursively}}''," and contended that "''thinking about'' [functional] ''computing is one of the most exciting things the human mind can do''."
+
==Trivia==
 
+
In his [http://www.youtube.com/watch?v=zJOS0sV2a24#t=29m11s Google-speech], [[Randall]] said that he spent 3-4 hours on getting the blue shading just right.
Cueball's remarks about patterns, metapatterns, and the disappearance of syntax are reactions to the elegant simplicity of the Lisp programming language, in which it is relatively easy to build immensely sophisticated programs using simple recursive elaborations of structure. This is fundamentally unlike the much more typical and common {{w|Imperative programming|imperative programming languages}}, in which programs are written as chains of instructions for the machine to follow.
 
 
 
Cueball then, in the third, borderless panel, muses that this has to have been the language the gods used to create the universe, which is a pretty bold statement that Cueball seems to make because he views Lisp as something flawless and perfect, as these are qualities that often subjectively apply to things that people, like Cueball, claim to have been made or used by gods or other holy beings.
 
 
 
A cloudy, bearded man, presumably representing God, states that this is untrue, and after a surprised inquiry from Cueball replies that the universe was actually hacked together with the programming language {{w|Perl}}. Perl employs an idiosyncratic syntax that borrows liberally from a number of other languages. Although a versatile language often employed for assembling projects quickly (the much-loved {{w|Programming Perl}} introduces it as "[the] ''language for getting your job done''"), Perl has a reputation for being ugly and inelegant, partly as a result of its pidgin-like fusion of many inconsistent language elements and code styles. It was famously described as a "{{w|Swiss Army knife|Swiss-Army}} chainsaw," because it is very powerful but also unwieldy and unattractive. By way of contrast to Daniel Friedman above, {{w|Larry Wall}}, the creator of Perl, criticized the highly cerebral Lisp attitude toward programming with the words
 
<blockquote>"By policy, LISP has never really catered to mere mortals.</blockquote>
 
<blockquote>And, of course, mere mortals have never really forgiven LISP for not catering to them."</blockquote>
 
 
 
The joke is that the Creator, like many software developers, was a bit rushed and chose to quickly throw together a working prototype rather than do the job right from the beginning; concurrently, that Cueball, thinking he has discovered an amazing and beautiful secret in the hidden world of Lisp, learns that in fact the real world is filled with ugly hacks and quick-and-dirty imperative code.
 
 
 
A (possible) hidden joke might be an oblique reference to {{w|Greenspun's tenth rule}} when God replies with "I mean, ostensibly, yes." Greenspun's tenth rule says that any sufficiently complex program written in another high level programming language will necessarily contain an imperfect, undocumented, slow, and bug-ridden implementation of about half of {{w|Common Lisp}}. Greenspun's tenth rule was meant to express the belief that Common Lisp, a large, full-featured Lisp dialect, is so flexible and robust that any attempt to render any really sophisticated program in most other languages requires the programmer to expend extraordinary effort unwittingly reinventing, in needlessly convoluted fashion, features and systems that would be elegant and trivial in Common Lisp. This explains why such a program might look or feel "Lispy" to an unfamiliar observer, and why the universe (if viewed as such a program) might ''look'' to mathematicians and scientists as though it probably has a beautifully simple mathematical basis, even if in reality it was just hacked together with a bunch of ersatz, special-case rules.
 
 
 
The title text continues the analogy by suggesting that the theory of {{w|quantum mechanics}} was written in {{w|Regular expression|regular expressions}} ("regexes"), a complex language for pattern matching used heavily in Perl. Regular expressions are often criticized as being a {{w|write-only language}}, that is, a language so complicated in syntax that any significant program written in them cannot be understood by anybody (often not even the original author). Documentation is essential to assist in the understanding of complex regular expressions. The title text claims that at some point, the documentation for quantum mechanics was lost, which explains why quantum mechanics is so bizarre and counterintuitive.
 
  
 
==Transcript==
 
==Transcript==
:[Floating in space.]
+
:[Floating in space]
 
:Speaker: Last night I drifted off while reading a Lisp book.
 
:Speaker: Last night I drifted off while reading a Lisp book.
 
:Cueball: Huh?
 
:Cueball: Huh?
 
:Speaker: Suddenly, I was bathed in a suffusion of blue.
 
:Speaker: Suddenly, I was bathed in a suffusion of blue.
  
:[Floating in space before a vast concept tree.]
+
:[Floating in space before a vast concept tree]
:Speaker: At once, just like they said, I felt a great enlightenment. I saw the naked structure of Lisp code unfold before me.
+
:Speaker: At once, just like they said, I felt a great enlightenment. I saw the naked structure of Lisp code unfold before me.
 
:Cueball: My God
 
:Cueball: My God
 
:Cueball: It's full of 'car's
 
:Cueball: It's full of 'car's
:Speaker: The patterns and metapatterns danced. Syntax faded, and I swam in the purity of quantified conception. Of ideas manifest.
+
:Speaker: The patterns and metapatterns danced. Syntax faded, and I swam in the purity of quantified conception. Of ideas manifest.
  
:[Close-up of floating in space before part of a concept tree.]
+
:[Close-up of floating in space before part of a concept tree]
 
:Truly, this was the language from which the gods wrought the Universe.
 
:Truly, this was the language from which the gods wrought the Universe.
  
:[Floating in space with God appearing through a line of clouds.]
+
:[Floating in space with God appearing through a line of clouds]
 
:God: No, it's not.
 
:God: No, it's not.
 
:Cueball: It's not?
 
:Cueball: It's not?
 
:God: I mean, ostensibly, yes. Honestly, we hacked most of it together with Perl.
 
:God: I mean, ostensibly, yes. Honestly, we hacked most of it together with Perl.
  
==Trivia==
+
{{comic discussion}}  
*In his [http://www.youtube.com/watch?v=zJOS0sV2a24#t=29m11s Google-speech], [[Randall]] said that he spent 3–4 hours on getting the blue shading just right.
+
<!-- Include any categories below this line-->
 
 
{{comic discussion}}
 
 
[[Category:Comics featuring Cueball]]
 
[[Category:Comics featuring Cueball]]
 
[[Category:Comics with color]]
 
[[Category:Comics with color]]
 
[[Category:Programming]]
 
[[Category:Programming]]
[[Category:Religion]]
 
[[Category:Computers]]
 
[[Category:Regex]]
 

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)