←back to thread

Hofstadter on Lisp (1983)

(gist.github.com)
373 points Eric_WVGG | 2 comments | | HN request time: 0.437s | 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 #
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 #
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 #
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 #
lproven ◴[] No.41906011[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 #
kazinator ◴[] No.41907676[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.

replies(1): >>41912382 #
lproven ◴[] No.41912382[source]
The core unifying point here is that some things are harder to learn than other things.

If you find that a difficult idea, I don't know how else I can put it.

replies(1): >>41913129 #
lispm ◴[] No.41913129[source]
> harder to learn than other things

"harder" is relative to a reference. Even "hard" is relative.

The simple nested arithmetic code you stopped at in SICP is easy for most people working as developers. Maths from 5th year school are sufficient. Nested lists, prefix notation isn't "hard" for "most" people.

It's just lightly harder for someone who has never seen that. When they have seen XML or JSON, then it's even easier.

Actually "hard" Lisp code looks and feels different. First "harder" hurdles in Lisp are typically evaluation, recursion, macro expansion, compile-time vs. runtime, meta-notation (code as data), ...

I learned 2 years PASCAL and MODULA 2 on an Apple ][ (and i still think that was fun), before getting in contact with the Lisp alien world. I was hooked in a short time.

replies(1): >>41923633 #
1. lproven ◴[] No.41923633[source]
I really feel like you are determined to misinterpret and deny what I am trying to say, without engaging and listening.

This is a very Lispian sort of attitude. "No, you are wrong, this is in fact the correct way..."

There is an existence proof that the attitude of "just keep at it and it will make sense" is not true, and it's an international software industry of buggy, leaky, insecure C code that keeps hundreds of thousands of people in work and makes _tens of millions of dollars_ every year.

If the alternative really was better, someone would have found a way to make money from it, but they have not.

And yet, despite the terrible macho-man culture of the software industry, where it is a sign of how elite you are to write in a non-bounds-checked language with manual memory management and they make jokes about "blowing your own leg off" and "write-only code", Borland made hundreds of millions selling the same people Pascal for decades, and it's still on sale now.

https://www.embarcadero.com/products/delphi

My first full time job in FOSS was documenting Java tooling, for a Linux company that told me in my New Hire Orientation how much the company hated Java.

I have met and talked with some Java developers. They are scary. Some of them are the kids who couldn't get onto Computing courses but they are pro Java developers. They can just bodge it together and it works, safely.

IMHO the Lisp industry and community needs to listen to the people trying to make easier, clearer Lisps, such as CGOL and PLOT and Lunar and Dylan, and engage with them, and try to understand why and embrace it, not just continually telling them they are wrong wrong wrong.

Plain old algebraic notation works and non-specialists can, with effort, master it.

But even more than that: the most widely-used programming language in the world today is Microsoft Excel formulæ.

BTW: Recursion is trivial. I had recursive BBC BASIC V code working beautifully when I was 20.

replies(1): >>41923864 #
2. lispm ◴[] No.41923864[source]
> I really feel like you are determined to misinterpret

Why post here, when you are not willing to accept feedback from other people? I get that you have trouble learning Lisp, but I have been hearing the same stuff for decades. Nothing what you tell is new. I had to deal with the same arguments 40 years ago and when you read old Lisp books from the mid 60s -> the same song. I've seen some people getting Lisp and others not. For me the question was always how to help people "to get it" - attitudes like your's, giving up early, is typically an early dead end. The mental block is the bigger problem than the actual thing to learn.

"Anyone could learn Lisp in one day, except that if they already knew Fortran, it would take three days.” — Marvin Minsky.

There is truth to that. People who already have an idea how things should work, need to let that go. Unlearn and start from a neutral position.

> international software industry of buggy, leaky, insecure C code that keeps hundreds of thousands of people in work and makes _tens of millions of dollars_ every year.

Yeah, and I have a lot of respect for that. I use software written in C everyday. It does useful stuff, independent how many problems it has.

> Some of them are the kids who couldn't get onto Computing courses but they are pro Java developers.

I work in a company, which has several hundred people developing in Java. In fact the part of the company I work with is responsible for backend work, which connects several million cars. I've met extremely bright people, doing hard work. I'm not going to try selling them Lisp.

> IMHO the Lisp industry and community needs to listen to the people trying to make easier

IMHO "the Lisp industry" does not exist as an entity and has neither the resources nor the interest to do what. Nobody is interested in CGOL, PLOT or Dylan. These were dead end. Nice experiments. I like experiments.

Lisp people worked on Dylan, when the Lisp jobs went away. Dylan went nowhere. As some former Lisp people working on Dylan, some are still thinking its a good idea and others have given up on it. Harlequin had several language offerings: Postscript RIPs, Lisp, ML, Dylan, Memory management. LispWorks survived, when Harlequin went bankrupt, because it had customers with software. Dylan did not survive. It was eventually open sourced and still has not much going on.

The non-existent "Lisp industry" would alienate its core customers. People who want a different tool.

You THINK that there it would be a way, but we have heard for decades these same ideas. The problem is not people who can give advice (I've seen lots of talks & papers about this topic) - the problem is that these people have nothing to offer, they are themselves not involved. Nobody will listen to you, because people in the IT industry get all kinds of advice, but "needs to listen" does not pay the bills.

Clojure exists, because people developed it, had a market niche and it survived. In the same original niches (enterprise consulting for web technology, ...) were and still are a zillion other offerings. Every year new and old ideas come and go.

> Recursion is trivial

Then SICP should be trivial for you, because its content is based on Scheme with lots of recursion.

> IMHO the Lisp industry and community needs to listen to the people trying to make easier, clearer Lisps, such as CGOL and PLOT and Lunar and Dylan, and engage with them, and try to understand why and embrace it, not just continually telling them they are wrong wrong wrong.

You misinterpret the Lisp community. "People are not wrong". It's just that the people in the various Lisp communities focus on their own stuff and that's their right.

I have my garden at home, I'm not responsible to sell stuff to all kinds of other garden owners. That's not my business. I'm happy with my garden.

Actually, languages like Python, Java, JavaScript, Ruby, Exlixir, OCAML, F#, Wolfram language and many others, ... they have already taken most of the Lisp features (typical argument we hear: why use Lisp, when other languages already have its most important features?).

You may not aware of it, but languages with lots of features from Lisp are in wide use already.