4 ms·
The point about `(+ 1 2)` v.s. `1+2` is about the fact that the LISP syntax generalizes to all computations, whereas mathematical expressions do not. The beauty
by quantadev 1y ago
The point about `(+ 1 2)` v.s. `1+2` is about the fact that the LISP syntax generalizes to all computations, whereas mathematical expressions do not. The beauty of LISP is that one simple syntax solves everything about computation in the axiomatically simplest way possible.
- lproven 1y ago> one simple syntax solves everything about computation in the axiomatically simplest way possible. So what about RPN? What about Forth and Postscript? Just as simple... just as terse... just as efficient... just as general. And, for me, just as unreadable.
- quantadev 1y agoI don't think RPN is as simple as parenthesis. All RPN does is replace the easy to get right parenthesis with difficult to get right newline characters.
- lproven 1y agoReverse Polish notation is every bit as easy, simple and minimal as Lispian prefix notation. They are mirror images of one another... and for most ordinary people, both are equally difficult to read or to use. And I include myself in this. Remember that for a lot of ordinary people, school algebra is almost impossible to follow and is the reason they stop studying maths as soon as they can. And that is simple infix notation.
- quantadev 1y ago> RPN is every bit as easy [as LISP] Riddle me this then: When editing code full of parentheticals, why do devs find it helpful that IDEs can find and highlight the matching opening/closing parenthesis automatically? I mean, based on your logic, parenthesis just don't make things any easier, right? I'll leave the topic of "indentation" completely off the table too, because a single riddle is enough.
- lproven 1y agoI don't know what side you think I am arguing for here, but it's not the one you're guessing.
- quantadev 1y agoYeah, I did't think you ever genuinely believed RPN is easier than LISP.
- lproven 1y agoNo, that is not true. Me personally? I dislike them both. I find them both unreadable. But both are compact and efficient... just really difficult. You are trying to put words in my mouth that are not there. That is very rude. Do not do that, ever. But also, as you have been throughout this thread, you are wrong.
- quantadev 1y agoThe parenthesis in LISP make it dramatically easier to deal with than RPN; and I don't believe for a millisecond that you objectively disagree with that fact.
- deleted 1y ago[deleted]
- kazinator 1y agoLisp would be vastly less readable if the parentheses were removed, and arity had to be worked out according to the definitions of the functions and operators, understood to be working on an implicit operand stack. Think about it: the entire class of error of mismatched stack height doesn't exist in Lisps. There could be an operand stack, if the Lisp is translated to a stack-based byte code; but it's managed so the programmer isn't concerned about it.
- quantadev 1y agoYeah, RPN is essentially what you'd get as output if you compiled LISP using a compiler. Claiming RPN is as easy to deal with as LISP would be utterly absurd, and no one genuinely believes that.
- kazinator 1y agoWell, RPN with parentheses, as a layer of syntax, would be easy to deal with. That's what Lisp backwards would be. ((a b +) (a b) add defun) (((list pop) print) list while) It helps me to read it in Japanese: "A to B wo tasu, A to B no paramēta no aru, 'add' to iu kansuu wo 'defun' shite." "lisuto wo 'pop' shite, sore wo insatsu shite, lisuto ga kara de nai aida ni" Interesting things happen. When we think about how 'add' is called, we follow it from right to left, contrary to the direction of speech of the Japanese sentence. The function add is called, the (a b) parameters receive argument values and the (a b +) is evaluated. However, the chained application expressed by nesting, which people complain about being backwards (so they need to invent piping/threading macros to go left to right) now reads left to right! We do have to evaluate the while condition first, but then the pop and print to left to right.
- quantadev 1y agoYeah, the Japanese incorrectly put verbs at the end of the sentence! Just like Yoda does. Asian he must be. Incorrect they all are. But seriously, yeah computers are naturally 'Stack Machines' [almost] always, where they need the arguments pushed onto a stack before the 'verb' is executed.