Live data from Hacker News

CL21: An experimental project redesigning Common Lisp

cl21.org

41–50 of 102 posts

Re: CL21: An experimental project redesigning Common Lisp

#41
post #24
post #12

Earlier quoted context omitted.

Things that made perfect sense in the 1970s, are not set in stone for all time.

In the case of Lisp those things, from the 1950s to the 1990s, have rationales. Updating the names to 2010s fashions just means we'll have something that people can't understand in the 2020s and that they can't check the history of.

So in 2020 people will have forgotten the etymology of print or format, rendering them nearly meaningless while princ, car and cdr endure?

That's rhetorical, you don't need to reply.

Re: CL21: An experimental project redesigning Common Lisp

#42
post #31

Earlier quoted context omitted.

This. Arguing that Common Lisp sucks because the names of functions are not sufficiently python/C/Algol-like is like arguing Chinese languages are never going to become widely accepted because they aren't sufficiently like European languages. People who argue against car/cdr are the same people who will blindly accept printf, strlen, scanf (wtf?), __le__, zip. They accept those names because they actually learned the…

No one is arguing that CL sucks, but that if you are going to re-skin the whole thing with learnings from modern languages, with features like string interpolation, then you might as well make the function names more intuitive while you are at it. The specific example is talking about doing away with the format function in favor of the princ function. What is the argument against calling it print? No one is suggestin…

> What is the argument against calling it print? No one is suggesting fprintf by the way.

Very simple, actually. You know the term REPL, right? It stands for Read-Eval-Print Loop, and originates with Lisp. Actually, every Lisp gives you read, eval and print functions which work closely together. In particular, you expect read to be able to understand what print outputs, because they work in a loop.

So print is already taken. As for other prin* functions, see here: http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec....

There is a good rationale behind those names.

And no one uses princ for interpolated string output anyway.

As for your code, things like princ or while-let1 are more-less equivalent of @, |sth|, ?, etc. in your code - i.e. there are some basics you have to learn with every language.

> Back to the subject at hand, the case being made here is that most modern languages choose things a bit easier for the brain to parse; they aren't overly shortened, they aren't Hungarian notation, etc.

Well, you don't get closer to that goal than with Lisp and the majority of its naming conventions. From make-instance to destructuring-bind to multiple-value-bind to update-instance-for-redefined-class, most of the things are named pretty well and readable for a programming language.

I can't help but see these arguments about "intuitive names" as finding just another excuse not to learn something new.

Re: CL21: An experimental project redesigning Common Lisp

#43
post #22

Earlier quoted context omitted.

As odd as it may seem, I ended up prefering car/cdr over anything else (except when access to pattern matching and destructuring). I know first/rest, head/tail or even fst/snd are clearer names, but car/cdr ended up as symbols having precisely this meaning in LISP idioms (recursion over cons-cell based lists). My 1.5cents

As a non-Lisper, I can assure you beyond a shadow of a doubt that having "car" & "cdr" show up in the first few sections of a tutorial is not something that wins people over to Lisp. I don't mean that I don't understand it. I even know they come from assembler instruction names. And they still look weird to me and still have no meaning despite having read what the abbreviation expands to three or four times. You'd be…

I know and agree, but they have some weird syntactic/linguistic quality:

  - both 3 letters each
  - only differ by 1 letter a|d
None of the alternatives have these symmetry, and it (very subjectively) shows in the code.

Re: CL21: An experimental project redesigning Common Lisp

#44
post #24

Earlier quoted context omitted.

In the case of Lisp those things, from the 1950s to the 1990s, have rationales. Updating the names to 2010s fashions just means we'll have something that people can't understand in the 2020s and that they can't check the history of.

So in 2020 people will have forgotten the etymology of print or format, rendering them nearly meaningless while princ, car and cdr endure? That's rhetorical, you don't need to reply.

So you think we're better off just giving up on a perfectly good reason for these naming conventions and call "princ" "print" just because some poor language without the concept of Read-Eval-Print Loop named its function that way and then everyone else blindly followed?

Seriously, Lisp has long history and had half the "new amazing features of today" 30 years ago. There is a rationale for naming conventions. Just because you're free to call a string-spitting function "print" in Ruby or Pascal or whatever doesn't mean you can do it in a language with a proper REPL.

Re: CL21: An experimental project redesigning Common Lisp

#45

One of the things I don't like about Common Lisp is the unusual names. Just on the basis of the linked page, CL21 doesn't fix that. Take princ #"Hello, ${name}\n". Why not just use print like the rest of the programming world. Okay, some languages use writeln, etc. But princ? Why not print? A little further down, we see while-let1. Why the number? If you want to call it "Common Lisp in the 21st Century" you need to c…

Common Lisp has several "print" functions.See: http://www.lispworks.com/documentation/HyperSpec/Body/f_wr_p...

Re: CL21: An experimental project redesigning Common Lisp

#46

