←back to thread

Hofstadter on Lisp (1983)

(gist.github.com)
372 points Eric_WVGG | 5 comments | | HN request time: 0s | source
Show context
analog31 ◴[] No.41864347[source]
I read that article when it came out, as my parents subscribed to Scientific American. Even though I had learned BASIC and Pascal, the concepts in the article were just way over my head. Also, I had no access (that I was aware of at least) to a machine where I could try my hand at Lisp programming. Alas, I wish I had taken it more seriously.

At least Hofstadter was successful at getting me interested in math beyond high school.

replies(2): >>41867602 #>>41885203 #
lproven ◴[] No.41867602[source]
Me too. I admire the theory of Lisp, but man, all the Lisp folks going "but don't you get it, the absence of syntax IS the syntax!" don't half get tiring.

For some of us, we can just about handle the simple algebraic infix stuff, and we'll never make that leap to "my god, it's full of CARs".

https://xkcd.com/224/

replies(1): >>41867926 #
anthk ◴[] No.41867926[source]
If you have a look on some Emacs code (and modules such as Mastodon.el), you'll see than the syntax is not that scary, as Lisp makes it trivial to modularize code into smaller functions.
replies(1): >>41868428 #
lproven ◴[] No.41868428[source]
I have spent years writing about and studying Lisp, including buying several books.

This is categorically not the case.

Let me paraphrase my own post from Lobsters a year or two back:

I hypothesise that, genuinely, a large fraction of humanity simply lacks the mental flexibility to adapt to prefix or postfix notation.

Algebraic notation is, among ordinary people, almost a metonym for “complicated and hard to understand”. I suspect that most numerate people could not explain BODMAS precedence and don’t understand what subexpressions in brackets mean.

I have personally taught people to program who did not and could not understand the conceptual relationship between a fraction and a percentage. This abstraction was too hard for them.

Ordinary line-numbered BASIC is, I suspect, somewhere around the upper bound of cognitive complexity for billions of humans.

One reason for the success of languages with C syntax is that it’s the tersest form of algebraic notation that many people smart enough to program at all can handle.

Reorder the operators and you’ve just blown the minds of the majority of your target audience. Game over.

I admire Lisp hugely, but I am not a Lisp proponent.

I find it fascinating and the claims about it intrigue me, but to me, personally, I find it almost totally unreadable.

Those people I am talking about? I say this became I am one.

I myself am very firmly in the camp of those for whom simple algebraic infix notation is all I can follow. Personally, my favourite programming language is still BASIC.

replies(4): >>41868496 #>>41868767 #>>41874523 #>>41893281 #
1. kazinator ◴[] No.41893281[source]
> a large fraction of humanity simply lacks the mental flexibility to adapt to prefix or postfix notation.

I doubt it. Firstly, there are entire prefix and postfix natural languages, which have capable native speakers of all intellectual persuations. But in natural languages, sentences do not go to very deep levels of nesting before people get confused.

In programming, we have the deep nesting quite often. Nobody has the mental flexibility to adapt to it. We indent the code instead.

Nobody can read a large Lisp program (or even a small one) if it is flattened into one long line, which is then wrapped to a paragraph.

Within a single line of Lisp, there is rarely much nesting going on where the prefix notation causes a problem. The rest is indentation.

Everyone doing serious programming relies on their editor for that, which helps them spot nesting errors.

replies(1): >>41903146 #
2. lproven ◴[] No.41903146[source]
> Firstly, there are entire prefix and postfix natural languages, which have capable native speakers of all intellectual persuations.

Sure. And you are also aware that there are natural languages which are regarded as being very hard for non-native adults to learn, right?

Some natural human languages are easier than others. This is axiomatic.

Some programming languages are easier than others too. Excluding the ones that are designed to be, from INTERCAL to Ook!

replies(1): >>41904755 #
3. kazinator ◴[] No.41904755[source]
I'm not aware that major features like verb order cause difficulty in language learning.

It's usually gratuitous syntax like noun cases, especially when the same feature is not present in any shape in one's native language.

Also writing systems that have large numbers of symbols, which have multiple interpretations.

In any case all mainstream programming languages have prefix notation in the form of function calls. And also statement constructs that begin with a command word followed by argument material.

Imperative sentences in English amount of prefix notation because the subject is omitted (it is implicitly "you") so we're left with verb and object.

replies(1): >>41906011 #
4. lproven ◴[] No.41906011{3}[source]
Sure, but that is not my key point here.

You're focussing on the detail while ignoring the general picture.

I am not comparing Lisp to Mandarin Chinese or something. That would be silly.

What I am saying is that there are a whole bunch of languages (both kinds) which presumably seem perfectly easy to those who grew up with them, but if you didn't and you come to them after learning something else that's much simpler and doesn't do the fancy stuff, then they seem really hard. Consistently, for lots of people, regardless of background.

Doesn't matter how good your Arabic, Mandarin will be hard, and vice versa.

https://www.geeksforgeeks.org/hardest-languages-in-the-world...

That list isn't sorted by your source language, your L1. That doesn't matter.

If they come from an infix-notation imperative language then most people are going to find moving to an impurely-functional prefix-notation one is really hard. And most languages are infix-notation imperative languages.

replies(1): >>41907676 #
5. kazinator ◴[] No.41907676{4}[source]
Sorry, how does the point that natural languages are absolutely hard or easy, regardless of one's native language, speak to the point that moving to a prefix programming language from infix is hard?

There are hardly any Lisp programmers today who didn't "come from" prefix languages.

All mainstream languages are heavily steeped in prefix notation. The infix stuff is just a small core, typically. Mainly it is for arithmetic. Sometimes for string manipulation or set operations on containers, perhaps I/O.

Libraries are invoked with f(a, ...) prefix or perhaps obj.f(a, ...) mixed infix and prefix.

Libraries have far more content larger than the infix material.

Even small programs are divided into functions, invoked with prefix. Prefix is relied on for major program organization.

Command languages use prefix: copy filea.txt this/dir.

Statement and definition structures in mainstream languages are prefix: class foo {, goto label, return 42, procedure foo(var x : integrer), ...

The idea that programmers coming to Lisp are confused by prefix does not hold water.