224: Lisp

Explain xkcd: It's 'cause you're dumb.
Revision as of 06:33, 21 June 2015 by Davidy22 (talk | contribs) (removed Category:Puns using HotCat)
Jump to: navigation, search
Lisp
We lost the documentation on quantum mechanics. You'll have to decode the regexes yourself.
Title text: We lost the documentation on quantum mechanics. You'll have to decode the regexes yourself.

Explanation

Lisp is a computer programming language with highly regular syntax. The language's most notable feature is that programs take the same form as the language's primary data structure (the list). This blurs the line between code and data and permits programs to inspect and even alter their own source code, thereby opening up opportunities for metaprogramming. Lisp is also a functional programming language (more or less), meaning that programs are expressed in terms of lambda calculus, a mathematical framework for computation.

The phrase A suffusion of blue is a reference to Douglas Adams' book The Long Dark Tea-Time of the Soul. In it, an I Ching calculator calculates everything above the value of 4 is a suffusion of yellow.

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 fundamental function which produces the first item in a list. The line "My God, It's full of 'car's" is a pun, most likely referring to the movie 2010, the sequel to 2001: A Space Odyssey (movie). In the book 2001: A Space Odyssey (novel) 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.

Cueball's remarks about patterns, metapatterns, and the disappearance of syntax are reactions to the elegant simplicity of the Lisp programming language.

God replies that the universe was actually hacked together with the programming language Perl. Perl employs an idiosyncratic syntax which borrows from a number of other languages. Although a versatile language often employed for assembling projects quickly (some might say "hastily"), the language has a reputation for being ugly and inelegant. It was famously described as a "Swiss-Army chainsaw", because it is very powerful but also unwieldy and unattractive.

The joke is that the Creator, like many software developers, was in a bit of a hurry and chose to throw something together rather sloppily.

The second hidden joke might be a reference to Greenspun's tenth rule when God replies with "I mean, ostensibly, yes". Greenspun's tenth rule says that any sufficiently complex program is basically a imperfect reimplementation of Common Lisp. This explains why the program looks like Lisp for the outside observer.


The title text continues the analogy by suggesting that the theory of quantum mechanics was written in regular expressions ("regexes"), a complex language for pattern matching used heavily in Perl. Regular expressions are often criticized as being a write-only language, that is, a language so complicated that any significant program 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 complex.

Transcript

[Floating in space.]
Speaker: Last night I drifted off while reading a Lisp book.
Cueball: Huh?
Speaker: Suddenly, I was bathed in a suffusion of blue.
[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.
Cueball: My God
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.
[Close-up of floating in space before part of a concept tree.]
Truly, this was the language from which the gods wrought the Universe.
[Floating in space with God appearing through a line of clouds.]
God: No, it's not.
Cueball: It's not?
God: I mean, ostensibly, yes. Honestly, we hacked most of it together with Perl.

Trivia

  • In his Google-speech, Randall said that he spent 3–4 hours on getting the blue shading just right.


comment.png add a comment! ⋅ comment.png add a topic (use sparingly)! ⋅ Icons-mini-action refresh blue.gif refresh comments!

Discussion

I reckon I disagree with this:

In the comic, Cueball marvels at the fundamental and complete nature of the language of creation that he sees in his dream, the ultimate low level language, before being told by God that the universe was mostly built using a high level programming language, perl.

But, despite its age, Lisp is also a high-level language and lispers probably spend more of their time dealing with higher-level abstractions than perlists.

What's causing the narrator's marvel in the comic is that Lisp has a very elegant (almost non-existent) syntax and the language has a very close relationship with the underlying syntactical structure of the program, and that thinking about it does tend to give suitably-minded hackers feelings of awe and reverence, once they grok it. Even Larry Wall, the creator of Perl, will readily concede that Lisp is beautiful.

Perl, on the other hand, has masses of totally unrelated syntactical bits and pieces drawn from almost everywhere (basic syntax from C, a bunch of environment variables from shell or awk, an inline documentation format, inline regular expressions, formats borrowed from Fortran, bolted-on pseudo-OO from god-knows-where, you name it), so the language, is huge, messy, non-orthogonal, and ugly - but it does have the advantage that if you need a small job done, you can usually get it done in perl rather fast, at the cost, perhaps, of maintainability for long-term or large projects.

So the narrator dreams that the entire universe was created using the cleanest, most elegant and beautiful computer language so far discovered, one which allows the user to create software in terms of high-level abstractions if he or she chooses to; but in reality, God tells him it was a quick-dirty hack-job done in the dirtiest, ugliest - but effective nonetheless - language around. -- ‎86.165.192.2 (talk) (please sign your comments with ~~~~)

I think that A) you've missed the point of that statement, and B) If you believe the explanation to be inaccurate or incomplete you are fully encouraged to edit it. Also, Perl is not the dirtiest, ugliest language around. There are innumerable contenders, but I'd say Brainfuck is definitely in the running, and I personally would say that Java is in there too. lcarsos_a (talk) 05:03, 26 January 2013 (UTC)
Perl isn't a bad language. The regular expressions that it offers are fantastic, and it's at least consistent. Java's a slow messy and vulnerability-ridden language, but I'd have to go with PHP for the most awful, broken and incomplete piece of crap you could possibly use. Literally has no redeeming features outside of momentum and inexplicably widespread support. Davidy22[talk] 05:44, 26 January 2013 (UTC)
I never said Perl was bad. I need to teach myself Perl. and that Regular Expressions as we know them today came from Perl, is evidence enough that Perl is a wonderful language. And, I'll agree with you that PHP is an ugly, ugly, disgusting piece of trash. As someone who's had to do OO-PHP, just don't, run far away. I did. I ran to Ruby on Rails, and my life, as a web developer, has been heavenly. lcarsos_a (talk) 07:03, 26 January 2013 (UTC)

