Remix.run Logo
taylorallred 3 hours ago

I was really interested in lisps for a couple of years, but eventually I came to the conclusions: it's just hard to read. I know they say "the parens disappear" but even if that is the case, it simply requires you to jump around the expression holding lots of context in your head. I'm a fan of code that mostly reads top-to-bottom, left-to-right.

reikonomusha 2 hours ago | parent | next [-]

Lisp code is written top to bottom, left to right. Is your grievance more to do with expression-oriented—as opposed to statement-oriented—languages? "Do this" (statement) vs "represent this" (expression)? For instance, do Haskell, OCaml, etc. also irk you in similar ways?

Avshalom 2 hours ago | parent [-]

Lisp is written top to bottom left to right but because it's (almost) fully nested it's executed right to left bottom to top.

Haskell and OCaml are, by comparison, not very nested.

reikonomusha 2 hours ago | parent [-]

This is not true.

    (defun f (x)
      (let ((y x))
        (setf y (* y x))
        (block foo
          (if (minusp y)
              (return-from foo y))
          (loop :for i :from 1 :to 10 :do
            ...
This is absolutely typical bog-standard left-to-right top-to-bottom structured programming type code. It also must be executed like so:

  - Define the function 
  - Bind the variable 
  - Mutate the variable
  - Set up a named block
  - Do a conditional return
  - Run a loop
  - ...
The order of execution literally matches the order it's written. But not unlike almost all other languages on the planet, expressions are evaluated inside-out.

Haskell's whole raison d'etre is to allow arbitrary nesting and substitution of terms, and all or none of these terms may or may not be evaluated depending on need. De-nesting happens with a copious number of syntax to bind names to values, sometimes before the expression (via let), sometimes after the expression (via where), and sometimes in the middle of an expression (via do).

FranklinJabar 3 hours ago | parent | prev [-]

> I'm a fan of code that mostly reads top-to-bottom, left-to-right.

Programs are rarely linear; why do you expect code to be?