←back to thread

Hofstadter on Lisp (1983)

(gist.github.com)
372 points Eric_WVGG | 7 comments | | HN request time: 0.001s | source | bottom
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 #
lispm ◴[] No.41868767[source]
> I have spent years writing about and studying Lisp, including buying several books.

The key is "writing and maintaining" Lisp software.

Lisp often won't get learned by reading or writing ABOUT it, but by reading AND writing actual Lisp code.

It's a bit like riding a bike. You can study bikes for a long time, but you will typically not be able to ride a bike. That's something which can be learned when actually practicing to ride the bike. This means also not needing to consciously think about it, but by moving tasks to internal automatisms. Lisp code is data and this wants to be "manipulated". This manipulation is a key to learn Lisp. The other key element is to work with a system which gives live feedback -> interactive programming. "Interactive" means to do things, to fail, to improve, to do it again.

It's in part the experience of actually using an interactive programming system.

replies(2): >>41868940 #>>41869032 #
lproven ◴[] No.41869032[source]
> The key is "writing and maintaining" Lisp software.

You may be right there, but I think there is a point you are smoothing over and almost trying to hide here.

What if someone can't get to the point where they are able to write useful code?

If you can't start riding a bike without stabilisers or someone holding it, then you're never going to learn to ride well.

At around age 11 or 12 I tried to learn to roller-skate. My parents bought me skates, and I put them on and tried to stand up.

I fell over so much over a few days that I bruised my pelvis and walking became very painful, let alone lying down. It was horrible and I gave up.

25 years later I managed to learn to ride a snowboard, after years of failure, because of having to do an emergency turn to avoid hitting some children and getting up on one edge and learning that edge-riding is the key. Nobody told me, including 3 paid days of lessons with a professional teacher.

It took great persistence and physical pain but I did it. I gave up on skating of any kind.

My core point is that people vary widely in abilities. Some people pick up a complex motor skill in 10-15min and can do it and their skills grow from there. Others may struggle for days or weeks to attain that... And most are not doggedly determined enough to try for that long.

Algebra is most schoolchildren's way of describing "something extremely hard to learn and pointless in everyday life." For ordinary humans, the concepts of "variables" and "symbols" that manipulate them IS A WAY TO TALK ABOUT something super-difficult.

But most of it, with effort, can just about get through. Very very few choose to follow it further.

And yet, there are a few families of programming languages -- Lisp, Forth, Postscript, HP calculator RPN -- whose basic guiding assumption is "you will easily master this basic action, so let's throw it away and move on to the logic underneath".

And the people who like this family of languages are annoyed and offended that other languages that do not require this are hundreds of times more popular and are used by millions of people.

Worse still, when someone comes and says "hey, maybe we can simplify that bit for ordinary folks", they mock and deride the efforts.

Maybe just allow yourself to think: perhaps this stuff that's easy for me is hard for others, and I should not blame them for them finding it hard?

replies(3): >>41869262 #>>41869717 #>>41893378 #
lispm ◴[] No.41869717[source]
> If you can't start riding a bike without stabilisers or someone holding it, then you're never going to learn to ride well.

In German: "es ist noch nie ein Meister vom Himmel gefallen". We all start somewhere, we go to school, we have teachers, we have trainers/coaches, we have mentors, ...

I don't think studying it alone will help, best is with people around. Parents and friends will help us to learn how to ride a bike. They will give an example, they will give feedback on our attempts, they will propose what and how to try to master it. After the initial basic hurdle is done, then comes a lot of practice. But again, best by being embedded in a community. Learning such skills is a social activity.

There is a lot of pedagogical material to learn programming with Lisp, Logo, Scheme. I had courses about software development, using languages like PASCAL, LISP, Scheme and others. We got exercises and feedback. We got access to computers, cpu time and an environment for coding. I looked around and setup my own tools and wrote stuff with it. I discussed this stuff (code, environment, architecture, styles, ...) with a friend.

> perhaps this stuff that's easy for me is hard for others, and I should not blame them for them finding it hard?

Lot's of people are frightened by thinking/hearing that it is hard, while in fact it actually isn't.

For example one of reads that German is very difficult for native English speakers. There are a lot of justifications given for that. The actual data says something different. German is very near to English, English even is a Germanic language: https://en.wikipedia.org/wiki/Germanic_languages

The actual ranking: https://effectivelanguagelearning.com/language-guide/languag...

Trying to learn Lisp without actually trying to write code, sounds like trying to learn a language without actually trying to speak with people. Possible, but unnecessary hard.

