News for hackers. Stuff that matters.
Re:Blub Paradox (2014) by kazinator on Tuesday January 08, 2019 @11:09AM (#18856556)
There is no such thing as "intrinsic meaning", and I think you might be confusing "human language" and "english-like". There is astonishing variation in human language.
Re:Blub Paradox (2014) by rspeele on Tuesday January 08, 2019 @03:21PM (#18859275)
I really like Lisp and its macros and I don't even mind the sea of parentheses. But I do think requiring everything to be done in prefix notation is a weakness. This is an argument I have seen -- it may not be the one you are trying to make, but your statement reminded me of it:

"No programming language is more or less natural than Lisp. It is merely a matter of familiarity and the way most programmers were taught."

One obvious problem is that familiarity does matter. Even ignoring all other programming languages, there is a barrier to climb for the vast numbers of beginner programmers who know English and common math notation like f(x) instead of (f x) and x < y instead of (< x y). I've also seen (- x y) be confusing as one incorrect way to read it as English in your head is "subtract x from y".

The other is that for some things, it really does seem like infix notation is inherently preferred by humans. Is there a natural language where conjunctions don't go between terms, i.e. one says "und x y z" instead of "x und y und z"?

Re:Blub Paradox (2014) by jhbadger on Tuesday January 08, 2019 @04:35PM (#18859955)
Functions are more like verbs than conjugations. And Verb Subject Object (which is rather lisp-like) is not uncommon among natural languages. Arabic and Biblical Hebrew (Modern Hebrew not so much due to influence from Western languages) use that order a lot.
Re:Blub Paradox (2014) by rspeele on Tuesday January 08, 2019 @05:19PM (#18860324)
That's just fine for things that are function calls in any language. I have no preference between log(x, 10) or (log x 10).

But I do want to read some functions like conjunctions, and in Lisp, I am forced to call `and`, `or`, `<`, `/`, and pals the same way as log, print, etc. I just don't think I'll ever find:

    (and (not (is-blocked door))
         (< (height player) (height door))
         (or (is-unlocked door)
             (has-key player door)))
as readable as:

    not is_blocked(door)
    and height(player) < height(door)
    and (is_unlocked(door) or has_key(player, door))
Edit: to expand, I don't think it's a fundamental flaw of Lisp. There could easily be some syntax sugar that lets you specify precedence rules for functions and write them infix, just like Haskell lets you write either `(+) 1 2` or `1 + 2`. It would de-sugar to the same sexpr.

I know this can be done as a macro, in fact I did it for elisp several years ago ( https://github.com/rspeele/infix.el ) but it is really just a toy for personal use. If an infix operator system came out of the box and its use was encouraged for certain common operators, I think that would be a net positive, but most Lispers disagree with me there (if I had to guess).

Re:Blub Paradox (2014) by kazinator on Tuesday January 08, 2019 @07:13PM (#18861120)
The Lisp expression is a nice sideways tree, where we immediately see that three conditions are joined by and. When I look at it, I see this:

     and --.-- not (is-blocked door)
           :-- < (height player) (height door)
           `-- or --.---(is-unlocked door)
                     `--(has-key player door)
The other one looks like a bit of a lorem ipsum paragraph to me.
Re:Blub Paradox (2014) by rspeele on Tuesday January 08, 2019 @08:34PM (#18861557)
I guess it comes down to different strokes for different folks. It would be interesting if there was a website that quizzed you on randomly generated expressions like these, giving you S-expr forms sometimes and ALGOL/infix operator forms other times, and asking you whether the expression is true or false given a set of variable values.

Naively I would guess that I would do best on infix exprs and you would do best on s-exprs.

But I could imagine other results, like s-exprs giving me a speed disadvantage but an accuracy advantage (either because I had to read them more carefully or because they eliminate reliance on precedence rules). Or there may be other quirks, like maybe S-exprs read better for larger, multiline conditions while infix reads better on short one-liners with <= 3 operations.

It reeks of effort so I'm not going to make such a site, but I do wonder what the results would be.

Re:Blub Paradox (2014) by mcv on Wednesday January 09, 2019 @05:00AM (#18863617)
That may be fine for ancient Jews and Arabs, but it still presents a bit of an obstacle to speakers of Germanic languages, including English. With the exception of Yoda, I suppose. I bet Lisp would be totally natural to him.