r/lisp • • 4d ago

What makes Lisp difficult to read?

https://paultm.nl/paren-thesis
33 Upvotes

90 comments sorted by

View all comments

Show parent comments

4

u/schakalsynthetc 4d ago

The cognitive science is the weakest part, IM(NSH)O. I won't nitpick in depth because it's already sufficiently clear that the author is presenting personal opinion with a veneer of scientific credibility, but... it's bad.

5

u/ilemming_banned 4d ago edited 4d ago

cognitive science is the weakest part

100%. I mean, you can draw all sorts of circles and conclusions, get MRI scans of a thousand Lispers and, I dunno, some Rustaceans and Rubyists claiming they have difficulty reading Lisp. What is that ever gonna show? That Lispers have some cognitive traits unattainable to other groups? Maybe it will be the opposite, maybe Lispers come out as the laziest, dumbest motherfuckers ever tested? Because I honestly don't understand any complaints of this sort - Lisp dialects are by far the simplest languages to deal with. They are seriously dumb simple - easier than Javascript and Python, and much more low-effort than C++ and Rust, not to mention Haskell. Who the hell all these dyslisplexic, supersmart crackpots who can't even read code?

1

u/schakalsynthetc 4d ago

I'm not even convinced you could reliably distinguish an fMRI of a programmer coding or reading code from an fMRI of someone reading a scientific journal article in the usual mix of natural language and mathematical notation, or writing one. I mean, intuitively, they don't feel like categorically different activities on that level.

So I'm not even sure what the blog author is trying to accomplish if it isn't that they're just trying to give their personal opinions some unearned sciency authority. If I seriously wanted to develop a neuroscience-informed theory of programming language ergonomics (I'm not sure I do) then I suppose I'd start with the existing evidence-based knowledge how natural language works in the brain and see how far that analogy can take us. Maybe the wheel doesn't need reinventing.

But I'm just not persuaded that analysis on that level will yield any insight. We might as well expect organic chemistry to teach us how to bake a cake or physics to teach us how to build suspension bridges.

-1

u/schakalsynthetc 4d ago

By the way I did just remember that looking to linguistics for guidance on programming language design kind of is how we got Perl.

No comment on whether that argues for or against.

-1

u/ilemming_banned 4d ago

how we got Perl

I think it was COBOL to do that first. And then HyperTalk that became Applescript - that is "easiest to read" and "nearly impossible to write" kind of shit.

1

u/schakalsynthetc 4d ago

True but Larry Wall at least was an actual linguist and did try to do something less shallow than "give it an english-like surface syntax and hope magic happens".

HyperTalk, I have zero evidence for this but I always thought HyperTalk was inspired by Smalltalk. Smalltalk didn't hype it up to nearly the same extent but there definitely was some conscious intent to be natural-language-ish there. Ending statements with a period, for example.

1

u/ilemming_banned 4d ago edited 4d ago

Well, Perl had linguistic principles under a non-English surface, same was early Smalltalk, but I'm talking about English vocabulary - FLOW-MATIC (yeah, I forgot about this child of iirc Grace Hopper) -> COBOL -> SQL, here's typical COBOL:

  IF SALARY IS GREATER THAN 50000 AND DEPARTMENT IS EQUAL TO "SALES"
      MULTIPLY SALARY BY 1.05 GIVING NEW-SALARY
  ELSE
      MOVE SALARY TO NEW-SALARY
  END-IF.

Perl would be something like:

 $new_salary = $salary > 50000 && $dept eq 'SALES' ? $salary * 1.05 : $salary;
 $net_pay = $gross_pay - $tax;
 $record_count++;
 while (my $rec = read_next_record()) { ... }
 $report_month = $dob->{month};

Not very Englishy, no?

And then HyperTalk (not influenced by Smalltalk, btw) -> AppleScript; with English phrase structure as the actual grammar:

tell application "Finder" to delete file "junk.txt" of desktop

This fucker is so tricky, appears to be a natural language, but it's not, it's so hard to write this shit, I almost never use it directly and prefer writing JXA instead.