Lisp, the "ultimate low level language"? Ok, whoever wrote that really does not know what he/she is talknig about.

One of the most valuable characteristics of Lisp is the fact that is can be used in functional paradigm. Perl can also be used that way, but is considered a more hackish language and not as elegant as Lisp. Perl language can solve problems with different methods, and the phrase "ostensibly, yes. Honestly, we hacked most of it together with perl" means that the universe was created with perl, but trying to use Lisp way of programing (probably functional paradigm), instead of actually doing it on Lisp (probably for speed)

Oh, in case is not clear to somebody, Lisp is a HIGH LEVEL LANGUAGE.

Java and php would have to compete for the title of the "the dirtiest, ugliest - but effective nonetheless - language around" 189.135.124.172 18:32, 18 April 2013 (UTC)


Ok, somewhat a Perl-head here, but not going to add to the arguments about that. Instead: I think "My God, it's full of stars!" is not a quote from 2001 (where I'm fairly sure there's no broadcast dialoguge at all after Hal is silenced), but from the sequal, 2010, in the part where they 'review' the final recordings of the 2001 mission. But I really need someone who has these two films at hand to check before amending the explanation.

(Oh, go on then. Can I nominate Ada as the most godawful 'proper' language? Not as awkward as COBOL can be (for a proper programmer who doesn't need the "Business Orientated" tendencies), but has just the right (or wrong) mix of strictness to get my back up even while maintaining a pretence of being readable. Mind you, it's 20 years since I've used it, so memories about it may be distorted or outdated.) 178.98.31.27 21:50, 21 June 2013 (UTC)

Java is much more elegant and far less hacky than C++, and it's much faster than some people like to admit. It amazes me how many people complain about how "slow" it is, but have nothing but praise for languages like Python. Of course, C++ is much easier to optimize where time is critical. </minirant> 72.9.93.56 13:59, 3 August 2013 (UTC)

There is a direct reference to the "Lisp epiphany" that many non-LISP programmers are said to experience upon realizing how heavily influenced LISP was by mathematical logic. This is explained far better in a later explanation. It could be brought in here. --Quicksilver (talk) 03:37, 24 August 2013 (UTC)


I don't know whether it's important or not, but the line "My God, it's full of stars!" is the title of a chapter in The Little Schemer, which is considered (IMO) a classic CompSci book. If Randall has, by chance, read the book he may have also pulled the inspiration from there as well as 2001. I don't know whetiher this warrents a trivia block or not. 67.176.146.186 06:34, 27 October 2013 (UTC)

the quote comes from the book, not the movie. 173.245.53.129 (talk) (please sign your comments with ~~~~)

Lisp is the best language, unfortunately it's not that widely used.

Lisp is a high and low level language.

The worst programming language ever has to be Kodu game lab. Or possibly Malbodge. 141.101.98.244 (talk) (please sign your comments with ~~~~)

Perl is the language designed for the convenience of use. It mimics the natural language in the sense that it has great many slightly different features but each feature makes the most sense for its intended use and allows to write the easily understandable programs. An example of opposite is Pascal, which is a tiny language (i.e. "elegant" in the terms of its creator) but you can't do may things with it at all, and for what you can do, you have to turn yourself inside out. Lisp started in 1950s kind of like Pascal but then collected great many different features over time, each one to fix some of its inborn limitations. You still have to turn yourself inside out when you write in Lisp but nowadays there are great many ways to do so. If you wonder, Pascal had been extended as well, and Delphi is an example of an overgrown Pascal. 108.162.246.5 21:56, 29 January 2014 (UTC)

About the 2001 quote... I have the October 1968 Arrow paperback edition (09 001530 4) by A.C.Clarke and on page 221 Dave Bowman remarks "The thing's hollow - it goes on for ever - and - oh my God - it's full of stars!". So yes, in the movie this line was never used but in Clarke's novelization of his and Kubrick's screenplay it's there. Fast forward to 1984 with the release of 2010 and the filmmakers decided to put this soundbite in the intro to good effect. So yes it was never in the 2001 movie and was in the 2010 movie but as aforementioned, it was in the 2001 book. Squirreltape (talk) 20:18, 25 February 2014 (UTC)


I believe that the "ostensibly, yes" refers to Greenspun's tenth rule so I added this to the explanation. A complete set of rules for the universe is complex enough for the rule to apply. Meneldal (talk) 04:52, 11 March 2015 (UTC)meneldal


Remeber, one day we must all go through those Perly gates. 173.245.54.254 16:25, 9 June 2016 (UTC)

On the subject of the Universe's implementation language: http://www.songworm.com/lyrics/songworm-parody/EternalFlame.html Chrullrich (talk) 15:30, 26 February 2018 (UTC)

Does anyone think this could be related? https://goblinrefuge.com/mediagoblin/u/emacsomancer/m/my-god-it-s-full-of-car-s-png/ 172.69.42.45 02:34, 14 September 2020 (UTC)