We need to make our brain adapt to the new language by moving into an environment, where the words connect to the real world and thus to meaning.

Maybe just allow yourself to think: Giving feedback is not "blaming". That's an early concept needed for moving forward.

replies(1): >>41870519 #
lproven ◴[] No.41870519[source]
I think you are wrong.

Let me try to demonstrate with a parallel example.

> "es ist noch nie ein Meister vom Himmel gefallen"

My best guess is: A master does not ready from heaven fall?

One does not instantly become a master?

Different people find different skills easy.

So: ich kann ein bisschen Deutsch spreche. Nicht so viel, und mein Deutsch is nicht gut; es is sehr, sehr schlecht. Aber fur meine Ferien es genug ist.

Ich hat drei Tage Deutsch gestudiert, unt es war in 1989. Drei tage, am ein bus vom Insel Man nach der Rhein.

I am fairly good with languages. I can communicate in 6 foreign languages. Currently, I am studying Czech, because my wife is Czech, and I would like to be able to speak with her family, some of whom speak no English, or German, French, Spanish or anything else I speak at all.

Czech is really hard. It makes German look like an easy beginner's language. In place of German's 4 cases, Czech has 7; in place of German's 3 genders, Czech has 4. (Czechs think there are 3, but really there are 4. Polish has 5.)

I am somewhere past A2 level Czech, beginning B1, and I can hold a simple conversation, mainly in the present tense. But I started at age 45 and it took me about 5 or 6 years of work to get to this level. Basic tourist German I got in about 30 or 40 hours of hard work when I was 20 years old.

I am not bad at languages.

I am terrible at mathematics and very poor at programming. I used to be capable and proficient in BASIC and fairly good in FORTRAN. I managed a simple RLE monochrome image compression and decompression program in C, and an implementation of Conway's Game of Life in Pascal, and that is the height of my achievement.

I am pretty good at getting other people's code working, though. Enough to be paid to do it for decades.

I find Python quite hard -- weird complicated stuff like objects comes in early, and nasty C syntax peeks through even simple stuff like printing numbers.

Lisp, though, switches from just about comprehensible code to line noise very quickly after the level of "Hello world".

I got hold of a copy of SICP. It's famous. It's meant to be really good.

I could not follow page 1 of the actual tutorial.

Perhaps you know it.

In section 1.1.1, it says:

« (+ (* 3 (+ (* 2 4) (+ 3 5))) (+ (- 10 7) 6))

which the interpreter would readily evaluate to be 57. We can help ourselves by writing such an expression in the form

(+ (* 3 (+ (* 2 4) (+ 3 5))) (+ (- 10 7) 6))

following a formatting convention known as pretty-printing, in which each long combination is written so that the operands are aligned vertically. The resulting indentations display clearly the structure of the expression.6 »

The "helpful" pretty-printed part is incomprehensible to me. Section 1.1.1 is about where I gave up.

I think that this kind of issue is not just me.

Again: I submit that a bunch of people good at a very difficult skill are badly over estimating how good ordinary folks would be at it.

Most people can't program. Most people can't do mathematics. Most people are not good at this stuff.

The people that can do maths and can program mostly can only program in simple, infix-notation, imperative languages. Functional languages, or even prefix- and postfix-notation, is a step further than I suspect that 99% of humans can go.

And the attitude of those who can do it to those of us who can't do it is really not pleasant.

replies(3): >>41870814 #>>41879442 #>>41893506 #
amszmidt ◴[] No.41879442[source]
> In place of German's 4 cases, Czech has 7; in place of German's 3 genders, Czech has 4. (Czechs think there are 3, but really there are 4. Polish has 5.)

Polish has 3 genders (masculine, feminine and neuter), just like Czech. And 7 cases, like Czech.

replies(1): >>41879484 #
lproven ◴[] No.41879484[source]
Nope.

In no particular order:

1. żeński

2. nijaki

3. męski męskożywotny

4. męski męskorzeczowy

5. męski męskoosobowy

Contrast with Czech:

1. žensky

2. středny

3. mužsky životny

4. mužsky neživotny

You may not notice them, you may not consider them to be genders, but they look like it, they act like it; they're there and they make life very difficult for foreign learners.

replies(1): >>41879841 #
1. amszmidt ◴[] No.41879841[source]
Personal (męskoosobowy), animate (męskożywotny), and inanimate (męskorzeczowy) are not genders. Which is the same situation with Czech (životny - animate, etc).

