Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does decades of empirical evidence not prove that people are more comfortable with imperative, curly brace programming over s-expressions? It's not a chicken and egg problem. The egg has hatched and nested parentheses lost.


You may be right, idk, but I want to point out that you’re conflating two orthogonal concepts: S-expressions and imperative vs. functional programming.

There are lisp dialects that are very imperative, for example elisp, but they still use S-expressions. Historically they might have been considered “functional” because they have first-class functions and higher-order functions like mapcar, but nowadays practically every modern programming language (except go!) has these.

The thing all lisp dialects have in common is not where they land on the imperative vs. functional spectrum, but rather the fact that the syntax is trivial and so it’s easy to write powerful macros.


I think the simple uniform syntax is the main reason why Lisp never became popular.

Code is communication, and communication needs redundancy for error correction. You can see it in natural languages, and it makes sense to have it in programming languages as well. Using different kinds of syntax for expressing different ideas is an easy way to increase redundancy without making the code more verbose.


Lisp did become popular.

Then the AI Winter killed it and people avoided it like the plague.


The Lisp machine companies killed Lisp. They were the ones who blew Lisp sky high, but they also created expensive, monstrous workstations running Lisp images requiring tens of megabytes of RAM. Developers used them for prototyping and then had to cob something together to ship to the users, who had hardware like IBM PC machines with less than a meg of RAM.

Today's cruft like you ... Python, JS, whatever ... would not stand a chance in the world of the 1980s on that hardware.

It's amazing how far they were able to bloat up Lisp while continuing to peddle it commercially.

Leaner Lisps running on small systems existed all along, but they would rescue Lisp from the associations brought about by big Lisp.


>would not stand a chance in the world of the 1980s on that hardware

This is what fascinates me about Unix, they created an OS which works with text and processes, as opposed to binary structures and function calls when computers were hundreds of times slower. Even today the overhead of process creation and serialization for pipes is not negligible, how the hell did they manage to do it in 1970s?


Clojure has all those other braces also. They’re just used for data structure literals rather than blocks of code.


Or as I tell my colleagues who try to push for more abstract syntax: do you want your brain to do compilation each time your read something, or just have verbose text giving hints at each line ?

It s weird people prefer reading implicit text.


Isn’t this a big reason we have syntax highlighting? You can use color and styling to give you those hints that are otherwise implicit in text.


Decades of empirical evidence prove that people are more comfortable with functional, reactive, beging/end delimited programming, i.e. Excel.


millenia of empirical evidence and through to today, shows that most people are more comfortable not coding at all.


True, the majority of humans never even saw a computer.


No, it doesn’t.

What has happened in reality is that C became really popular and then all the people designing languages they wanted to be popular, rather than to be experimental, or to push boundaries, etc obviously chose a syntax which was familiar with most programmers, ie a syntax like C’s.

Further, one can disprove that the syntax is particularly important by simply pointing to Python which became immensely popular despite a lack of curly braces and even worse with significant white space simply because colleges and bootcamps decided it would be a good language to teach programming to beginners.


Arguably python and c are much more similar than any of them compared to a lisp.

I would argue the important part are the blocks in the former two, which sort of gets lost in the homogeny of lisps. Whether a block is marked with curly braces or indents doesn’t matter much - they being dissimilar to a regular expression does. Of course well-formatted lisp code tries to indent as well, but still there is a lot of visual noise there making it harder to visually inspect the code, I would guess.

Of course familiarity with a given way is significantly more important. We pretty much learnt the non-intuitive writing of math, to Chinese people their writing system is the intuitive one, etc.


Hmm, can't find the paper (mostly clutter from language bootcamp results) but around a decade or so back there was an education research project that concluded that teaching SQL first, rather than any imperative language (regardless of punctuation), was better for getting students to develop reasonable mental models for computing. (Unfortunately without the reference I can't address what the criteria for "better" were - but "what people get paid to do" isn't really proof of comfort at any level...)


I think it's quite telling that almost all of the innovations in lisp (garbage collection, first class functions, repl etc) have been absorbed into more popular languages except for s-expression syntax, which remains a small niche despite many great implementations of s-expression based languages.


Because as soon as you adopt the s-expressions, what you got is no longer <language>, but lisp itself. Something like this:

  static char _getch() {
    char buf;

    if (read(0, &buf, 1)) return buf;

    return '\0';
  }
would become:

  (define _getchar ()
    (declare static)
    (return-type 'char)
    (let ((buf (char)))
      (if (read 0 (& buf) 1)
        buf
        "\0")))


No. There is a good github gist rant I can’t find anymore, but if we call every AST in the form of s-expressions lisp, then is anything lisp? A programming language has to have an associated evaluation strategy, otherwise it’s just data. What you wrote only makes sense to execute as C code, which sure you can write a compiler for in your given lisp as well (so can you write a C compiler taking C AST in any other language, so it’s not special at all).


This one? https://gist.github.com/no-defun-allowed/4f0a06e17b3ce74c6ae...

It also responds to a few parents up "almost all of the innovations in lisp [...] have been absorbed into more popular languages" - pervasive interactivity hasn't even been taken up by some "Lisps", let alone has it been absorbed outside Lisp.


Yes! Thanks for digging it up for me! I can’t find anything on google for the life of me since they switched to vector search, even though I used to be able to find some obscure blog post..


Right. From which we can infer people like many things about lisp except for the syntax.


Does over a century of empirical evidence not prove that people are more comfortable with keyboards whose top row is laid out "QWERTYUIOP"?


Has there ever been research on this? Perhaps this situation has come about because the schools people must go to to get the programming jobs only teach the Javascript way? It seems circular logic to say that the current paradigm must be superior for the fact that it is the current paradigm. Is it possible that there are other reasons it reached that status?


does n=1 count? :)

some time ago I tried Racket, and just no. recently I tried Scala ZIO HTTP, and yes.

Maybe it's the types? Maybe it's the parens. But probably both. I cannot really recall my experience, just that manipulating code was ridiculously clunky. My assumption was that the IDE will manage the parens for me and when I'm moving something somewhere it'll figure out if I messed up the parens.. and ... no, nothing. I had to balance them with hand.


One reason emacs is popular for lisp programming is that the paredit package (or its newer competitor smartparens) do basically exactly what you describe: structural editing of sexp-based languages.


There's also parinfer, which does pretty much everything for you. I've heard some people don't like it because they dislike auto-insertion of text. Maybe that's more like what OP expected.


No, because people who start in programming do not go to a syntax comfort clinic, where they are tested, and then assigned to a programming language.


It only proves that those languages are the most learned because they are the most popular in industry.

It says nothing about what makes a language easy to learn.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: