The strange thing about Erik is that he was sweet, gentle and helpful in person. I spent a fair amount of time with him, and never once saw any of the behavior he was famous for on usenet.
He was highly intelligent but he had an odd childhood and was somewhat isolated socially, in the real world. It’s what ultimately killed him. At least outside of tech. Near the end he was almost a cult-like figure, at conferences especially. He would accumulate a hoard of fans. I’m unsure if he liked that.
He really loved coming to the Bay Area.
I definitely miss him irl.
Sorry for the ramblings. I’m on mobile and editing is hard.
The original discussion is here: https://groups.google.com/g/comp.lang.lisp/c/T_Tozq2P53I/m/N...
I found it intriguing that the original post there claims that
(cons (list 1 2) (list 3 4))
intuitively seems to have the length 2 whereas the correct length is 3. I find 3 more intuitive though. It could be because right from my early days of learning various Lisps, I learnt about lists in terms of cons cells.There are many ways to explain this, such as by drawing diagrams of the cons cells from first principles, printing out each cons and list on a REPL and confirming the equivalences, etc. Here's one that happens to be my take on it. I'll be (ab)using the equals sign (=) to mean that the expression on the LHS and the one on the RHS are equivalent.
First let us build a list of three items using cons cells:
(cons 4 nil) = (list 4)
(cons 3 (cons 4 nil)) = (list 3 4) [1]
(cons 'x (cons 3 (cons 4 nil))) = (list 'x 3 4) [2]
Now let us build a list of two items using cons cells: (cons 1 nil) = (list 1)
(cons 1 (cons 2 nil)) = (list 1 2) [3]
Now substituting LHS and RHS of [3] into 'x in LHS and RHS of [2], respectively, we get (cons (cons 1 (cons 2 nil)) (cons 3 (cons 4 nil))) = (list (list 1 2) 3 4)
Simplifying the LHS above using [3] and [1], we get (cons (list 1 2) (list 3 4)) = (list (list 1 2) 3 4)
Clearly, the length of RHS is 3.From the REPL:
CL-USER> (cons (list 1 2) (list 3 4))
((1 2) 3 4)
CL-USER> (list (list 1 2) 3 4)
((1 2) 3 4)
CL-USER> (length (cons (list 1 2) (list 3 4)))
3
CL-USER> (length (list (list 1 2) 3 4))
3
CL-USER>
Also, on Emacs: ELISP> (cons (list 1 2) (list 3 4))
((1 2)
3 4)
ELISP> (list (list 1 2) 3 4)
((1 2)
3 4)
ELISP> (length (cons (list 1 2) (list 3 4)))
3 (#o3, #x3, ?\C-c)
ELISP> (length (list (list 1 2) 3 4))
3 (#o3, #x3, ?\C-c)
ELISP>
See also: https://gigamonkeys.com/book/they-called-it-lisp-for-a-reaso...Ah a Naggum re-discovery.
See a yearly index here: https://www.xach.com/naggum/articles/
I went through the whole thing a few years ago, there are some gems hidden in there.
Anybody interested in efficient list (and other data structures, but mostly lists) implementation will probably find the VList approach interesting (relevant paper archived at https://trout.me.uk/lisp/vlist.pdf)
[post] tl;dr
A ( linked ) list is a collection of CONS ( Construct ) cells.
A CONS cells can extract, via the commands:
‘car’ ( Contents of Address Register ) - the payload ( data item in list );
‘cdr’ ( Contents of Decrement Register ) - the link ( to the next list item, e.g. CONS cell )
The names are for historical reasons ( using two halves of a single register ) lost in the beards of yore.
The linked list appears simple, this belies the fact of its exquisite perfection and the great thought that went into inventing, perfecting and implementing it.
“[The ‘list’ command]… creates a series of conses and sets the CAR pointers to point to each argument. which you have provided. (LIST (LIST 1 2) (LIST 3 4)) => ((1 2) (3 4))
This doesn't come across as "caustic" as when I previously read it. And the "bile" isn't directed so much at Lee as it is at something he wrote; "All in all, the pairs notion is redundant."
Naggum genuinely seems to be hoping that his long and thorough explanation will convince Lee of his point of view, and not as a put down.
> I hope you understand and appreciate what I have written above so the following does not apply to you anymore.
The "following" where he goes off on what Lee wrote, but not on Lee himself.
It might be worth it for me to re-read Naggum's posts, now that I have a better understanding of where he was coming from.
Not caustic? "Short-sighted users", "stupid language designers who believe too strongly in strong typing", "certainly can't be bothered to invent a useful concept for their short-sighted programmers", "dumb people who implement something the simple way, so it becomes complex and generally useless to everybody else", "unlike today's braindamaged CPU's", "just look at what C programmers do when they need lists! shudder".
Sure, you may believe that LISP is the greatest invention since the sliced bread, and everything went downhill after that but even if you are correct — that's still just, like, your opinion, man.
I wrote "not *as* caustic" ... in particular, he wasn't being caustic toward Lee, but rather to the idea of cons pairs being redundant.
It's enough of distinction to make me think I should re-examine what Naggum had to say - in this and in other posts - and not get caught up in any pre-conceived notions I might have had about him.
Unfortunately, from my experience, Xah Lee is someone who will ignore information from others if it requires to correct what he wrote/spoke, especially when he claims something authoritatively when in reality he has no in-depth, if any, information on the subject
He does have a tendency to write off people as “fanatics”.
They're also the original and simplest persistent data structures https://en.wikipedia.org/wiki/Persistent_data_structure
What criteria do you use to judge those two properties?
comp.lang.lisp was one of the meatier parts of Usenet I read.
https://groups.google.com/g/comp.lang.lisp/c/T_Tozq2P53I/m/N...
The full conversation.
Well, shit. Educational, but filled with bile. This post is an example of how to go wrong and make yourself and everyone around you unhappy, while still being right.
That was Naggum's trademark: Extremely good explanations coupled with zero tolerance for fools. As long as you asked him a question in good faith, he treated you with courtesy. But I confess I relished the entertainment of reading his deconstructions of bad-faith actors.
Naggum died much too young. I hope he has found peace.
It’s been a while since I’ve seen those photos on the wikipedia page, which I took. He was very photogenic. He came to Berkeley for a Lisp conference. Brings back some really good memories. Thanks.
I met him (and McCarthy too) at that conference. Can't believe it's been 25 years.
I think the issue is distinguishing between bad faith and simple ignorance.
You catch more flies with honey than vinegar!
I can't stand this style of writing. I especially dislike it when I catch myself doing it.
It's not necessarily because of the negativity. It's mostly just because people who write like this take forever to get to their point.
He's responding to Xah Lee, well known to be one of the most abrasive and unpleasant people in the lisp community. The hostility might not be desired but it was certainly earned.
Xah Lee wasn't a part of the Lisp community. He was a Usenet troll, active in several programming related newsgroups, not just comp.lang.lisp. He had never written a line of Lisp (or anything more challenging) and never contributed anything, during his Usenet times. His effect on these newsgroups was extremely negative. Discussing with him was useless. Erik Naggum tried and failed (as others did). Erik was a part of the Lisp community, but unfortunately also with negative behavior, especially on comp.lang.lisp. He could write long&useful explanations, but discussions with him were often not pleasant.
It doesn't look like Xah was really trolling here, most of his responses are pretty polite. And he seems to indicate at this point in time he wasn't really familiar with lisp, so I'd venture to guess he wasn't nearly as prominent as he later became.
You may be correct; I generally enjoy not thinking about Xah Lee so I might not have the correct context for TFA's point in time
Xah has talent for speaking out of his ass in polite and knowledgeable sounding way
the original LLM
It was Erik Naggum replying to Xah Lee, so you had two of the most abrasive and unpleasant people in the lisp community interacting.
Brings back unhappy memories of the conversation style in Usenet. I didn't dare to use newsgroups after I asked some wrong thing as a 15-year-old in some computing-related group and got dumped on by angry adult men.
I get it that they were frustrated by Eternal September and whatever. But thinking back to those times makes me appreciate the moderation culture that dang has created here, as well as the non-linear structure that moves less popular comments out of the way of attention.
It is possible for your brain to parse information from people you don't have a personal connection with as what the message is and skip the how. Not sure why people get lit up by the how; who cares about that from people you don't give a toss about? These days you have AI for it; Claude can give you a lovely summary of the facts without the how. My brain does that automatically since I was in high school. Comments from anyone but close friends or close relatives cannot make me 'unhappy', no matter what they are.
This is getting out of hand, "feelings over facts" kinda thing these days, people are unable to deal with petty "insults", etc.
He made it a kind of game or culture. Also iiuc he's answering to a certain person who was known to be regularly walking on the line of trolling. That might have added more fuel to the fire.
Erik Naggum (RIP) was particularly noted for having lots of bile if you got on the wrong side of him.
Xah Lee is noted for being especially abrasive and pretty much gets on the wrong side of everybody.
Putting the two together was always a spectacle worth a bucket or two of popcorn.
And, the real answer to "Why cons cells?" is the same reason as "What is up with the names car and cdr?". The only two data structures which are cheap enough (in both RAM and CPU) for the machines of the time (IBM 704 from 1954!) to deal with are arrays (via index registers) and pairs (via register sections which gives us car/cdr).
I'd rather an Erik Naggum than milquetoast passive aggressiveness. If you're going to be a dick, at least be up front with it.
Or, just don't be a dick, full stop.
Erik Naggum's writings were pretty influential on me as a young programmer, and there's still some value in this piece, but nowadays I find a lot of this insufferable. Yes, it's not actually easy to implement lists, and there's semantic value to Common Lisp's implementation. But...
1. You can't tout the benefits of constant time appending to the beginning of a list while ignoring the benefits of constant time lookup and modification within the list. And before anyone starts talking about "but most programs don't need random access because you just traverse the list"--yes, and vectors do that better too because of cache locality. Cache-aware implementations of Lisps are still an order of magnitude slower than vectors for traversals because dereferencing the cdr pointer is obligatory. If you start talking about speed being a benefit of Lisp in comparison to C (a comparison which Naggum introduces later here), you've lost the plot.
2. Nostalgia for an architecture that no longer existed even in 1998 when this was written is poor reasoning for opaque names. "car" and "cdr" aren't good names. It kind of doesn't matter much: once you learn them it's fine, but it is a slight barrier to Lisp's success, as it does present yet another small challenge for beginning Lisp programmers.
3. In general, the ragging on Scheme is rather pointless--I found my way to Lisp via Scheme. And a large part of why I ended up back in Scheme land (well, Racket by that point) was that it became clear to me that the Scheme community benefits from ideas learned in Common Lisp, while Common Lisp often (not always) rejects NIH ideas.
It would be trivial to replace car and cdr in your code with any other symbol names you like. Even the Common Lisp standard supplies alternatives (first, rest). If this was not done, it was because people using lisp didn't see any great value in doing it.
Your point and the grandparent's point are not contradictory. 'car' and 'cdr' can be opaque pieces of jargon that make the language slightly but noticeably more difficult for new learners, and they also can be standard pieces of jargon that current users would find no value in changing.
In that way, it's a bit like indentation in Python.
Lisp has had vectors as well as lists for a long time. If you want a vector then use a vector.
> And before anyone starts talking about "but most programs don't need random access because you just traverse the list"--yes, and vectors do that better too because of cache locality.
Valid, though at the time (even 1998!) caches were less critical for performance than they are now, because the gap between processing speed and main memory speed was smaller. In fact, on the machines where Lisp originated, there was no cache.