I’m Polish. And did study Polish on top of that.

replies(1): >>41880220 #
2. lproven ◴[] No.41880220[source]
:shrug:

If it looks like a duck, walks and swims and quacks like a duck, it's a duck.

I lived in Czechia 10 years and after over half a decade of bloody hard work, I got to beginning B1 level Czech. It has 4 genders and they change adjectives and the accusative declination, and it is not important to me that Czechs don't consider them genders. They're genders. The levels of the hierarchy do not matter, merely the number of nodes.

A comparison: English has no future tense, strictly speaking. But in reality, really, it does: "I will say X". In fact arguably two: "I am going to say X." Technically to a linguist it's not a tense, it's a mode expressed with an auxiliary verb, but that doesn't matter. Acts like a tense. Used like a tense. It's a tense.

Slavic nouns come in arbitrary categories and you need to know which category it's in to conjugate it properly. French and Spanish have 2, German has 3, Czech has 4, Polish has 5. What they are called? Don't care. Not important to me.

I do not know Polish or speak Polish. I am 100% not claiming any authority here.

replies(2): >>41880339 #>>41893526 #
3. amszmidt ◴[] No.41880339[source]
Let me elaborate slightly.

For one, "męski męskożywotny" is not what it is called, it is just męskożywotny (the gender is already in the word, male male-animate, has a weird ring to it).

But all that means is that the object is of a masculine gender, and is living.

Męskoosobowy (masculine, person) -- małego chłopca (small boy)

Męskozwierzęcy (masculine, animal) -- małego psa (small dog)

Męskorzeczowy (masculine, thing) -- mały dom (small house)

Żeński (feminine) -- małą górę (small hill)

Nijaki (neuter) -- małe zwierzę (small animal)

The three masculine examples are all of the same gender, masculine -- the difference is if they are a person, animal or thing. None of which are genders, a house and a dog are both masculine.

I'm not going to argue about the complexity of Slavic, specially West Slavic languages -- cause they are complicated. :-). But you are absolutely incorrect in saying that we (Czech or Polish) have more than 3 genders. That you don't think it is particularly important is a bit sad, since these are the things that make Slavic such a fun language group.

replies(1): >>41893617 #
4. kazinator ◴[] No.41893526[source]
"I will ..." is a nonpast tense, though.

The semantics is future, but tense is a matter of syntax.

The modal verb which establishes future semantics it not in a future tense; it is in its dictionary form: to will.

In archaic English we can say things like "As I will it, so it shall be" where the verb isn't acting as a modal. The modal will comes from that one, I believe.

5. kazinator ◴[] No.41893617{3}[source]
I'm Slovak here. Although there are three genders, there are certain situations in which certain kinds of nouns undergo changes according to a finer subdivision than the 3 genders. I'm no expert on that. I don't think it necessarily amounts to separate genders. Or does it?

Let me see if I can recall an example. Okay, how about the word for horse, which is kôn, and man which is muž. This is masculine: ten kôn (that[masc] horse), ten muž (that[masc] man).

However, in the third person we have tý muži (those[masc] men) and tie koňe (those[fem? neut?] horses)?

The demonstrative tie is the same like the feminine one, tie ženy (those[fem] women) or neuter tie deti (those children).

Even if that is a special gender difference, it does not fall along the animate versus inanimate line, because horses are clearly animate.

Inanimate objects that are masculine in the singular do fall into this: ten stôl (that[m] table), tie stoly (those[f] tables).

It might be human versus non-human. Collections of non-human male gender things are not themselves males, but neuters.

replies(1): >>41895616 #
6. amszmidt ◴[] No.41895616{4}[source]
I find it strange that you are labelling ten/tie/.. as with gender. I don't know Slovak, but I'd expect it is the same as in Polish that the gender is on the subject. E.g., stôl is stół in Polish, and "męskorzeczowy", so masculine. "Ten stół" or "te stóły" -- te or ten is neither feminine nor masculine.
replies(1): >>41900755 #
7. kazinator ◴[] No.41900755{5}[source]
These demonstrative particles themselves don't have gender since they are not nouns, but they have a gender-based variety, and must pair correctly with the nouns by gender.

It's similar to la and le in French. You cannot say "Vive le France"; it has t obe "la France".

They are used as helpers in communicating the gender of a noun. If we say "ten stôl", it reaffirms that the noun is masculine. "tá stôl" is ungrammatical.

Other words are like this. E.g. interrogative wh- words: "ktorý muž?" (which man?) "ktorá žena?" (which woman?)