One of the things I don't like about Common Lisp is the unusual names. Just on the basis of the linked page, CL21 doesn't fix that. Take princ #"Hello, ${name}\n". Why not just use print like the rest of the programming world. Okay, some languages use writeln, etc. But princ? Why not print? A little further down, we see while-let1. Why the number? If you want to call it "Common Lisp in the 21st Century" you need to c…

As odd as it may seem, I ended up prefering car/cdr over anything else (except when access to pattern matching and destructuring). I know first/rest, head/tail or even fst/snd are clearer names, but car/cdr ended up as symbols having precisely this meaning in LISP idioms (recursion over cons-cell based lists). My 1.5cents

Yeah, I like car/cdr very much and use them where appropiate because of semantics. Indeed, car/cdr doesn't mean the same as first/rest or head/tail. E.g. head/tail makes sense only if you're talking about lists. But cons-cells can be used to compose different types of data structures.

As funny as it is, people whining about "car/cdr" and saying "language X did it better because it called them first/last, or head/tail" don't realize that it's the language X that lacks semantics to express anything else than lists using cons cells.

Re: CL21: An experimental project redesigning Common Lisp

#47
post #27
post #22

Earlier quoted context omitted.

As a non-Lisper, I can assure you beyond a shadow of a doubt that having "car" & "cdr" show up in the first few sections of a tutorial is not something that wins people over to Lisp. I don't mean that I don't understand it. I even know they come from assembler instruction names. And they still look weird to me and still have no meaning despite having read what the abbreviation expands to three or four times. You'd be…

Huh. I like the distinction of car/cdr meaning pointers vs first/rest meaning "start of list/rest of list". It weirded me out at first, but I came to really appreciate it.

Indeed. It lets you clearly express in code that those cons cells are actually part of a different structure than a list.

Re: CL21: An experimental project redesigning Common Lisp

#48

Earlier quoted context omitted.

No one is arguing that CL sucks, but that if you are going to re-skin the whole thing with learnings from modern languages, with features like string interpolation, then you might as well make the function names more intuitive while you are at it. The specific example is talking about doing away with the format function in favor of the princ function. What is the argument against calling it print? No one is suggestin…

> What is the argument against calling it print? No one is suggesting fprintf by the way. Very simple, actually. You know the term REPL, right? It stands for Read-Eval-Print Loop, and originates with Lisp. Actually, every Lisp gives you read, eval and print functions which work closely together. In particular, you expect read to be able to understand what print outputs, because they work in a loop. So print is alread…

> You know the term REPL, right?

Yes, and notice how it doesn't stand for Rrepl-Evl-Princ Loop.

> There is a good rationale behind those names.

No, there is a good rationale for having separate functions, there is no logical rationale for prin1, princ and pprint.

Let's take "prin1 produces output suitable for input to read." from the link you provided. Since we are redesigning the language anyway, let's call that evalable-print or readable-print, or anything else in the world that semantically captures it's meaning. Because when you have a language with hundreds of obtusely named library functions it requires an unnecessary amount of cognitive load added to the already taxing act of programming. Functions that are easier to remember are directly related to code that is easier to read and understand.

Re: CL21: An experimental project redesigning Common Lisp

#49

Earlier quoted context omitted.

So in 2020 people will have forgotten the etymology of print or format, rendering them nearly meaningless while princ, car and cdr endure? That's rhetorical, you don't need to reply.

So you think we're better off just giving up on a perfectly good reason for these naming conventions and call "princ" "print" just because some poor language without the concept of Read-Eval-Print Loop named its function that way and then everyone else blindly followed? Seriously, Lisp has long history and had half the "new amazing features of today" 30 years ago. There is a rationale for naming conventions. Just bec…

Yes. Of course I wouldn't characterize it as blindly following so much as being able to rationally step back with some perspective and identify some trends as positive.

Lisps are a beautiful and powerful family of languages, but you are conflating the implementation with the idea. The names of functions from 30 years ago are not what makes Lisp special.

Re: CL21: An experimental project redesigning Common Lisp

#50
Three things I don't like about Common Lisp.

1. It has CLOS but it doesn't really embrace it in standard library. You have list, vector, hash-table, each with its own iterator function. You have lots of #with-xxx macro. All modern languages utilize the idea of common interface like #iterator or #dispoable. You can clearly see CLOS library and pre-CLOS library in CL. CL needs to eat its own dog food (CLOS) more.

2. It lacks basic practical API library, while another containing big complicate academic functions. Its #format function is probably Turing complete. It has function to format number in Roman numeral. But it doesn't have function to deal with datetime. No networking IO function. No Threading library.

3. Condition and Restart could take the idea from Dylan. Tying condition to available restarts, and making class hierarchy of them, is a better idea. This problem stems from CL not actually utilizing CLOS.

Also, PACKAGE should take the idea of LOCALE, allowing easier local package rename, and less symbol conflicts problem.

Post reply on HN