Hacker News new | ask | show | jobs
by lngnmn 3225 days ago
I really don't get the lispm's answer about cl21. What are the hidden treasures of the genuine Common Lisp we are ignorant of?

In my humble opinion Common Lisp is the classic example of the kitchen sink syndrome, where many pieces taken from various dialects were put together in a hurry. The results is not that bad (like, say, C++) but we know, arguably, a much more refined versions of Lisp, such as the dialect from Symbolics and Arc.

So, honestly, what are these hidden gems?

cl21, it seems, was an attempt to unify some syntactic forms rather than re-define what a Common Lisp is or should be. In that respect it is very remarkable effort. It is also a package - don't use if don't like.

The fair point that Common Lisp is a truly multi-paradigm language, so it includes mutating primitives alongside with "pure" functions and supports lexical and dynamic scooping, is rather difficult to grasp, but there is a lot of possibilities at the level of syntactic forms and embedded specialized DSLs, which, arguably, is what makes a Lisp Lisp.

It is never too much of embedded DSLs and syntactic sugar.

2 comments

> What are the hidden treasures of the genuine Common Lisp we are ignorant of?

Actually Common Lisp is in many places a very well documented and designed language. Other languages have copied its numeric tower, its macros, its object-system, its error handling, ...

>In my humble opinion Common Lisp is the classic example of the kitchen sink syndrome, where many pieces taken from various dialects were put together in a hurry

The 'hurry' took place from 1981 (when the work on Common Lisp started) until 1994 when the ANSI CL standard finally was published. 13 years where hundred+ persons helped to design the language and provided comments, improvements, designs, prototypical implementations, alternative designs, ...

Also the 'various dialects' were mainly only Maclisp successors and Common Lisp was designed to be successor to them, not a summary of various dialects.

CL21 has more problems than lines of code, including security problems. As an experiment, fine. As a library that should be used? Please don't.

Edit: this thread gives a bit more detail discussing a COERCE method of CL21:

https://www.reddit.com/r/lisp/comments/6snw5d/questions_for_...

I think that a future Common Lisp could profitably default to lower-case instead of upper-case, and unify argument order. It probably shouldn't default to generic functions due to the performance implications. It could more-fully specify pathnames for current platforms. It could specify something like Go's channels & goroutines.

None of that's probably worth the bother of a new spec.

CL21 was, as you note, an interesting experiment, but I wouldn't run with it.

I remember reading the Symbolics manuals from bitsavers and how I have been impressed by clarity and unity of the language, and how they incorporated CL into Zetalisp just by moving their own stuff into packages.

At least in the documentation everything looks wonderful. Compared to Symbolics CL looks like a mess at least from reading the books.

> Compared to Symbolics CL looks like a mess at least from reading the books.

Which books, may I know?

The Common Lisp Hyperspec is one of the best reference manuals for a programming language, ever. But it is not a tutorial nor a how-to guide!

Try "Pratical Common Lisp". Or "Land of Lisp" if you want to have lots of fun.

simple but refined, guaranteed to blow your mind...

https://youtu.be/HM1Zb3xmvMc

> Which books

Symbolics Common Lisp - Language Concepts (volume 2A)

It also covers parts of Zetalisp.

I am also big fan of pg's On Lisp and ANSI Common Lisp.

That does not make sense to me. Common Lisp provided lots of improvements over Zetalisp.
The major goal of Common Lisp was commonality, and that means incorporating forms from various dialects into one and to maintain compatibility, like you said. That goal has been accomplished.

I think that carefully designed dialects with emphasis on right principles and attention to details leading by people like David Moon would be aesthetically better than a good kitchen sink. It is no coincidence that Common Lisp took most of stuff from Zetalisp, according to CLtL2.

I think it is a general heuristic that a small group of disciplined devoties would produce better artifact than an vast assembly of... general public or passionate and productive but ignorant individual. Think of Python3 vs Ruby, Go vs early C++ or Scheme vs CL. Attention to details and perfectionism works - look at Haskell syntax and prelude. (All this just to illustrate validity of my heuristic).

> The major goal of Common Lisp was commonality, and that means incorporating forms from various dialects into one and to maintain compatibility, like you said. That goal has been accomplished.

That's misleading. The 'various dialects' were mostly three very similar successor implementations of Maclisp.

Common Lisp was designed as a single successor language to Maclisp. There were successors of Maclisp for different computers under development: NIL (on a super computer and the VAX), Spice Lisp (for a new breed of workstations), Lisp Machine Lisp (developed for MIT's Lisp Machine systems), ... We are talking about new implementations of basically very similar languages, with Lisp Machine Lisp as the major influence.

DARPA wanted that these and future successor implementations stayed compatible. Not every Lisp application for the military should come with its own incompatible implementation of the language. NIL then looked a lot like CL. Spice Lisp evolved into CMUCL. Lisp Machines then got a CL implementation integrated with Lisp Machine Lisp.

From CLTL:

> Common Lisp originated in an attempt to focus the work of several implementation groups, each of which was constructing successor implementations of MacLisp for different computers.

Common Lisp was not designed to be compatible with other Lisp dialects like Interlisp, Scheme, Standard Lisp, ...

You are right - Common Dialect of MacLisp Successors. Thank you!
> In my humble opinion Common Lisp is the classic example of the kitchen sink syndrome, where many pieces taken from various dialects were put together in a hurry.

Can you give a particular example?

I have read many times about people speaking about the amount of "cruft" that was left into Common Lisp, but frankly i've yet to find any cruft. Some people use as an example the fact that there is "CAR " and "CDR", but in this particular topic:

1) you could use "first" and "rest" if you wnat, instead of "car" and "cdr" 2) Using "car" and "cdr" is good because it shows that you are explicitely wanting to modify cons cells; 3) "car" and "cdr" is to Lisp what "*" is to C; that is, part of the charm!!

Its mostly about inconsistent naming, order of arguments and standard idioms. Obviously most of these are historical artifacts, like nconc and friends or the primitives for working with hash-tables.

Car and cdr are small miracles because they give us of caddr or caadr and friends. It is beautiful accident which should be appreciated and preserved.

> Its mostly about inconsistent naming, order of arguments

Do you have some examples of inconsistent order of arguments? I'm not really doubting you, I just can't think of any examples.

One of the goals of Common Lisp was backwarts compatibility. The stuff from McCarthy's Lisp is mostly present in Maclisp, Zetalisp and Common Lisp. That's why they are Lisp languages. Every language existing for a longer period of time accumulates different design approaches. A language purist may complain, but a programmer will get his stuff ported and will get work done.