Live data from Hacker News

The Nature of Lisp (2006)

defmacro.org

51–60 of 95 posts

Re: The Nature of Lisp (2006)

#51
post #37
post #35

Earlier quoted context omitted.

FIRST and REST as names for list operations have been added 40 years ago. Pattern destructuring and list templates are as old. Naming is important, but the core Lisp names can be learned in a day.

Yes, and yet the names Cons and Cdr still exist and come up in introductory documentation and are still used in discussions constantly -- why?

Because introductory material tends to live long.

It is also used for non-list data structures.

Sometimes in CS education Lisp is/was used to teach new stuff, making sure that students were challenged beyond their comfort zones, for example by reinventing the basic machineries from a few abstract principles. Typically Lisp was not used as a programming language, but as a device to teach new ways to think about computation: algorithms, some basic data structures, control structures, functional programming, ... Today you'll see other langages in CS education, with other goals.

See SICP and others...

Re: The Nature of Lisp (2006)

#52
post #37
post #35

Earlier quoted context omitted.

FIRST and REST as names for list operations have been added 40 years ago. Pattern destructuring and list templates are as old. Naming is important, but the core Lisp names can be learned in a day.

Yes, and yet the names Cons and Cdr still exist and come up in introductory documentation and are still used in discussions constantly -- why?

Because people like bikeshedding. Cons is a little bit weird, but it is par with C's "typedef", it could have been named better.

car and cdr are weirder, but there are reasons people use them over first and rest: 1- they are shorter and 2- they can be combined (caadr, cadr, cddr, instead for (first (rest x)) etc).

It is still bikeshedding. You learn that stuff in less time than what it takes to create an angry post.

And if you really hate them, you don't have to use them. Just define a macro and you can stop complaining. Your coworkers may not like this though.

Re: The Nature of Lisp (2006)

#53

Earlier quoted context omitted.

Some lisps use parenthesis and brackets interchangeably. Some people prefer to strategically alternate them, but you're free to use them exclusively. Guile Scheme, for example: scheme@(guile-user)> [list 1 2 3] $1 = (1 2 3) scheme@(guile-user)> (list 1 2 3) $2 = (1 2 3) scheme@(guile-user)> [car '[1 2 3]] $3 = 1

While true, this is not officially supported as part of the RnRS standard I believe. They set these characters aside as reserved for future use.

I think this depends on which RnRS you look at.

Re: The Nature of Lisp (2006)

#54
Am I the only one who finds it hilarious that there are complaints about Lisp syntax, when the language itself is almost infinitely modifiable?

You can replace parens with reader macros. You can replace built in names with ordinary macros(in some dialects, even reassign the built-in functions altogether). Don't like the let syntax? Modify it yourself to something completely different.

You could modify Lisp to look like json if you were so inclined.

You have access to the compiler at compile time and runtime. Do whatever you want.

If anything, people should be complaining about other languages that don't allow for syntax modification. Want to not type semicolons in C? You are essentially out of luck, unless you want to make your own preprocessor (I don't think the standard one has enough expressive power to do so, but I'd love to be proved wrong).

Complaining about parentheses takes zero effort though. You don't have to spend a single second trying to understand why it looks weird like that...

Re: The Nature of Lisp (2006)

#55
post #46
post #21

Earlier quoted context omitted.

I can handle parentheses. What really gets me? Semicolons. Most useless character in programming language history. Every time I switch from a language that doesn't require them to one that does, the pirates run away from me.

> the pirates run away from me Nice expression. Is it a pop culture reference I have missed?

I suspect (but do not know) that the reference is "swearing like a pirate". BeetleB is (I think) saying that semicolons lead to swearing that even the pirates are offended/appalled. (It took me reading it a few times to get that, and I'm still not certain it's right.)

Re: The Nature of Lisp (2006)

#56
post #2

"Why on Earth would anyone want to use a language with such horrific syntax?!" What is it with statements like this? It just sounds like a 'meme' to me, that everyone hears (even from advocates like this one) at first that the 'syntax' (of which there is a lot less than most languages in a Lisp) is 'horrible'? Of course, we, the learn-ed of Lisp, say that after a while the 'parens just disappear', which they don't, b…

> but please, advocates and enemies of Lisp, just give up on picking on the parens

Each non-lisper will reinvent the argument from scratch, so advocates can't profitably ignore it. It's a shame. You get past that so quickly after using lisp.

Re: The Nature of Lisp (2006)

#57
post #21
post #2

"Why on Earth would anyone want to use a language with such horrific syntax?!" What is it with statements like this? It just sounds like a 'meme' to me, that everyone hears (even from advocates like this one) at first that the 'syntax' (of which there is a lot less than most languages in a Lisp) is 'horrible'? Of course, we, the learn-ed of Lisp, say that after a while the 'parens just disappear', which they don't, b…

I can handle parentheses. What really gets me? Semicolons. Most useless character in programming language history. Every time I switch from a language that doesn't require them to one that does, the pirates run away from me.

Well, what are the options for detecting the end of a statement? You can have a language where all possible statements are clear about where the end is from just the statement alone. You can have a language where each statement has to be on a separate line, and only on one line (or where you specially mark a continuation of a statement from the previous line). Or you can have a termination marker. As far as I can tell, that's pretty much the list of possible options.

Note that Lisp has taken the first approach: It's clear (by closing the opening paren) when you're done with a statement.

Re: The Nature of Lisp (2006)

#58

Am I the only one who finds it hilarious that there are complaints about Lisp syntax, when the language itself is almost infinitely modifiable? You can replace parens with reader macros. You can replace built in names with ordinary macros(in some dialects, even reassign the built-in functions altogether). Don't like the let syntax? Modify it yourself to something completely different. You could modify Lisp to look li…

I'm a lisp fan, but to be fair, I don't think I know anybody who wants to live in a world in which everybody has created their own personal language syntax. Reader macros should be used very judiciously unless you don't care about anybody else being able to understand your code.

Re: The Nature of Lisp (2006)

#59

Am I the only one who finds it hilarious that there are complaints about Lisp syntax, when the language itself is almost infinitely modifiable? You can replace parens with reader macros. You can replace built in names with ordinary macros(in some dialects, even reassign the built-in functions altogether). Don't like the let syntax? Modify it yourself to something completely different. You could modify Lisp to look li…

I'm a lisp fan, but to be fair, I don't think I know anybody who wants to live in a world in which everybody has created their own personal language syntax. Reader macros should be used very judiciously unless you don't care about anybody else being able to understand your code.

I agree.

But if you care that strongly, you can do something about it.

(I am also kind of hoping that, by the time one gets to reader macros, they will be experienced enough, and will understand why the parentheses exist so that they will no longer care about them)

Re: The Nature of Lisp (2006)

#60
Back in 2009, when I first learned Common Lisp, I had the hope Lisp would one day become mainstream. Then in 2012 I had the same hope for Scala.

... I got older and I'm not anymore a dreamer

Legacy code and imperative thinking is heavy.

Post reply on HN