On 'nil`, `[]` and the truth - a historic perspective

functional

#1

The Evolution of Lisp is a fascinating read if you like languages (its a paper I picked up, I think, from the members of the Elixir slack).

Page 37 (its a PDF) has a great overview of the early discussions on nil, [] and true/false. Worth a read to understand some of the design decisions in many languages. Short quote:

Almost since the beginning􏰌 Lisp has used the symbol nil as the distinguished object that indi􏰍cates the end of a list 􏰉and which is therefore itself the empty list􏰊􏰛. This same object also serves as the false value returned by predicates.􏰎 McCarthy has commented that these decisions were made 􏰟rather lightheartedly􏰆 and 􏰟later proved unfortunate.􏰎􏰆

Furthermore􏰌 the earliest implementations established a tradition of using the zero address as the representation of NIL􏰛 McCarthy also commented that 􏰟besides encouraging pornographic programming􏰌 giving a special interpretation to the address has caused difficulties in all subsequent implementations􏰆 􏰞[McCarthy􏰌 􏰑􏰙􏰗􏰘􏰠􏰎1978]

Also interesting is a paper from 1989 called Prolog vs Lisp which is interesting for at least two reasons:

  • Prolog was used for the first implementation of Erlang and the lispish characteristics continue through to Elixir today as well

  • The debate about benchmarking and performance is hardly a new one - and this paper does a good job of summarising the broader challenges of language selection


#2

Thanks for the links to the papers. I always find these historical things quite interesting and fascinating. :+1: