Live data from Hacker News

The Roots of Lisp (2001)

paulgraham.com

81–90 of 92 posts

Re: The Roots of Lisp (2001)

#81
post #78

Earlier quoted context omitted.

Re: If I were given a choice to either hire five Javascript/Python/Go programmers and pay them each 100K/Y or hire only three Lispers and pay them each 200K/Y, I would go for the latter. ROI, in that case, would be much, much higher. If that were universally true, one could out-compete the entrenched software companies and be the next Bill Gates. The common "production" languages are successful I believe because they…

> if that were universally true, one could out-compete the entrenched software companies What makes a software product a successful product? Would you agree that popularity and sold copies do not necessarily make it the right product? There's a lot of marketing goes into success, and I admit - sound engineering often lacks good marketing. What you can't see behind your clouded judgment that despite being non-mainstre…

> consistently being rated as the top paid language

means: developers are rare and too expensive. -> companies will avoid it.

Re: The Roots of Lisp (2001)

#82
post #81

Earlier quoted context omitted.

> if that were universally true, one could out-compete the entrenched software companies What makes a software product a successful product? Would you agree that popularity and sold copies do not necessarily make it the right product? There's a lot of marketing goes into success, and I admit - sound engineering often lacks good marketing. What you can't see behind your clouded judgment that despite being non-mainstre…

> consistently being rated as the top paid language means: developers are rare and too expensive. -> companies will avoid it.

I was going to make a similar comment. Programmer salary and owner profits are not necessarily related. The more specialized a skill is, the more it pays in general. (From the worker's standpoint this is a mixed bag in that you get more money if you are employed, but may have less geographical choice.)

Re: The Roots of Lisp (2001)

#83
post #78

Earlier quoted context omitted.

Re: If I were given a choice to either hire five Javascript/Python/Go programmers and pay them each 100K/Y or hire only three Lispers and pay them each 200K/Y, I would go for the latter. ROI, in that case, would be much, much higher. If that were universally true, one could out-compete the entrenched software companies and be the next Bill Gates. The common "production" languages are successful I believe because they…

> if that were universally true, one could out-compete the entrenched software companies What makes a software product a successful product? Would you agree that popularity and sold copies do not necessarily make it the right product? There's a lot of marketing goes into success, and I admit - sound engineering often lacks good marketing. What you can't see behind your clouded judgment that despite being non-mainstre…

> Clojure teams at companies like Walmart and Apple processing massive amounts of data.

Yes, I already agreed it does well in certain niches. Usually in query-esque niches. SQL is also functional-esque for similar reasons.

You seem to be contradicting yourself, saying that other factors overwhelm FP's alleged programmer productivity gains, yet point out niches where it does well and is common. It spreads there, but not elsewhere.

> top paid language

I'll leave salary discussion to lispm's (user) reply thread.

> There's a lot of marketing goes into success, and I admit - sound engineering often lacks good marketing.

Yes, but that's mostly independent of programming productivity. It's not a difference maker in comparisons. Just because programming isn't everything to the bottom line doesn't mean it's nothing to it. For a software shop, programming is still a notable portion of activities that affect the bottom line. If you are 1% more profitable than your competitors, that difference will compound over time. If you grow 4% a year but your competitor grows just 3% a year, you'll eventually swamp them. Do a spreadsheet on it if you don't believe me.

Re: The Roots of Lisp (2001)

#84
post #73
post #57

Earlier quoted context omitted.

Re: Though [separating in Lisp] has tried a bunch of times. I haven't seen it done well. The attempts kind of end up with the worse of both worlds. Re: Could be that or that one just needs a bit of practice But the key is how much, and how long does it vary per individual. There is no solid research that I know of, so it's just opinion and anecdotes either way. I tried to get used to it and read it fast, but it just…

> Most Algol-derived languages use punctuation and symbols that seem to make them stand out better than words alone. If we read a long novel, then we read mostly words without much visual structure. The only thing that guides us are occasional marks of sentences, paragraphs and chapters. Still many can read Lord of the Rings without much problem. Lisp is slightly unusual, since the code is written as nested lists (tr…

> Still many can read [novels] without much problem.

Compared to what? I didn't say reading of Lisp comes to a stand-still, only that it's slower than block-type-indicator symbols. Maybe it is indeed possible to refactor written English for speed reading. I haven't surveyed the tests. Does anyone here want to claim English is optimized for quick reading?

It's kind of off topic, but I can envision using various symbols and block-markers to delineate parts of English sentences such as subject, verb, object, etc.: "(subject..) $verb {object...}" I think it would quicken MY reading, but I can't vouch for other humans. Maybe I'll patent it, or did Oracle beat me to it ;-)

But that's the idea: commonly occurring features are marked or surrounded with different symbols. You can't really do that in Lisp because nouns are verbs and verbs are nouns depending on the context/usage of the libraries or deeper code, while with Algol-derived languages mostly hard-wire the difference up front. You instantly know and don't have to stop and think or dig.

Indirection/abstraction can and does slow reading in many cases. I'm just the messenger. If YOU can read and process textual words fast, that's great but may NOT be universal across most humans.

> In terms of lines of code I would think that's true.

No, I meant features-per-hour, at least for business-oriented coding [in COBOL].

> Why should it be in the mainstream?

The standing implication, as I interpret it, is that functional programming is inherently superior in general, for a price of a slightly longer learning curve.

> Now you are shifting the goal. You originally claimed that functional code is hard to debug, because there are no variables you can inspect. But that's what we do in Lisp too: we use variables for that purpose.

I'm addressing TWO goals: easier-to-read and easier-to-debug.

> But that's what we do in Lisp too: we use variables for that purpose.

You add them just for debugging? Imperative style typically does that as in regular course. Thus, one doesn't have to alter the code as often just for debugging.

> After a while the reader/writer of Lisp code will recognize the symbolic hints and the usual visual patterns of the layouted code.

Indentation is not a difference maker in comparisons because both candidates can use it.

Re: The Roots of Lisp (2001)

#85
post #84
post #73

Earlier quoted context omitted.

> Most Algol-derived languages use punctuation and symbols that seem to make them stand out better than words alone. If we read a long novel, then we read mostly words without much visual structure. The only thing that guides us are occasional marks of sentences, paragraphs and chapters. Still many can read Lord of the Rings without much problem. Lisp is slightly unusual, since the code is written as nested lists (tr…

> Still many can read [novels] without much problem. Compared to what? I didn't say reading of Lisp comes to a stand-still, only that it's slower than block-type-indicator symbols. Maybe it is indeed possible to refactor written English for speed reading. I haven't surveyed the tests. Does anyone here want to claim English is optimized for quick reading? It's kind of off topic, but I can envision using various symbol…

> I didn't say reading of Lisp comes to a stand-still, only that it's slower than block-type-indicator symbols.

That's an assumption of yours.

> No, I meant features-per-hour, at least for business-oriented coding [in COBOL].

Another assumption, for which you assume justifications.

> The standing implication, as I interpret it, is that functional programming is inherently superior in general, for a price of a slightly longer learning curve.

I think of 'functional programming' as a tool. 'superior' is an attribute that you use.

Implication of what? 'functional programming'? Lisp is not 'functional programming'. Lisp in its root is a mix of full imperative programming (mutable variables + imperative control flow) with functional programming (first class functions, higher-order functions, ...).

> You add them just for debugging? Imperative style typically does that as in regular course.

Imperative code uses operators (which are functions) and functions.

  a = 2 * b + 3 ^ b
  c = 4 * a
  r = c * pi * sin(a)
It's basically arbitrary which variables one introduces. We could write the thing down as one expression, add more variables, etc. Using variables has two purposes: save intermediate results for multiple use and naming intermediate results for documentation/code readability purposes.

+, ^, sin, ... are basically functions. An operator is a function with an infix notation. Thus any imperative code which uses functions and operators is ALREADY a mix of imperative elements (mutable variables and imperative control flow) and calling functions.

In Lisp one might introduce the variables first and then set them:

  (prog (a c r)
    (setf a (+ (expt 3 b) (* 2 q)))
    (setf c (* 4 a))
    (setf r (* c pi (sin a)))
    ...)
or use LET*

  (let ((a (+ (expr 3 b) (* 2 q)))
        (c (* 4 a)))
        (r (* c pi (sin a))))
    ...)
or I could use local functions.

  (flet ((e1 (b q)
           (* (expr 3 b) (* 2 q)))
         (e2 (a)
           (* 4 a))
         (e3 (c a)
           (* c pi (sin a))))
    (let* ((a (e1 b q))
           (c (e2 a))
           (r (e3 c a))
     ...)
etc...

Or I could write the code in some infix notation, since one can add infix syntax:

  CL-USER 8 > (ql:quickload "infix")
  To load "infix":
    Load 1 ASDF system:
      infix
  ; Loading "infix"

  ("infix")

  CL-USER 9 > #I( a = 3 , b = 5 , c = a * b, c)
  15

  CL-USER 10 > #I( a = 3 ,
                   b = 5 ,
                   c = a * b,
                   c)
  15

We can write Lisp code any way we want. We can write it in an basic imperative style in s-expression syntax and also in infix syntax. We can also write it in slightly more functional styles.

Every function introduces variables and LET / LET* are nothing else then binding constructs which are function calls:

   (let ((a 10))
     (* a 4))
is basically the same as

   ((lambda (a) (* a 4))     ; anonymous function
    10)
The more functional style of variable free calls is not the general way to write down code in Lisp. The extreme style variant is so-called 'point-free' where functions are combinated is also not very much used.

So when you think that one does use a strict functional and variable-free style of programming in Lisp, then this has no base in reality. Lisp is very much an imperative language.

> Indentation is not a difference maker in comparisons because both candidates can use it.

Layout of code is more than indentation.

Re: The Roots of Lisp (2001)

#86
post #85
post #84

Earlier quoted context omitted.

> Still many can read [novels] without much problem. Compared to what? I didn't say reading of Lisp comes to a stand-still, only that it's slower than block-type-indicator symbols. Maybe it is indeed possible to refactor written English for speed reading. I haven't surveyed the tests. Does anyone here want to claim English is optimized for quick reading? It's kind of off topic, but I can envision using various symbol…

> I didn't say reading of Lisp comes to a stand-still, only that it's slower than block-type-indicator symbols. That's an assumption of yours. > No, I meant features-per-hour, at least for business-oriented coding [in COBOL]. Another assumption, for which you assume justifications. > The standing implication, as I interpret it, is that functional programming is inherently superior in general, for a price of a slightl…

> That's an assumption of yours.

So is the opposite viewpoint. Neither of us has a solid study that's directly relevant such that anecdotal info is all we have here either way. A good study would probably require millions of dollars. Yours is NOT the default position given the lack of such studies.

> Layout of code is more than indentation.

Same issue: both can do it so it's not a difference maker in comparisons.

> We can write Lisp code any way we want...one might introduce the variables first and then set them...or use LET*...or I could use local functions...etc...

But that's part of the "lack of standardization" that contributes to Lisp being more difficult to read. Standards and conventions are somewhat counter to "flexibility". We typically don't want overly-detailed standards (hard to remember) nor want excessive flexibility because then everybody and every spot may do things different.

There is an optimum balancing point in the standards vs. flexibility spectrum. Goldilocks. And the balancing point probably varies per individual.

Re: The Roots of Lisp (2001)

#87
post #86
post #85

Earlier quoted context omitted.

> I didn't say reading of Lisp comes to a stand-still, only that it's slower than block-type-indicator symbols. That's an assumption of yours. > No, I meant features-per-hour, at least for business-oriented coding [in COBOL]. Another assumption, for which you assume justifications. > The standing implication, as I interpret it, is that functional programming is inherently superior in general, for a price of a slightl…

> That's an assumption of yours. So is the opposite viewpoint. Neither of us has a solid study that's directly relevant such that anecdotal info is all we have here either way. A good study would probably require millions of dollars. Yours is NOT the default position given the lack of such studies. > Layout of code is more than indentation. Same issue: both can do it so it's not a difference maker in comparisons. > W…

One of the problems to learn a new programming language syntax is a mental block. One looks for all kinds of excuses. It's actually not that Lisp syntax is overly difficult, it's the pain of learning something new.

> Yours is NOT the default position given the lack of such studies.

Your view would be more interesting to me if you'd have spent some time learning to read and write Lisp code. Much of what you claim is just guessing.

> Standards and conventions

There are standards and conventions in Lisp code. You just don't know them.

You are just guessing how difficult it might be to fly an airplane. It might be more difficult than a car, but how difficult it actually is not visible to you. You just guess that there are much fewer aircraft pilots than car drivers, and guess that flying a plane must be extremely difficult...

Re: The Roots of Lisp (2001)

#88
post #87
post #86

Earlier quoted context omitted.

> That's an assumption of yours. So is the opposite viewpoint. Neither of us has a solid study that's directly relevant such that anecdotal info is all we have here either way. A good study would probably require millions of dollars. Yours is NOT the default position given the lack of such studies. > Layout of code is more than indentation. Same issue: both can do it so it's not a difference maker in comparisons. > W…

One of the problems to learn a new programming language syntax is a mental block. One looks for all kinds of excuses. It's actually not that Lisp syntax is overly difficult, it's the pain of learning something new. > Yours is NOT the default position given the lack of such studies. Your view would be more interesting to me if you'd have spent some time learning to read and write Lisp code. Much of what you claim is j…

> Much of what you claim is just guessing.

Same with you. It's not statistically safe to say that because some people do better with Lisp that everybody will given enough time. That doesn't tell us whether it's a personal fit or something more general.

Your line of reasoning appears to be "I did X and got result Y, therefore if everybody else does X, they will also likely get result Y". You hopefully should recognize the statistical fallacy in that pattern.

Anyhow, we are going in circles. There are no solid studies to back either of our viewpoints so we just have "anecdote fights" that don't get anywhere, which is quite common in Lisp-related debates. BeenThereDoneThat.

> There are standards and conventions in Lisp code. You just don't know them.

But they mostly rely on "parsing" words. I personally believe in the power of symbols. My eyes/head process most symbols much faster than words. I can't explain it, they just do. That's just my brain, although others have told me similar. If YOUR brain can process textual words as fast as symbols, that's wonderful, but may be specific to you (and other Lisp fans). Your head is NOT my head.

It's not like I'm new to words such that after reading a billion words I'll finally get better. People's textual reading usually plateaus after about 5 years as adults. Throwing time at the problem won't significantly change this. Why should Lisp be different? Words are words.

And sure there are standards/conventions in Lisp, but the competition also has standards/conventions such that it's not a difference maker in comparisons. The difference maker is WORDS alone versus words + symbols. (Well, Lisp has parentheses, but mostly only parentheses, unless you "invent" something custom, which makes it non-standard by definition.)

And I'm not against new things, but if they don't seem to be making sufficient progress after a reasonable amount of time, I abandon them. If Lisp is unique in that it has a hockey-stick shaped benefits curve (flat for long stretches, then goes up), then it stands out from most tools. It's hard to know if it has a weird learning curve up front since there are no decent studies on it. Often fans of tools claim "just try it long enough". That's not sufficient because it's a fan habit to claim that.

Re: The Roots of Lisp (2001)

#89
post #88
post #87

Earlier quoted context omitted.

One of the problems to learn a new programming language syntax is a mental block. One looks for all kinds of excuses. It's actually not that Lisp syntax is overly difficult, it's the pain of learning something new. > Yours is NOT the default position given the lack of such studies. Your view would be more interesting to me if you'd have spent some time learning to read and write Lisp code. Much of what you claim is j…

> Much of what you claim is just guessing. Same with you. It's not statistically safe to say that because some people do better with Lisp that everybody will given enough time. That doesn't tell us whether it's a personal fit or something more general. Your line of reasoning appears to be "I did X and got result Y, therefore if everybody else does X, they will also likely get result Y". You hopefully should recognize…

> But they mostly rely on "parsing" words.

And structure.

> If YOUR brain can process textual words as fast as symbols, that's wonderful, but may be specific to you

Most people can do that. Most text people read just consists of words. Actually reading text with special symbols is quite complex - especially if the meaning depends on a mix of prefix, infix, postfix with different operator precedence.

> And sure there are standards/conventions in Lisp, but the competition also has standards/conventions such that it's not a difference maker in comparisons.

You claim a difference. I claim, you are just unfamiliar with Lisp.

> The difference maker is WORDS alone versus words + symbols.

No, the difference is words and structure.

Take for example the usual imperative code:

  a := 3;
  b := a*4;
  if a > b
   print a
  else
   print b
  ...
That's just a vertical sequence without much structure. You can add more { and }, but the shape largely stays the same.

Lisp code would look like this:

  (let* ((a 3)
         (b (* a 4)))
    (if (> a b)
      (print a)
      (print b)))
That's much more tree-like:

  LET*
       binding
       binding
   BODY
   BODY
   BODY
From that we can easily see that this is a new scope, what modifies the scope and what extent the scope has.

Lisp users learn to parse these visual and structural blocks & patterns. Once one has learned the vocabulary of basic code patterns, it's getting much easier to read Lisp.

Re: The Roots of Lisp (2001)

#90
post #89
post #88

Earlier quoted context omitted.

> Much of what you claim is just guessing. Same with you. It's not statistically safe to say that because some people do better with Lisp that everybody will given enough time. That doesn't tell us whether it's a personal fit or something more general. Your line of reasoning appears to be "I did X and got result Y, therefore if everybody else does X, they will also likely get result Y". You hopefully should recognize…

> But they mostly rely on "parsing" words. And structure. > If YOUR brain can process textual words as fast as symbols, that's wonderful, but may be specific to you Most people can do that. Most text people read just consists of words. Actually reading text with special symbols is quite complex - especially if the meaning depends on a mix of prefix, infix, postfix with different operator precedence. > And sure there…

> And structure.

They both have structure so it's not a difference maker in comparisons.

> Most people can do that. Most text people read just consists of words.

Yes, but "do" and "do better than alternatives" are different things. I already gave examples of possible alternatives/enhancements to typical English text that would help at least my brain. I won't reinvent that sub-discussion here.

> That's much more tree-like:

Being tree-like and being easier to read are not necessarily the same thing.

> I claim, you are just unfamiliar with Lisp.

How long do you believe it's realistic to keep at it if the benefits come slow? For example, if I keep coding in Lisp heavily for 2 years and STILL find it sluggish to read, is it realistic to then give up in your book?

> From that we can easily see that...

Who is this "we"?

I've been reading words and symbols for multiple decades in various contexts (programming, regular books, etc.). I've concluding after these decades that if used in the right spots, symbols GREATLY ENHANCE my ability to parse/grok/absorb written material IRREGARDLESS of the domain or the specific language.

For example, one thing I like from C# over VB.net is that C# uses square brackets for array indexes instead of parenthesis like VB does. It improved my head's groking speed of array-related code because parentheses have multiple meanings in VB. (I'm not claiming C# is overall better, this is just one aspect.)

Symbols MIXED with words (well) enhance the absorption of words. It's a ying-yang kind of thing. They COMPLIMENT each other. I truly doubt a billion years of using mostly just one OR the other will prove better than using them both.

Sorry, I believe Lisp is just plain lacking there. I want my ying-yang MTV. Go play your Wordy Gurdy in Jennifer's juniper garden.

Post reply on HN