• Lisp history: IF, etc.

    From Alan Bawden@21:1/5 to All on Tue Apr 2 14:38:25 2024
    XPost: comp.lang.misc

    Kaz Kylheku <643-408-1753@kylheku.com> writes:

    ... The code is from just before MacCarthy invented the ternary IF,
    as a shorthand for a one clause cond: ...

    I don't think that McCarthy invented IF as an abbreviation for COND, but
    I could be wrong. He certainly _could_ have invented it, but if he did,
    it was forgotten by the mid 1970s. Defining IF as a _personal_ macro was common practice for 1970s Lisp programmers, and I don't think IF was
    provided as standard by _any_ major Lisp implementation at that time.
    (Maybe InterLisp did? I don't recall, and I no longer have an InterLisp
    manual on my bookshelf.) Scheme had IF _instead_ of COND, but nobody
    was using Scheme for anything serious yet. And I don't think the T
    project had started at that point.

    In fact, when the Lisp Machine group decided to introduce a standard IF
    macro into Lisp Machine Lisp, we were a bit worried that another
    significant body of Lisp code was already using a slightly different
    syntax for IF than the one we wanted to use. Multics Emacs (written in
    Multics MacLisp) had popularized an IF macro that used an ELSE keyword
    somehow. We negotiated a deal with the Multics guys (Bernie Greenberg)
    where they agreed to change their IF to guarantee that an IF with no
    ELSE keyword would work exactly the same way ours did.

    This was perhaps the very beginning of the road that eventually led us
    to Common Lisp. A bunch of Lisp implementations (Lisp Machine Lisp, NIL
    and both branches of MacLisp) all introduced a bunch of new syntax (IF,
    LET, DEFSTRUCT, SETF, backquote, sharpsign, etc.) into their standard environment so that individual programmers and programs no longer had to
    define them themselves.

    But I'd love to see evidence that McCarthy arrived at ternary IF before
    anyone else. He certainly invented COND, where the interesting thing
    about COND was that it was an _expression_ rather than a statement, so
    we often say that "McCarthy invented the conditional expression". And sometimes that gets shortened to "McCarthy invented the if-expression".
    But I don't think that he ever literally wrote "(IF ...)" rather than
    "(COND ...)".

    I'm not even sure that McCarthy would have seen the advantage of IF over
    COND given that what he originally wanted us all to write was actually
    "[expr -> expr; expr]"!

    - Alan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Alan Bawden on Tue Apr 2 19:44:30 2024
    On 2024-04-02, Alan Bawden <alan@csail.mit.edu> wrote:
    But I'd love to see evidence that McCarthy arrived at ternary IF before anyone else.

    I seem to be aware of at least some urban legend along these lines.
    From your detailed historic "been there" understanding, that's what it
    must be.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?utf-8?Q?G=C4=B3s_Hillenius?=@21:1/5 to All on Wed Apr 3 08:34:42 2024
    On 2 April 2024 14:38 Alan Bawden, wrote:

    Kaz Kylheku <643-408-1753@kylheku.com> writes:

    ... The code is from just before MacCarthy invented the ternary IF,
    as a shorthand for a one clause cond: ...

    I don't think that McCarthy invented IF as an abbreviation for COND, but
    I could be wrong. He certainly _could_ have invented it, but if he did,
    it was forgotten by the mid 1970s. Defining IF as a _personal_ macro was common practice for 1970s Lisp programmers, and I don't think IF was
    provided as standard by _any_ major Lisp implementation at that time.
    (Maybe InterLisp did? I don't recall, and I no longer have an InterLisp manual on my bookshelf.)


    "If" is available in Medley, (https://interlisp.org/):

    ,----
    | (IF X COMS₁)
    |
    | If [EVAL X]is true, execute COMS₁; otherwise generate an error.
    `----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Madhu@21:1/5 to All on Wed Apr 3 14:59:31 2024
    * Alan Bawden <86h6gjpq3i.fsf_-_@williamsburg.bawden.org> :
    Wrote on Tue, 02 Apr 2024 14:38:25 -0400:
    I don't think that McCarthy invented IF as an abbreviation for COND, but
    I could be wrong. He certainly _could_ have invented it, but if he did,
    it was forgotten by the mid 1970s. Defining IF as a _personal_ macro was common practice for 1970s Lisp programmers, and I don't think IF was
    provided as standard by _any_ major Lisp implementation at that time.
    (Maybe InterLisp did? I don't recall, and I no longer have an InterLisp manual on my bookshelf.) Scheme had IF _instead_ of COND, but nobody
    was using Scheme for anything serious yet. And I don't think the T
    project had started at that point.

    In fact, when the Lisp Machine group decided to introduce a standard IF
    macro into Lisp Machine Lisp, we were a bit worried that another
    significant body of Lisp code was already using a slightly different
    syntax for IF than the one we wanted to use. Multics Emacs (written in Multics MacLisp) had popularized an IF macro that used an ELSE keyword somehow. We negotiated a deal with the Multics guys (Bernie Greenberg)
    where they agreed to change their IF to guarantee that an IF with no
    ELSE keyword would work exactly the same way ours did.

    This was perhaps the very beginning of the road that eventually led us
    to Common Lisp. A bunch of Lisp implementations (Lisp Machine Lisp, NIL
    and both branches of MacLisp) all introduced a bunch of new syntax (IF,
    LET, DEFSTRUCT, SETF, backquote, sharpsign, etc.) into their standard environment so that individual programmers and programs no longer had to define them themselves.

    But I'd love to see evidence that McCarthy arrived at ternary IF before anyone else. He certainly invented COND, where the interesting thing
    about COND was that it was an _expression_ rather than a statement, so
    we often say that "McCarthy invented the conditional expression". And sometimes that gets shortened to "McCarthy invented the if-expression".
    But I don't think that he ever literally wrote "(IF ...)" rather than
    "(COND ...)".

    I've forgotten the distinction between a statement and an expression in
    lisp. Maybe someone can remind me. is it that IF is a special operator
    but COND is a macro? From the point of view of surface syntax, aren't
    they the same sort of beast? Both evaluate to a result which can be
    uses elsewhere, so they can't be "statements" in the sense of other
    programming languages.

    I'm not even sure that McCarthy would have seen the advantage of IF over
    COND given that what he originally wanted us all to write was actually
    "[expr -> expr; expr]"!

    CLHS has

    (if test-form then-form else-form)
    == (cond (test-form then-form) (t else-form))

    so by inventing COND he had already invented IF, and probably felt
    secure enough and not compelled publish another result

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan Bawden@21:1/5 to All on Wed Apr 3 14:15:14 2024
    Madhu <enometh@meer.net> writes:

    * Alan Bawden <86h6gjpq3i.fsf_-_@williamsburg.bawden.org> :
    Wrote on Tue, 02 Apr 2024 14:38:25 -0400:
    > ...
    > But I'd love to see evidence that McCarthy arrived at ternary IF before
    > anyone else. He certainly invented COND, where the interesting thing
    > about COND was that it was an _expression_ rather than a statement, so
    > we often say that "McCarthy invented the conditional expression". And
    > sometimes that gets shortened to "McCarthy invented the if-expression".
    > But I don't think that he ever literally wrote "(IF ...)" rather than
    > "(COND ...)".

    I've forgotten the distinction between a statement and an expression in
    lisp. Maybe someone can remind me. is it that IF is a special operator
    but COND is a macro? From the point of view of surface syntax, aren't
    they the same sort of beast? Both evaluate to a result which can be
    uses elsewhere, so they can't be "statements" in the sense of other
    programming languages.

    Lisp doesn't really have statements _because_ McCarthy invented the
    conditional expression. That's kind of the point. Other programming
    languages at the time (e.g. FORTRAN and ALGOL) only had conditional
    statements. McCarthy invented the conditional expression and thus
    created the first expression-only programming language.

    > I'm not even sure that McCarthy would have seen the advantage of IF over
    > COND given that what he originally wanted us all to write was actually
    > "[expr -> expr; expr]"!

    CLHS has

    (if test-form then-form else-form)
    == (cond (test-form then-form) (t else-form))

    so by inventing COND he had already invented IF, and probably felt
    secure enough and not compelled publish another result

    The original claim I was responding to was that McCarthy had invented IF
    "as a shorthand for a one clause COND". That certainly wouldn't have
    been worth publishing as a result in itself. But it would certainly be possible for him to have introduced an IF shorthand _in passing_ in the
    course of doing something else -- like in some Lisp code he wrote to do something of real interest. But there seems to be no evidence for that.

    To summarize:

    (1) McCarthy invented the conditional expression, written in his
    M-expression language as:
    [expr -> expr; expr -> expr; T -> expr]

    (2) McCarthy also invented the S-expression representation for that as:
    (COND (expr expr) (expr expr) (T expr))

    (3) But there is no evidence that McCarthy ever, for _any_ reason, ever
    wrote:
    (IF expr expr expr)

    People sometimes sloppily say that "McCarthy invented the
    if-expression", by which they really mean just (1). It is also true
    that McCarthy invented (2) the COND S-expression, but there is nothing particularly interesting about that, it was just part of the encoding he invented for representing M-expressions as S-expressions. (For which he
    also invented the LAMBDA, QUOTE and LABEL S-expressions.) But there
    seems to be no evidence that McCarthy ever invented (3) an "IF
    S-expression" for any reason whatsoever.

    - Alan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Alan Bawden on Wed Apr 3 20:57:48 2024
    On 2024-04-03, Alan Bawden <alan@csail.mit.edu> wrote:
    Lisp doesn't really have statements _because_ McCarthy invented the conditional expression. That's kind of the point. Other programming languages at the time (e.g. FORTRAN and ALGOL) only had conditional statements. McCarthy invented the conditional expression and thus
    created the first expression-only programming language.

    However, conditional expressions ultimately come from math. E.g for
    specifying a discontinuous function:

    f(x) = { x, if x >= 0
    { 0, if x < 0

    If you think about it, it's actually kind of ignorant to invent a
    programming language with imperative if statements, but in which where
    the math conditional is missing.

    People sometimes sloppily say that "McCarthy invented the
    if-expression", by which they really mean just (1). It is also true

    That could be the origin of the misconception; someone is going to
    take that sort of statement literally.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to Alan Bawden on Wed Apr 3 13:56:46 2024
    Alan Bawden <alan@csail.mit.edu> writes:
    McCarthy invented the conditional expression and thus created the
    first expression-only programming language.

    I think Church's lambda calculus also had this.

    https://en.wikipedia.org/wiki/Church_encoding#Church_Booleans

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan Bawden@21:1/5 to Alan Bawden on Wed Apr 3 17:54:51 2024
    Paul Rubin <no.email@nospam.invalid> writes:

    Alan Bawden <alan@csail.mit.edu> writes:
    > McCarthy invented the conditional expression and thus created the
    > first expression-only programming language.

    I think Church's lambda calculus also had this.

    https://en.wikipedia.org/wiki/Church_encoding#Church_Booleans

    Yeah, I though about that while I was composing my previous message, but
    my life is finite, so I didn't go there. But this is Usenet, so we are
    forced to explore every side issue until we all drop dead of exhaustion.

    So does Lambda Calculus qualify as a programming language? Well _today_
    we would all say yes, because we have examples of purely functional
    programming languages where evaluation is lazy and so we don't need a
    special operator for conditional evaluation. But when McCarthy was
    inventing Lisp, nobody thought that pure Lambda Calculus was anything
    like a programming language. It's only since then that we've done the
    work to make that practical.

    So I _could_ argue that in 1958 Lambda Calculus was _not_ a programming language, but today in 2024 Lambda Calculus _is_ a programming language,
    even though Lambda Calculus didn't change in any way!

    But given the way being a "programming language" was understood in 1958,
    nobody was going to invent an expression-only programming language until
    they first invented the conditional expression. So thank you John
    McCarthy.

    - Alan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to Alan Bawden on Wed Apr 3 15:29:52 2024
    Alan Bawden <alan@csail.mit.edu> writes:
    But when McCarthy was inventing Lisp, nobody thought that pure Lambda Calculus was anything like a programming language.

    Ah ok, that was before my time. I had been under the impression that
    Lisp had started as lambda calculus with some concessions to
    practicality added.

    https://en.wikipedia.org/wiki/Lisp_(programming_language)#History

    gives that impression too.

    It's only since then that we've done the work to make that practical.

    Does Scheme not count? I think lazy evaluation is not needed since the
    input to the Church boolean (I hope I have the jargon right) is two
    lambda abstractions. The boolean selects one of them, and the result is applied to whatever the next thing is.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan Bawden@21:1/5 to Alan Bawden on Wed Apr 3 18:35:49 2024
    Kaz Kylheku <643-408-1753@kylheku.com> writes:

    On 2024-04-03, Alan Bawden <alan@csail.mit.edu> wrote:
    > Lisp doesn't really have statements _because_ McCarthy invented the
    > conditional expression. That's kind of the point. Other programming
    > languages at the time (e.g. FORTRAN and ALGOL) only had conditional
    > statements. McCarthy invented the conditional expression and thus
    > created the first expression-only programming language.

    However, conditional expressions ultimately come from math. E.g for
    specifying a discontinuous function:

    f(x) = { x, if x >= 0
    { 0, if x < 0

    If you think about it, it's actually kind of ignorant to invent a
    programming language with imperative if statements, but in which where
    the math conditional is missing.

    If you think like a historian, you don't describe this as "ignorant".
    It's just not something that was above the horizon in the mind set of
    the time. After all, that mathematical notation you are referring to
    isn't something that mathematicians get very formal about. It has a
    status that's midway between being able to define something using a
    simple equation, and having to resort to a definition in the form of a paragraph of words. Realizing that you could tighten that notation up
    and use it in a programming language _as a kind of expression_ is
    actually a bit of a leap.

    > People sometimes sloppily say that "McCarthy invented the
    > if-expression", by which they really mean just (1). It is also true

    That could be the origin of the misconception; someone is going to
    take that sort of statement literally.

    Yes, that was exactly my point.

    - Alan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Alan Bawden on Wed Apr 3 23:12:12 2024
    On 2024-04-03, Alan Bawden <alan@csail.mit.edu> wrote:
    Kaz Kylheku <643-408-1753@kylheku.com> writes:

    On 2024-04-03, Alan Bawden <alan@csail.mit.edu> wrote:
    > Lisp doesn't really have statements _because_ McCarthy invented the
    > conditional expression. That's kind of the point. Other programming
    > languages at the time (e.g. FORTRAN and ALGOL) only had conditional
    > statements. McCarthy invented the conditional expression and thus
    > created the first expression-only programming language.

    However, conditional expressions ultimately come from math. E.g for
    specifying a discontinuous function:

    f(x) = { x, if x >= 0
    { 0, if x < 0

    If you think about it, it's actually kind of ignorant to invent a
    programming language with imperative if statements, but in which where
    the math conditional is missing.

    If you think like a historian, you don't describe this as "ignorant".
    It's just not something that was above the horizon in the mind set of
    the time. After all, that mathematical notation you are referring to
    isn't something that mathematicians get very formal about.

    That is a fair observation; roughly speaking, higher languages first
    evolved from that of the machine. Why we have an if /statement/ is that
    the machine has testing and branching in its instruction set, which are
    also statements. The imperative language that works by jumping around
    and shuffling mainly word-sized quantities inside a Von Neumann machine
    is an abstraction of machine language, not an abstraction of functions.

    The abstraction of machine language isn't ignorant, it's just different.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Kaz Kylheku on Wed Apr 3 23:16:46 2024
    On 2024-04-03, Kaz Kylheku <643-408-1753@kylheku.com> wrote:
    On 2024-04-03, Alan Bawden <alan@csail.mit.edu> wrote:
    Kaz Kylheku <643-408-1753@kylheku.com> writes:
    If you think about it, it's actually kind of ignorant to invent a
    programming language with imperative if statements, but in which where
    the math conditional is missing.

    If you think like a historian, you don't describe this as "ignorant".
    It's just not something that was above the horizon in the mind set of
    the time. After all, that mathematical notation you are referring to
    isn't something that mathematicians get very formal about.

    That is a fair observation; roughly speaking, higher languages first
    evolved from that of the machine. Why we have an if /statement/ is that
    the machine has testing and branching in its instruction set, which are
    also statements. The imperative language that works by jumping around
    and shuffling mainly word-sized quantities inside a Von Neumann machine
    is an abstraction of machine language, not an abstraction of functions.

    The abstraction of machine language isn't ignorant, it's just different.

    But, right, okay; I lost a thoguht I had some hours earlier about this.
    By the time we have a higher level language inspired by math formulas in
    which you can do A * B + C, and define math-like functions, you would
    think that the right synapse would fire between the right two brain
    cells, so that a value-yielding conditional would be supplied. When you
    have translation of arithmetic formulas to machine language, the scene
    is ripe for such an operator. So maybe ignorance is a strong word, but
    there is a margin for disappointment.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ben Bacarisse@21:1/5 to Alan Bawden on Thu Apr 4 00:22:14 2024
    Alan Bawden <alan@csail.mit.edu> writes:

    Paul Rubin <no.email@nospam.invalid> writes:

    Alan Bawden <alan@csail.mit.edu> writes:
    > McCarthy invented the conditional expression and thus created the
    > first expression-only programming language.

    I think Church's lambda calculus also had this.

    https://en.wikipedia.org/wiki/Church_encoding#Church_Booleans

    Yeah, I though about that while I was composing my previous message, but
    my life is finite, so I didn't go there. But this is Usenet, so we are forced to explore every side issue until we all drop dead of exhaustion.

    So does Lambda Calculus qualify as a programming language? Well _today_
    we would all say yes, because we have examples of purely functional programming languages where evaluation is lazy and so we don't need a
    special operator for conditional evaluation. But when McCarthy was
    inventing Lisp, nobody thought that pure Lambda Calculus was anything
    like a programming language. It's only since then that we've done the
    work to make that practical.

    Pinning down exactly constitutes a programming language is not going to
    be very fruitful! But Church invented the lambda calculus to define
    what "effectively computable" or "effective procedure" means. (He was interested in the Entscheidungsproblem). Its purpose was to capture the
    notion of symbolic actions that could be performed "mechanically" but
    without a physical mechanism. That was the whole point. Is that a
    programming language? I'll pass on that, but it's clearly a notation
    for writing abstract computations.

    So I _could_ argue that in 1958 Lambda Calculus was _not_ a programming language, but today in 2024 Lambda Calculus _is_ a programming language,
    even though Lambda Calculus didn't change in any way!

    It's more helpful, I think, to consider what McCarthy would have around
    as influences. Did he know of the work by Church (and Kleene and
    Rosser)? Surely he did. But Church's Booleans put a very different
    spin on conditional expressions, so I say it's fair to say that what we
    see in early Lisp is McCarthy's own.

    --
    Ben.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Julieta Shem@21:1/5 to Alan Bawden on Wed Apr 3 20:30:14 2024
    Alan Bawden <alan@csail.mit.edu> writes:

    Kaz Kylheku <643-408-1753@kylheku.com> writes:

    On 2024-04-03, Alan Bawden <alan@csail.mit.edu> wrote:
    > Lisp doesn't really have statements _because_ McCarthy invented the
    > conditional expression. That's kind of the point. Other programming
    > languages at the time (e.g. FORTRAN and ALGOL) only had conditional
    > statements. McCarthy invented the conditional expression and thus
    > created the first expression-only programming language.

    However, conditional expressions ultimately come from math. E.g for
    specifying a discontinuous function:

    f(x) = { x, if x >= 0
    { 0, if x < 0

    If you think about it, it's actually kind of ignorant to invent a
    programming language with imperative if statements, but in which where
    the math conditional is missing.

    If you think like a historian, you don't describe this as "ignorant".
    It's just not something that was above the horizon in the mind set of
    the time. After all, that mathematical notation you are referring to
    isn't something that mathematicians get very formal about.

    So true.

    It has a status that's midway between being able to define something
    using a simple equation, and having to resort to a definition in the
    form of a paragraph of words. Realizing that you could tighten that
    notation up and use it in a programming language _as a kind of
    expression_ is actually a bit of a leap.

    There's a paper from 1961--1963 in which he defines the conditional
    expression with the intention of being able to define functions
    recursively.

    --8<---------------cut here---------------start------------->8---
    A BASIS FOR A MATHEMATICAL THEORY OF COMPUTATION
    JOHN McCARTHY
    1961--1963

    [This 1963 paper was included in Computer Programming and Formal Sys-
    tems, edited by P. Braffort and D. Hirshberg and published by
    North-Holland. An earlier version was published in 1961 in the
    Proceedings of the Western Joint Computer Conference.]

    [...]

    The present paper is an attempt to create a basis for a mathematical
    theory of computation. [...]

    [...]

    2.1 Functions Computable in Terms of Given Base Functions

    Suppose we are given a base collection F of functions (including
    predicates) having certain domains and ranges. [...] Our object is to
    define a class of functions C{F} which we shall call the class of
    functions computable in terms of F. Before developing C{F} formally,
    we wish to give an example, and in order to give the example, we first
    need the concept of conditional expression. In our notation a
    conditional expression has the form

    (p1 → e1, p2 → e2, . . . , pn → en)

    which corresponds to the ALGOL 60 reference language (12) expression

    if p1 then e1 else if p2 then e2 . . . else if pn then en.

    [...]

    Some examples of the conditional expressions for well known functions
    are |x| = (x < 0 → -x, x >= 0 → x) [...]

    Now we are ready to use conditional expressions to define functions
    recursively. For example, we have

    n! = (n = 0 → 1, n =/= 0 → n · (n − 1)!)

    [...]
    --8<---------------cut here---------------end--------------->8---

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Alan Bawden on Thu Apr 4 00:07:54 2024
    On Wed, 03 Apr 2024 14:15:14 -0400, Alan Bawden wrote:

    Other programming languages at the time (e.g. FORTRAN and ALGOL) only
    had conditional statements.

    Algol60 had if-expressions, e.g.

    a := if b then c else d

    Fortran had loop expressions, but they were only allowed in I/O
    statements.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Paul Rubin on Thu Apr 4 00:11:17 2024
    On Wed, 03 Apr 2024 15:29:52 -0700, Paul Rubin wrote:

    I think lazy evaluation is not needed since the
    input to the Church boolean (I hope I have the jargon right) is two
    lambda abstractions. The boolean selects one of them, and the result is applied to whatever the next thing is.

    I use this in Python, to try to avoid that abortion that is the Python conditional expression. Instead of, say,

    a = x / y if y != 0 else 0

    I would do

    a = (lambda : 0, lambda : x / y)[y != 0]()

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Julieta Shem@21:1/5 to Kaz Kylheku on Wed Apr 3 20:37:56 2024
    Kaz Kylheku <643-408-1753@kylheku.com> writes:

    On 2024-04-03, Kaz Kylheku <643-408-1753@kylheku.com> wrote:
    On 2024-04-03, Alan Bawden <alan@csail.mit.edu> wrote:
    Kaz Kylheku <643-408-1753@kylheku.com> writes:
    If you think about it, it's actually kind of ignorant to invent a
    programming language with imperative if statements, but in which where >>> the math conditional is missing.

    If you think like a historian, you don't describe this as "ignorant".
    It's just not something that was above the horizon in the mind set of
    the time. After all, that mathematical notation you are referring to
    isn't something that mathematicians get very formal about.

    That is a fair observation; roughly speaking, higher languages first
    evolved from that of the machine. Why we have an if /statement/ is that
    the machine has testing and branching in its instruction set, which are
    also statements. The imperative language that works by jumping around
    and shuffling mainly word-sized quantities inside a Von Neumann machine
    is an abstraction of machine language, not an abstraction of functions.

    The abstraction of machine language isn't ignorant, it's just different.

    But, right, okay; I lost a thoguht I had some hours earlier about this.
    By the time we have a higher level language inspired by math formulas in which you can do A * B + C, and define math-like functions, you would
    think that the right synapse would fire between the right two brain
    cells, so that a value-yielding conditional would be supplied. When you
    have translation of arithmetic formulas to machine language, the scene
    is ripe for such an operator. So maybe ignorance is a strong word, but
    there is a margin for disappointment.

    But it's not the same disappointment as in having to use JIRA, right? :-)

    ``Writing bug reports on napkins and keeping them crumpled in a large
    black garbage bag is better than this fucking piece of crap called
    JIRA.'' -- Kaz Kylheku, 2016.

    (*) Full source

    --8<---------------cut here---------------start------------->8---
    X-Received: by 10.200.47.116 with SMTP id k49mr3706471qta.61.1474251695757;
    Sun, 18 Sep 2016 19:21:35 -0700 (PDT)
    X-BeenThere: comp.programming@googlegroups.com
    Received: by 10.157.2.1 with SMTP id 1ls4320407otb.4.gmail; Sun, 18 Sep 2016
    19:21:33 -0700 (PDT)
    X-Received: by 10.157.2.104 with SMTP id 95mr3727234otb.133.1474251693667;
    Sun, 18 Sep 2016 19:21:33 -0700 (PDT)
    MIME-Version: 1.0
    Path: b4ni5152iti.0!nntp.google.com!news.glorb.com!2.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!enother.net!enother.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail
    From: Kaz Kylheku <221-50...@kylheku.com>
    Newsgroups: alt.comp.os.linux,comp.programming,comp.software-eng
    Subject: Re: Favourite Software Development Tools for Teams?
    Followup-To: comp.programming
    Date: Mon, 19 Sep 2016 02:21:29 +0000 (UTC)
    Organization: Aioe.org NNTP Server
    Lines: 11
    Message-ID: <20160918192003.449@kylheku.com>
    References: <E9HDz.15308$LX2.8752@fx36.iad>
    NNTP-Posting-Host: OGJi3KNpFOhM58UHZwXj0w.user.gioia.aioe.org
    X-Complaints-To: ab...@aioe.org
    User-Agent: slrn/pre1.0.0-18 (Linux)
    X-Notice: Filtered by postfilter v. 0.8.2

    ["Followup-To:" header set to comp.programming.]
    On 2016-09-19, Triscal Islington <trust.your...@mail.ru> wrote:
    I'm finally heading my own software engineering project at work and,
    since I call the shots, it's up to me to decide on what collaboration
    and review tools we utilize on the project.

    I'm pretty well decided on git for source code management but what are
    your favourite linux tool for bug tracking, code review, collaboration, etc?

    Writing bug reports on napkins and keeping them crumpled in a large
    black garbage bag is better than this fucking piece of crap called JIRA. --8<---------------cut here---------------end--------------->8---

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan Bawden@21:1/5 to Alan Bawden on Wed Apr 3 22:15:02 2024
    Paul Rubin <no.email@nospam.invalid> writes:

    Alan Bawden <alan@csail.mit.edu> writes:
    > But when McCarthy was inventing Lisp, nobody thought that pure Lambda
    > Calculus was anything like a programming language.

    Ah ok, that was before my time. I had been under the impression that
    Lisp had started as lambda calculus with some concessions to
    practicality added.

    https://en.wikipedia.org/wiki/Lisp_(programming_language)#History

    gives that impression too.

    It's a common misconception that McCarthy was trying to turn Lambda
    Calculus into a programming language. But if you read what he was
    writing at the time you will find that he was actually trying to turn
    First Order Predicate Calculus (FOPC, i.e. Mathematical Logic) into a programming language. He added LAMBDA (and LABEL) because he needed
    LAMBDA in order to define recursive functions, but as he himself often admitted, he didn't really understand Lambda Calculus, he just needed
    the notation. He _did_ understand FOPC.

    Once you understand his true goal, a lot of history becomes more clear.
    For example, it explains why McCarthy often talked about conditional expressions as such an important idea, while he devoted much less ink to
    lambda expressions. From our point of view it's clear that adding
    LAMBDA to a programming language was more significant then adding COND,
    but that's not how he saw things at the time.

    It also explains how Common Lisp wound up being a Lisp-2. We have
    separate namespaces for functions and values because that's how FOPC
    works, so that's how Lisp 1.5 was supposed to work. (It doesn't
    _actually_ work that way, but it's clear from the manual that that's how
    you're supposed to think about it!) Most Lisps followed Lisp 1.5 down
    that path.

    > It's only since then that we've done the work to make that practical.

    Does Scheme not count? I think lazy evaluation is not needed since the
    input to the Church boolean (I hope I have the jargon right) is two
    lambda abstractions. The boolean selects one of them, and the result is
    applied to whatever the next thing is.

    When I wrote "make that practical" I was referring to using Lambda
    Calculus _directly_ as a practical programming language. And no, I
    don't think that Scheme lets you do that. Even ignoring how
    inconvenient it would be to wrap lambdas around both arms of all your conditionals, the big problem is what do you do about side effects like
    I/O? You really need Monads (or something like them) in order to make
    that work, and it wasn't until sometime in the 1980s that anybody
    figured that out. And I'm not even sure that Haskel (for example)
    counts as using Lambda Calculus directly as a programming language. It
    seems like there are a lot of ideas knocking around in Haskel that are
    well beyond what Church invented!

    But all this happened well after McCarthy developed Lisp. If you had
    told anyone in 1960 that they should look to Lambda Calculus for useful insights into how to design a programming language, they probably would
    have thought it was just about as relevant as Turing Machines are to
    designing actual computing hardware -- perhaps not completely
    irrelevant, but not a very practical.

    - Alan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan Bawden@21:1/5 to Alan Bawden on Wed Apr 3 22:29:50 2024
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Wed, 03 Apr 2024 14:15:14 -0400, Alan Bawden wrote:

    > Other programming languages at the time (e.g. FORTRAN and ALGOL) only
    > had conditional statements.

    Algol60 had if-expressions, e.g.

    a := if b then c else d

    Ah yes, the history is slightly more complicated than I remembered.
    Algol 58 did not have conditional expressions. But McCarthy then joined
    the Algol committee and he suggested that they add conditional
    expressions. And so they do appear in Algol 60.

    - Alan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Alan Bawden on Thu Apr 4 03:53:00 2024
    On 2024-04-04, Alan Bawden <alan@csail.mit.edu> wrote:
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Wed, 03 Apr 2024 14:15:14 -0400, Alan Bawden wrote:

    > Other programming languages at the time (e.g. FORTRAN and ALGOL) only
    > had conditional statements.

    Algol60 had if-expressions, e.g.

    a := if b then c else d

    Ah yes, the history is slightly more complicated than I remembered.
    Algol 58 did not have conditional expressions. But McCarthy then joined
    the Algol committee and he suggested that they add conditional
    expressions. And so they do appear in Algol 60.

    Aha, that could also be the source of the idea that MacCarthy came up
    with the ternary IF. (Is it documented whether he actually suggested the three-operand one, or something more COND like that the committee
    whittled down to the above form?)

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Alan Bawden on Thu Apr 4 04:28:01 2024
    On 2024-04-02, Alan Bawden <alan@csail.mit.edu> wrote:
    Kaz Kylheku <643-408-1753@kylheku.com> writes:

    ... The code is from just before MacCarthy invented the ternary IF,
    as a shorthand for a one clause cond: ...

    I don't think that McCarthy invented IF as an abbreviation for COND, but
    I could be wrong.

    OK, I found the smoking gun. Why, it's under our noses: Maccarthy's
    February 1979 "History of Lisp" paper.

    http://jmc.stanford.edu/articles/lisp/lisp.pdf

    (Don't try HTTPS, it doesn't resolve to the PDF. There may be other
    hostings of it.)

    Quote:

    I invented conditional expressions in connection with a set of chess
    legal move routines I wrote in FORTRAN for the IBM 704 at M.I.T.
    during 1957-58. This program did not use list processing. The IF
    statement provided in FORTRAN 1 and FORTRAN 2 was very awkward to use,
    and it was natural to invent a function XIF(M,N1,N2) whose value was
    N1 or N2 according to whether the expression M was zero or not. The
    function shortened many programs and made them easier to understand,
    but it had to be used sparingly, because all three arguments had to be
    evaluated before XIF was entered, since XIF was called as an ordinary
    FORTRAN function though written in machine language. This led to the
    invention of the true conditional expression which evaluates only one
    of N1 and N2 according to whether M is true or false and to a desire
    for a programming language that would allow its use.

    A paper defining conditional expressions and proposing their use in
    Algol was sent to the Communications of the ACM but was arbitrarily
    demoted to a letter to the editor, because it was very short.

    There you go; no hallucination or urban legends. Now, this does not
    establish that MacCarthy ever worked with (if A B C) in Lisp. But
    that is just a variation on the same idea; a footnote, if you will.

    MacCarthy used XIF(A, B, C), in his own words, to shorten many programs,
    and make them easier to understand, in his own words. (In Lisp, we
    can use IF to shorten programs that use COND!)

    The part about the "desire for a programming language that would allow
    its use" is also important; his inclusion of a conditional in Lisp can
    be traced to these thoughts, which have their origin in working with
    a three-argument form, and desire to have it with the right evaluation semantics.

    As for Fortran, it eventually caved in and got a conditional operator.
    In the year 2021!!! https://j3-fortran.org/doc/year/21/21-157r2.txt

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Axel Reichert on Thu Apr 4 07:01:55 2024
    On Thu, 04 Apr 2024 08:34:54 +0200, Axel Reichert wrote:

    Could you please give some pointers about the rationale (or further documentation) here?

    It also generalizes to a switch-expression. Languages nowadays commonly
    have switch-statements, but switch-expressions are rarer. Also they are invariably of the labelled form, while earlier languages (like Algol 68)
    had the unlabelled form. My technique for switch-expressions supports both forms.

    Have a look at the “Simple Code-Shortening Idioms” notebook in this collection <https://gitlab.com/ldo/python_topics_notebooks/>.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Axel Reichert@21:1/5 to Lawrence D'Oliveiro on Thu Apr 4 08:34:54 2024
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    I use this in Python, to try to avoid that abortion that is the Python conditional expression. Instead of, say,

    a = x / y if y != 0 else 0

    I would do

    a = (lambda : 0, lambda : x / y)[y != 0]()

    Do you use this in real code?

    Apart from my stomach revolting against this (interesting!) construct, I
    am in fact surprised that it works: I did not know that tuples can be
    indexed by boolean values (feels C-like). I am also surprised that True "equals" to 1 in this context and False to 0 (rather not C-like).

    Could you please give some pointers about the rationale (or further documentation) here?

    Best regards

    Axel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to Axel Reichert on Thu Apr 4 00:10:39 2024
    Axel Reichert <mail@axel-reichert.de> writes:
    I am also surprised that True "equals" to 1 in this context and False
    to 0 (rather not C-like).

    There is a hacky thing with that, because the boolean type wasn't added
    to Python til fairly late in its history.

    Could you please give some pointers about the rationale (or further documentation) here?

    For a long time the Python developers refused to have a conditional
    expression in the language, preferring the kludgy

    a = y and x/y

    or other bug-prone hacks of that sort. The danger was that all sorts of
    null values such as 0, 0.0, None, the empty list, all are treated as
    false for boolean expression purposes, so you could end up getting
    fooled by one of those cases. The hack with lambdas was a way to
    express the actually desired behaviour though I didn't realize anyone
    used it in practice.

    Later, the Python interpreter itself fell fictim to such a bug, and
    that's when the conditional expression finally got accepted.

    I use Python all the time and it is very pleasant, but very often its
    decisions are initially driven by what is convenient to implement in
    CPython (the reference interpreter, written in C). So various kludgy
    practices develop that often must be cleaned up sometime later.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Lawrence D'Oliveiro on Thu Apr 4 07:35:30 2024
    On 2024-04-04, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Wed, 03 Apr 2024 15:29:52 -0700, Paul Rubin wrote:

    I think lazy evaluation is not needed since the
    input to the Church boolean (I hope I have the jargon right) is two
    lambda abstractions. The boolean selects one of them, and the result is
    applied to whatever the next thing is.

    I use this in Python, to try to avoid that abortion that is the Python conditional expression. Instead of, say,

    Category error: "that abortion" is Python. If you're in the middle of it, you've already lost the ideological battle. Use it like it was meant to be.

    a = x / y if y != 0 else 0

    I would do

    a = (lambda : 0, lambda : x / y)[y != 0]()

    Not only is it more verbose, but it's unlikely that Python's compiler recognizes the idiom and optimizes away the lambdas.

    import dis

    def f0():
    return x / y if y != 0 else 0

    def f1():
    (lambda : 0, lambda : x / y)[y != 0]()

    print('disasembly of f0')
    dis.dis(f0)
    print('disasembly of f1')
    dis.dis(f1)

    disasembly of f0
    4 0 LOAD_GLOBAL 0 (y)
    2 LOAD_CONST 1 (0)
    4 COMPARE_OP 3 (!=)
    6 POP_JUMP_IF_FALSE 16
    8 LOAD_GLOBAL 1 (x)
    10 LOAD_GLOBAL 0 (y)
    12 BINARY_TRUE_DIVIDE
    14 RETURN_VALUE
    >> 16 LOAD_CONST 1 (0)
    18 RETURN_VALUE
    disasembly of f1
    7 0 LOAD_CONST 1 (<code object <lambda> at 0xb77c88b8, file "distest.py", line 7>)
    2 LOAD_CONST 2 ('f1.<locals>.<lambda>')
    4 MAKE_FUNCTION 0
    6 LOAD_CONST 3 (<code object <lambda> at 0xb77c8910, file "distest.py", line 7>)
    8 LOAD_CONST 2 ('f1.<locals>.<lambda>')
    10 MAKE_FUNCTION 0
    12 BUILD_TUPLE 2
    14 LOAD_GLOBAL 0 (y)
    16 LOAD_CONST 4 (0)
    18 COMPARE_OP 3 (!=)
    20 BINARY_SUBSCR
    22 CALL_FUNCTION 0
    24 POP_TOP
    26 LOAD_CONST 0 (None)
    28 RETURN_VALUE

    Deliberately writing longer, harder-to-read code, that is also slower, takes a special sort of cretin.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan Bawden@21:1/5 to All on Thu Apr 4 04:17:15 2024
    Kaz Kylheku <643-408-1753@kylheku.com> writes:

    http://jmc.stanford.edu/articles/lisp/lisp.pdf

    (Don't try HTTPS, it doesn't resolve to the PDF. There may be other
    hostings of it.)

    Quote:

    I invented conditional expressions in connection with a set of chess
    legal move routines I wrote in FORTRAN for the IBM 704 at M.I.T.
    during 1957-58. This program did not use list processing. The IF
    statement provided in FORTRAN 1 and FORTRAN 2 was very awkward to use,
    and it was natural to invent a function XIF(M,N1,N2) whose value was
    N1 or N2 according to whether the expression M was zero or not. The
    function shortened many programs and made them easier to understand,
    but it had to be used sparingly, because all three arguments had to be
    evaluated before XIF was entered, since XIF was called as an ordinary
    FORTRAN function though written in machine language. This led to the
    invention of the true conditional expression which evaluates only one
    of N1 and N2 according to whether M is true or false and to a desire
    for a programming language that would allow its use.

    A paper defining conditional expressions and proposing their use in
    Algol was sent to the Communications of the ACM but was arbitrarily
    demoted to a letter to the editor, because it was very short.

    You can find his CACM letter online at: https://doi.org/10.1145/368405.1773349

    Interestingly he did not propose using "if A then B else C" as the
    syntax but rather "(A → B, T → C)", almost the same as in M-expressions! (It would be cool if you were allowed to use the "(→,→)" form in what
    Algol calls the "publication language", where you can write "x₉" instead
    of "x[9]", but that is not the case.)

    There you go; no hallucination or urban legends. Now, this does not
    establish that MacCarthy ever worked with (if A B C) in Lisp. But
    that is just a variation on the same idea; a footnote, if you will.

    MacCarthy used XIF(A, B, C), in his own words, to shorten many programs,
    and make them easier to understand, in his own words. (In Lisp, we
    can use IF to shorten programs that use COND!)

    Not really the same as "invented the ternary IF, AS A SHORTHAND FOR A
    ONE CLAUSE COND", but yeah it's certainly another way to get confused
    about what actually happened.

    As for Fortran, it eventually caved in and got a conditional operator.
    In the year 2021!!! https://j3-fortran.org/doc/year/21/21-157r2.txt

    Now that's a hoot. But that seems to just be a proposal. Does anyone
    know if this was accepted?

    - Alan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Alan Bawden on Thu Apr 4 20:38:48 2024
    On Thu, 04 Apr 2024 04:17:15 -0400, Alan Bawden wrote:

    and it was natural to invent a function XIF(M,N1,N2) whose value
    was N1 or N2 according to whether the expression M was zero or not.
    The function shortened many programs and made them easier to
    understand, but it had to be used sparingly, because all three
    arguments had to be evaluated before XIF was entered, since XIF was
    called as an ordinary FORTRAN function though written in machine
    language.

    And just one more step from there to lazy evaluation via

    XIF(M, λ.N1, λ.N2)()

    and Bob’s your uncle.

    Interestingly, in PostScript, the control constructs (if, loop etc) are
    all just built-in functions, which take lambdas as arguments.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to Alan Bawden on Thu Apr 4 17:29:32 2024
    Alan Bawden <alan@csail.mit.edu> writes:
    It's a common misconception that McCarthy was trying to turn Lambda
    Calculus into a programming language. ... He added LAMBDA (and LABEL) because he needed LAMBDA in order to define recursive functions, but
    as he himself often admitted, he didn't really understand Lambda
    Calculus, he just needed the notation.

    I see, yes, and this is confirmed by his History of Lisp article. His Wikipedia biography also surprised me a bit. For some reason I had
    thought of him as an academic mathematical logician who later somehow
    got involved with computers, but it was more like the other way around.
    Thanks.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Julieta Shem@21:1/5 to Julieta Shem on Fri Apr 5 18:06:43 2024
    Julieta Shem <jshem@yaxenu.org> writes:

    Paul Rubin <no.email@nospam.invalid> writes:

    Alan Bawden <alan@csail.mit.edu> writes:
    It's a common misconception that McCarthy was trying to turn Lambda
    Calculus into a programming language. ... He added LAMBDA (and LABEL)
    because he needed LAMBDA in order to define recursive functions, but
    as he himself often admitted, he didn't really understand Lambda
    Calculus, he just needed the notation.

    I see, yes, and this is confirmed by his History of Lisp article. His
    Wikipedia biography also surprised me a bit. For some reason I had
    thought of him as an academic mathematical logician who later somehow
    got involved with computers, but it was more like the other way around.
    Thanks.

    His PhD was in mathematics---differential equations. He would think up things like a simple function that is continuous but nowhere
    differentiable on the real line [1]. He was a mathematician by all
    accounts. It's pretty hard to remove mathematics from computer science.
    The culture seems to be that if a mathematician contributes more to the
    field of computer science, he is called a computer scientist.

    I also agree that he was a logician: he worked on a mathematical basis
    for computer science. A mathematical basis for computer science must be classified as logic. He was interested in proving programs were
    correct. His idea of a conditional expression is precisely to write mathematical functions in high precision. Mathematics in high precision---that's a logician.

    The creation of LISP by John McCarthy was surely not at first with
    intention of a programming language. In fact, it was Steve Russell, his student at the time, that first had the idea of implementing EVAL and
    did it. I believe McCarthy was even somewhat surprised because, then,
    he did not think of LISP having that kind of purpose.

    --8<---------------cut here---------------start------------->8---
    What happened next was that, some time in late 1958, Steve Russell, one
    of McCarthy's grad students, looked at this definition of eval and
    realized that if he translated it into machine language, the result
    would be a Lisp interpreter.

    This was a big surprise at the time. Here is what McCarthy said about it
    later in an interview:

    Steve Russell said, look, why don't I program this eval..., and I said
    to him, ho, ho, you're confusing theory with practice, this eval is
    intended for reading, not for computing. But he went ahead and did
    it. That is, he compiled the eval in my paper into [IBM] 704 machine
    code, fixing bugs, and then advertised this as a Lisp interpreter,
    which it certainly was. So at that point Lisp had essentially the form
    that it has today....

    Suddenly, in a matter of weeks I think, McCarthy found his theoretical
    exercise transformed into an actual programming language-- and a more
    powerful one than he had intended.

    Source: Paul Graham's ``Revenge of the Nerds'', May 2002. https://www.paulgraham.com/icad.html
    --8<---------------cut here---------------end--------------->8---

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Julieta Shem@21:1/5 to Paul Rubin on Fri Apr 5 17:56:31 2024
    Paul Rubin <no.email@nospam.invalid> writes:

    Alan Bawden <alan@csail.mit.edu> writes:
    It's a common misconception that McCarthy was trying to turn Lambda
    Calculus into a programming language. ... He added LAMBDA (and LABEL)
    because he needed LAMBDA in order to define recursive functions, but
    as he himself often admitted, he didn't really understand Lambda
    Calculus, he just needed the notation.

    I see, yes, and this is confirmed by his History of Lisp article. His Wikipedia biography also surprised me a bit. For some reason I had
    thought of him as an academic mathematical logician who later somehow
    got involved with computers, but it was more like the other way around. Thanks.

    His PhD was in mathematics---differential equations. He would think up
    things like a simple function that is continuous but nowhere
    differentiable on the real line [1]. He was a mathematician by all
    accounts. It's pretty hard to remove mathematics from computer science.
    The culture seems to be that if a mathematician contributes more to the
    field of computer science, he is called a computer scientist.

    I also agree that he was a logician: he worked on a mathematical basis
    for computer science. A mathematical basis for computer science must be classified as logic. He was interested in proving programs were
    correct. His idea of a conditional expression is precisely to write mathematical functions in high precision. Mathematics in high precision---that's a logician.

    The creation of LISP by John McCarthy was surely not at first with
    intention of a programming language. In fact, it was Steve Russell, his student at the time, that first had the idea of implementing EVAL and
    did it. I believe McCarthy was even somewhat surprised because, then,
    he did not think of LISP having that kind of purpose.

    [1] https://www-formal.stanford.edu/jmc/weierstrass.pdf

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Julieta Shem on Fri Apr 5 23:26:20 2024
    On Fri, 05 Apr 2024 17:56:31 -0300, Julieta Shem wrote:

    It's pretty hard to remove mathematics from computer science.

    Of course different fields of scientific study are always going to abut
    against each other. They are all indivisible parts of one reality, after
    all.

    What to me distinguishes mathematics from computer science is the practicalities of programming. Mathematicians will construct theories
    about the nature of information, what is computable and what is not,
    orders of complexity, equivalence of computations and so on, and those all
    have some relevance to computer science. But where the rubber meets the
    road is when you write actual, working code that solves an actual problem without consuming totally outrageous amounts of computing resources (space
    and time).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to alan@csail.mit.edu on Fri Apr 12 16:57:54 2024
    In article <86cyr6pb2l.fsf@williamsburg.bawden.org>,
    Alan Bawden <alan@csail.mit.edu> wrote:
    Lisp doesn't really have statements _because_ McCarthy invented the >conditional expression. That's kind of the point. Other programming >languages at the time (e.g. FORTRAN and ALGOL) only had conditional >statements. McCarthy invented the conditional expression and thus
    created the first expression-only programming language.

    It is a common mistake to refer to ALGOL simple.
    Algol60 and algol68 are different beast altogether.

    algol68 has conditional expressions:
    a := 'if' summer 'then' 40 'else' -10 'fi' ;
    and even a short hand:
    a:= (summer|40|-10);

    - Alan

    Groetjes Albert
    --
    Don't praise the day before the evening. One swallow doesn't make spring.
    You must not say "hey" before you have crossed the bridge. Don't sell the
    hide of the bear until you shot it. Better one bird in the hand than ten in
    the air. First gain is a cat purring. - the Wise from Antrim -

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan Bawden@21:1/5 to alan@csail.mit.edu on Fri Apr 12 14:53:46 2024
    albert@spenarnc.xs4all.nl writes:

    In article <86cyr6pb2l.fsf@williamsburg.bawden.org>,
    Alan Bawden <alan@csail.mit.edu> wrote:
    >Lisp doesn't really have statements _because_ McCarthy invented the
    >conditional expression. That's kind of the point. Other programming
    >languages at the time (e.g. FORTRAN and ALGOL) only had conditional
    >statements. McCarthy invented the conditional expression and thus
    >created the first expression-only programming language.

    It is a common mistake to refer to ALGOL simple.
    Algol60 and algol68 are different beast altogether.

    algol68 has conditional expressions:
    a := 'if' summer 'then' 40 'else' -10 'fi' ;
    and even a short hand:
    a:= (summer|40|-10);

    Actually Algol 60 _does_ have conditional expressions, it's Algol 58
    that doesn't have them. As I wrote myself last week elsewhere in this
    thread:

    Ah yes, the history is slightly more complicated than I remembered.
    Algol 58 did not have conditional expressions. But McCarthy then
    joined the Algol committee and he suggested that they add
    conditional expressions. And so they do appear in Algol 60.

    And when I wrote "ALGOL" in the message you quoted, I had forgtten about
    Algol 58 entirely...

    - Alan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Alan Bawden on Fri Apr 12 21:17:01 2024
    On Fri, 12 Apr 2024 14:53:46 -0400, Alan Bawden wrote:

    Algol 58 ...

    A.k.a. the “International Algorithmic Language” or “IAL”.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to Julieta Shem on Mon Apr 15 13:01:56 2024
    Julieta Shem <jshem@yaxenu.org> writes:
    I also agree that he was a logician: he worked on a mathematical basis
    for computer science. A mathematical basis for computer science must be classified as logic.

    Mathematical logic is an area that deals with topics like proof theory.
    Not to diminish McCarthy in any way, but it sounds like he didn't work
    in that particular area.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeff Barnett@21:1/5 to Paul Rubin on Mon Apr 15 18:01:46 2024
    On 4/15/2024 2:01 PM, Paul Rubin wrote:
    Julieta Shem <jshem@yaxenu.org> writes:
    I also agree that he was a logician: he worked on a mathematical basis
    for computer science. A mathematical basis for computer science must be
    classified as logic.

    Mathematical logic is an area that deals with topics like proof theory.
    Not to diminish McCarthy in any way, but it sounds like he didn't work
    in that particular area.

    Well he and a PhD student (named not recalled) developed a compiler for
    a Lisp that was of about the complexity of a mid 1960s Lisp. Then they
    formally proved that the compiler was correct. This was NOT "proof
    theory" as you probably meant it in the above paragraph. However in my
    my mind the hairiest problems with the venture were setting up the
    mechanisms and criteria for representing the code and expected behavior
    plus enumerating the proof rules. A good deal of theory was developed
    and buried in their effort.

    I also remember McCarthy in the late 1960s being obsessed with logic and philosophy and randomly spouting off discussions such as how processing of
    Sir Walter Raleigh was the author of "The Lie"
    Did the Queen know that Raleigh wrote "The Lie"?

    might produce

    Did the Queen know TRUE?

    I heard him bring up such questions many times because he was hoping
    that logical calculi could support natural language processing and
    reasoning. The above was offered as an example of a problem at the
    relatively simple surface level.
    --
    Jeff Barnett

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Jeff Barnett on Tue Apr 16 00:31:42 2024
    On Mon, 15 Apr 2024 18:01:46 -0600, Jeff Barnett wrote:

    I also remember McCarthy in the late 1960s being obsessed with logic and philosophy and randomly spouting off discussions such as how processing
    of
    Sir Walter Raleigh was the author of "The Lie"
    Did the Queen know that Raleigh wrote "The Lie"?

    might produce

    Did the Queen know TRUE?

    The word “know” has its own connotations which might be confusing things, though. What if it were

    Did the Queen believe that Raleigh wrote "The Lie"?

    might produce

    Did the Queen believe TRUE?

    If you think that’s a meaningless statement, then how about

    An ounce of prevention is worth a pound of cure
    Do anti-vaxxers believe that an ounce of prevention is worth a pound
    of cure?

    and you realize that, trying to substitute “conspiracy theorists” for X
    in

    Do X believe TRUE?

    is a process fraught with pitfalls. ;)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to Jeff Barnett on Mon Apr 15 20:48:13 2024
    Jeff Barnett <jbb@notatt.com> writes:
    might produce
    Did the Queen know TRUE?

    This is a topic in philosophy of language (idr what it is called).
    Mathematical logic is completely different. By that, I mean you could
    go to any university math library in the 1960s (when McCarthy was
    active) or today, and find shelves full of textbooks with "mathematical
    logic" in their titles. Those would all be about facets of the same
    subject. Noted authors in it were people like Church (inventor of
    lambda calculus), Curry (currying and the Haskell language are named
    after him), Tarski, and so on. McCarthy's work was in tangentially
    related areas.

    McCarthy was super smart and probably could have read those textbooks
    and gotten to understand the subject fairly easily, but not that many mathematicians were into it back then. So I don't think he spent his
    time that way. That's what I mean by saying he worked in different
    areas.

    I only met McCarthy once, and unfortunately, the only topic I remember
    from the conversation had something to do with Chinese food.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeff Barnett@21:1/5 to Paul Rubin on Mon Apr 15 22:58:21 2024
    On 4/15/2024 9:48 PM, Paul Rubin wrote:
    Jeff Barnett <jbb@notatt.com> writes:
    might produce
    Did the Queen know TRUE?

    This is a topic in philosophy of language (idr what it is called). Mathematical logic is completely different. By that, I mean you could
    go to any university math library in the 1960s (when McCarthy was
    active) or today, and find shelves full of textbooks with "mathematical logic" in their titles. Those would all be about facets of the same
    subject. Noted authors in it were people like Church (inventor of
    lambda calculus), Curry (currying and the Haskell language are named
    after him), Tarski, and so on. McCarthy's work was in tangentially
    related areas.

    McCarthy was super smart and probably could have read those textbooks
    and gotten to understand the subject fairly easily, but not that many mathematicians were into it back then. So I don't think he spent his
    time that way. That's what I mean by saying he worked in different
    areas.

    I only met McCarthy once, and unfortunately, the only topic I remember
    from the conversation had something to do with Chinese food.

    The Chinese food habit probably resulted from his time at MIT. It seems
    the original hacker community plus Minsky and others were enamored of a restaurant called Joyce Chen's in Fresh Pond close to BBN. Ms. Chen had
    written a cook book. Unfortunately, the food was god awful but everyone
    thought they should be one of the group and sing its praises.

    I met him in the early/middle 1960s when DARPA gave us a contract to do
    a thing called Lisp 2 - a Lisp system with extended language facilities
    and borrows from Algol. McCarthy (now at Stanford) and Minsky were named
    our Godfathers and we visited each several times a year to talk about
    life and eat bad Chinese food - Danny Bobrow and Warren Teitelman would
    usual join us in Cambridge. When we saw McCarthy, I often wondered why
    he was in a CS department (and sat in the Stanford AI building). He
    talked almost exclusively about logic and how that technology might help formulate and solve many hard problems. I thought he would be happier in
    a department of philosophy. I still have that impression.

    OT tidbit: At the time talked about above, I worked near a fellow who
    went to grade school with McCarthy. It seemed that he paid very little attention to his teacher; rather he read through all volumes of the Encyclopedia Britannica one year when he was in early grade school!
    --
    Jeff Barnett

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeff Barnett@21:1/5 to All on Mon Apr 15 22:25:27 2024
    T24gNC8xNS8yMDI0IDY6MzEgUE0sIExhd3JlbmNlIEQnT2xpdmVpcm8gd3JvdGU6DQo+IE9u IE1vbiwgMTUgQXByIDIwMjQgMTg6MDE6NDYgLTA2MDAsIEplZmYgQmFybmV0dCB3cm90ZToN Cj4gDQo+PiBJIGFsc28gcmVtZW1iZXIgTWNDYXJ0aHkgaW4gdGhlIGxhdGUgMTk2MHMgYmVp bmcgb2JzZXNzZWQgd2l0aCBsb2dpYyBhbmQNCj4+IHBoaWxvc29waHkgYW5kIHJhbmRvbWx5 IHNwb3V0aW5nIG9mZiBkaXNjdXNzaW9ucyBzdWNoIGFzIGhvdyBwcm9jZXNzaW5nDQo+PiBv Zg0KPj4gICAgICBTaXIgV2FsdGVyIFJhbGVpZ2ggd2FzIHRoZSBhdXRob3Igb2YgIlRoZSBM aWUiDQo+PiAgICAgIERpZCB0aGUgUXVlZW4ga25vdyB0aGF0IFJhbGVpZ2ggd3JvdGUgIlRo ZSBMaWUiPw0KPj4NCj4+IG1pZ2h0IHByb2R1Y2UNCj4+DQo+PiAgICAgIERpZCB0aGUgUXVl ZW4ga25vdyBUUlVFPw0KPiANCj4gVGhlIHdvcmQg4oCca25vd+KAnSBoYXMgaXRzIG93biBj b25ub3RhdGlvbnMgd2hpY2ggbWlnaHQgYmUgY29uZnVzaW5nIHRoaW5ncywNCj4gdGhvdWdo LiBXaGF0IGlmIGl0IHdlcmUNCj4gDQo+ICAgICAgRGlkIHRoZSBRdWVlbiBiZWxpZXZlIHRo YXQgUmFsZWlnaCB3cm90ZSAiVGhlIExpZSI/DQo+IA0KPiBtaWdodCBwcm9kdWNlDQo+IA0K PiAgICAgIERpZCB0aGUgUXVlZW4gYmVsaWV2ZSBUUlVFPw0KPiANCj4gSWYgeW91IHRoaW5r IHRoYXTigJlzIGEgbWVhbmluZ2xlc3Mgc3RhdGVtZW50LCB0aGVuIGhvdyBhYm91dA0KPiAN Cj4gICAgICBBbiBvdW5jZSBvZiBwcmV2ZW50aW9uIGlzIHdvcnRoIGEgcG91bmQgb2YgY3Vy ZQ0KPiAgICAgIERvIGFudGktdmF4eGVycyBiZWxpZXZlIHRoYXQgYW4gb3VuY2Ugb2YgcHJl dmVudGlvbiBpcyB3b3J0aCBhIHBvdW5kDQo+ICAgICAgICAgIG9mIGN1cmU/DQo+IA0KPiBh bmQgeW91IHJlYWxpemUgdGhhdCwgdHJ5aW5nIHRvIHN1YnN0aXR1dGUg4oCcY29uc3BpcmFj eSB0aGVvcmlzdHPigJ0gZm9yIFgNCj4gaW4NCj4gDQo+ICAgICAgRG8gWCBiZWxpZXZlIFRS VUU/DQo+IA0KPiBpcyBhIHByb2Nlc3MgZnJhdWdodCB3aXRoIHBpdGZhbGxzLiA7KQ0KDQpU aGUgYWJvdmUgd2FzIG9uZSBvZiBNY0NhcnRoeSdzIGV4YW1wbGVzIHRvIHNob3cgdGhhdCBi bGluZCBhcHBsaWNhdGlvbiANCm9mICJsb2dpYyB0ZWNobmlxdWVzIiwgZS5nLiwgc3Vic3Rp dHV0aW9uIG9yIHVuaWZpY2F0aW9uLCB0byBvdGhlciANCnJlcHJlc2VudGF0aW9ucywgZS5n LiwgbmF0dXJhbCBsYW5ndWFnZSB3YXMgZnJhdWdodCB3aXRoIHBlcmlscy4gSW4gdGhlIA0K ZXhhbXBsZSwgU1dSID0gVEwgZXF1aXYgVFJVRSBhbmQgc28gVFJVRSB3YXMgc3Vic3RpdHV0 ZWQuIE1vc3Qga25vdyANCmJldHRlciB0b2RheSBidXQgYXQgdGhlIHRpbWUsIGEgbG90IG9m IHNtYXJ0IHBlb3BsZSBoYWQgdG9vIHNpbXBsaWZpZWQsIA0KaS5lLiwgcmlkaWN1bG91cyBp ZGVhIG9mIGhvdyB3ZSBjb3VsZCBqdXN0IHNsaXAgZm9ybWFsIGxvZ2ljIGluIGFuZCANCnNv bHZlIGFsbCBvZiBvdXIgQUkgcHJvYmxlbXMgd2l0aG91dCBzb21lIHZhcnkgbmVjZXNzYXJ5 IHVwZGF0ZXMgdG8gDQoiZm9ybWFsIGxvZ2ljIiBwYXJ0aWN1bGFybHkgcHJlY29uZGl0aW9u cyBvZiBhcHBsaWNhdGlvbiBydWxlcy4NCi0tIA0KSmVmZiBCYXJuZXR0DQoNCg==

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Jeff Barnett on Tue Apr 16 07:22:14 2024
    On Mon, 15 Apr 2024 22:58:21 -0600, Jeff Barnett wrote:

    I met him in the early/middle 1960s when DARPA gave us a contract to do
    a thing called Lisp 2 - a Lisp system with extended language facilities
    and borrows from Algol.

    That project was considered a “failure”, but I wonder why? Did it turn out that getting rid of the (ahem) quirky Lisp syntax in fact got rid of some
    of its expressive power, too?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to Lawrence D'Oliveiro on Tue Apr 16 11:23:42 2024
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    [Lisp 2] That project was considered a “failure”, but I wonder why?
    Did it turn out that getting rid of the (ahem) quirky Lisp syntax in
    fact got rid of some of its expressive power, too?

    This retrospective (8 page PDF) gives the impression that Lisp 2 bogged
    down due to the implementation outstripping the limited computers
    available at the time. Plus, Lisp 1.5 had gotten entrenched enough that
    Lisp 2's Algol-like syntax didn't excite people any more:

    https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8267589

    Lisp 2 had an interesting GC scheme that migrated into SPITBOL which is
    where I learned about it. It was a mark-sweep GC but had a
    "generational" aspect that relocated data that had been around for a
    while into a "sediment" that usually didn't get rescanned. I remember
    thinking that it might be worth trying this in smaller GC'd language interpreters like MicroPython. I don't remember much about it now, but
    I spent a while studying it and thinking about documenting and/or reimplementing it.

    SPITBOL (Speedy Implementation of SNOBOL, where SNOBOL was StriNg
    Oriented symBOLic language) was a quite amazing 1970s(?) implementation
    of a language that could be seen as an antecedent of something like Perl:

    https://github.com/spitbol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeff Barnett@21:1/5 to All on Tue Apr 16 18:37:05 2024
    T24gNC8xNi8yMDI0IDE6MjIgQU0sIExhd3JlbmNlIEQnT2xpdmVpcm8gd3JvdGU6DQo+IE9u IE1vbiwgMTUgQXByIDIwMjQgMjI6NTg6MjEgLTA2MDAsIEplZmYgQmFybmV0dCB3cm90ZToN Cj4gDQo+PiBJIG1ldCBoaW0gaW4gdGhlIGVhcmx5L21pZGRsZSAxOTYwcyB3aGVuIERBUlBB IGdhdmUgdXMgYSBjb250cmFjdCB0byBkbw0KPj4gYSB0aGluZyBjYWxsZWQgTGlzcCAyIC0g YSBMaXNwIHN5c3RlbSB3aXRoIGV4dGVuZGVkIGxhbmd1YWdlIGZhY2lsaXRpZXMNCj4+IGFu ZCBib3Jyb3dzIGZyb20gQWxnb2wuDQo+IA0KPiBUaGF0IHByb2plY3Qgd2FzIGNvbnNpZGVy ZWQgYSDigJxmYWlsdXJl4oCdLCBidXQgSSB3b25kZXIgd2h5PyBEaWQgaXQgdHVybiBvdXQN Cj4gdGhhdCBnZXR0aW5nIHJpZCBvZiB0aGUgKGFoZW0pIHF1aXJreSBMaXNwIHN5bnRheCBp biBmYWN0IGdvdCByaWQgb2Ygc29tZQ0KPiBvZiBpdHMgZXhwcmVzc2l2ZSBwb3dlciwgdG9v Pw0KDQpQYXVsIFJ1YmluIGRpc2N1c3NlcyB0aGlzIGluIGFub3RoZXIgcmVwbHkgdG8geW91 ciBxdWVzdGlvbi4gQnV0IHRoZXJlIA0Kd2hlcmUgbWFueSBpc3N1ZXMuIEluIHRoZSBmaXJz dCBwbGFjZSwgdGhlcmUgd2FzIGEgZnVsbCBub3JtYWwgcHJlZml4IA0KTGlzcCBpbnRlcmZh Y2UgdG8gdGhlIHN5c3RlbSAtIGNvbXBpbGVyLCBhc3NlbWJsZXIsIGRlYnVnZ2VyLCByZWFk ZXIsIA0KZXRjLiBJbiB0aGUgc2Vjb25kIHBsYWNlLCB0aGVyZSB3YXMgYSBmdWxsIG1ldGEt Y29tcGlsZXIgc2V0dGluZyBpbiB0aGUgDQpMaXNwMiBzeXN0ZW0uIFRoaXMgbWV0YS1jb21w aWxlciB3YXMgZ29vZCBlbm91Z2ggdG8gZ2VuZXJhdGUgc29tZSBvZiB0aGUgDQplYXJseSBK b3ZpYWwgY29tcGlsZXJzIGRldmVsb3BlZCBhbmQgdXNlZCBhdCBTREMgYW5kIGNvdWxkIGRv IA0Kc29waGlzdGljYXRlIHRoaW5ncywgZS5nLiwgcmVtb3ZlIGxlZnQgcmVjdXJzaW9uIGZy b20gYSBncmFtbWFyLiBJbiANCm90aGVyIHdvcmRzLCB5b3UgY291bGQgdXNlIHByZWZpeCwg YSBjb21wbGltZW50YXJ5IGluZml4LCBvciByb2xsIG1vc3QgDQooYnV0KSBub3QgYWxsIGlu dGVyZmFjZSBsYW5ndWFnZXMgdGhhdCBtYWRlIHlvdSBnaWRkeS4NCg0KVGhlIHByb2JsZW0g aW4gbXkgbWluZCB3YXMgc2ltcGx5IGxhY2sgb2YgY29tcHV0ZXIgcmVzb3VyY2VzLiBUaGUg DQppbXBsZW1lbnRhdGlvbiBvbiB0aGUgQU5GUy1RMzIgaGFkIHNvbWV0aGluZyBsaWtlIDQ4 SyAzNisgYml0IHdvcmRzLiANClRoYXQgc2ltcGx5IHdhc24ndCBlbm91Z2ggc28gc29tZSBv ZiB0aGUgZmVsbG93cyBkZXZpc2VkIGEgc3dhcHBpbmcgDQpzY2hlbWU6IHRoZSBmdW5jdGlv biBsaW5rYWdlIGNsaWNoZSAtIHRoZSBjb21tb24gY29kZSBpbnZva2VkIGJ5IHRoZSANCmZ1 bmN0aW9uIGNhbGwgc2VxdWVuY2UgLS0gbm90ZWQgd2hhdCB3YXMgY2FsbGVkIGFuZCBmcmVx dWVuY3kuIEl0IGFsc28gDQpub3RlZCB3aGV0aGVyIHRoZSByb3V0aW5lIHdhcyBpbiBtZW1v cnk7IGlmIG5vdCBpdCB0cmllZCB0byBtb3ZlIGl0IHRvIA0KbWVtb3J5IGZyb20gZXh0ZXJu YWwgc3RvcmFnZTsgaWYgdGhlcmUgd2Fzbid0IGVub3VnaCByb29tLCBjdXJyZW50IA0KbWVt b3J5IHJlc2lkZW50IHJvdXRpbmVzIHdlcmUgbW92ZWQgb3IgZXhjaXNlZCAoYW5kIHdyaXR0 ZW4gb3V0IGlmIA0KbmVjZXNzYXJ5KSBiZWluZyBzZWxlY3RlZCB1c2luZyB0aGUgZnJlcXVl bmN5IGluZm9ybWF0aW9uOyBwaWVjZXMgb2YgdGhlIA0KR0MgbWF5IGhhdmUgYmVlbiB1c2Vk IHRvIGRvIHN1Y2ggdGFza3MgYXMgY29tcGFjdGluZyBwcm9ncmFtIHN0b3JhZ2UgdG8gDQpt YWtlIGEgaG9sZSBiaWcgZW5vdWdoIHRvIGRvIHRoZSBzd2FwIGluLiBJbiBvdGhlciB3b3Jk cywgd2Ugd2VyZSBkb2luZyANCnN3YXBwaW5nIGEgYmluYXJ5IHByb2dyYW0gYXQgYSB0aW1l LiBUaGlzLCBhcyB5b3UgY2FuIGltYWdpbmUsIHdhcyBhIA0KUm95YWwgUGFpbiBJbiBUaGUg QXNzIChSUElUQSkuDQoNClNvIERBUlBBIChvciB3YXMgaXQgc3RpbGwgQVJQQT8pIHNheXMg dGhleSB3YW50ZWQgU0RDIHRvIGRvIHNvbWV0aGluZyBvciANCm90aGVyIHdpdGggbWFzc2l2 ZSBkYXRhYmFzZXMgb24gSUJNIDM2MCBtYWNoaW5lcyBzbyB0aGV5IGFyZSBnb2luZyB0byAN CmdldCB1cyBhIGJldHRlciBtYWNoaW5lLiBUaGUgbWFjaGluZSB0dXJucyBvdXQgdG8gYmUg YWJvdXQgdGhlIHNhbWUgc2l6ZSANCmFzIHRoZSBRMzIuIEZ1cnRoZXIsIHRoZSBuZXh0IGdv b2RpZSBhIDM2MC8zNzAgd2l0aCB2aXJ0dWFsIG1lbW9yeSBjb3VsZCANCmJlIHNpZ25pZmlj YW50bHkgYmV0dGVyLiBIb3dldmVyIHVzZXIgdmlydHVhbCBhZGRyZXNzIHNwYWNlIHdhcyB0 byBiZSANCmxpbWl0ZWQgdG8gYWJvdXQgYSBtZWdhYnl0ZSAtIG5vdCBlbm91Z2ggdG8gY29u c2lkZXIgYSBjb3B5LWNvbGxlY3QgR0MuIA0KSSwgYW5kIHNldmVyYWwgb3RoZXJzIGhhZCBl bm91Z2ggb2YgdGhpcyBzb3J0IG9mIGRldmVsb3BtZW50IGluIGxpbWl0ZWQgDQpyZXNvdXJj ZXMuIFdlIHdlcmUgbW90aXZhdGVkIGJ5IGV4cGVyaW1lbnRpbmcgd2l0aCBsYW5ndWFnZSBm b3JtcyBhbmQgDQp3YXlzIHRvIGltcGxlbWVudCB0aGVtLCBub3QgcmVzZWFyY2ggaW4gaG93 IHRvIHNjcm91bmdlIG1lbW9yeSB3aGlsZSANCmxvc2luZyBzbGVlcCBhbmQgZm9yc2FraW5n IGEgc29jaWFsIGxpZmUuIE5vdCBldmVyeSBvbmUgYWdyZWVkIHdpdGggdGhlIA0KZGVjaXNp b24gdG8gc2h1dCBpdCBkb3duIGJ1dCBtb3N0IGRpZC4gU28gUlBJVEEtPlJJUC4NCi0tIA0K SmVmZiBCYXJuZXR0DQoNCg==

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Paul Rubin on Wed Apr 17 01:14:25 2024
    On Tue, 16 Apr 2024 11:23:42 -0700, Paul Rubin wrote:

    SPITBOL (Speedy Implementation of SNOBOL, where SNOBOL was StriNg
    Oriented symBOLic language) was a quite amazing 1970s(?) implementation
    of a language that could be seen as an antecedent of something like
    Perl:

    https://github.com/spitbol

    Had a quick look at that. I would say the whole SNOBOL family has been
    left in the dust by Perl. And by languages that were able to take
    advantage of PCRE libraries.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to Lawrence D'Oliveiro on Tue Apr 16 19:04:26 2024
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    Had a quick look at that. I would say the whole SNOBOL family has been
    left in the dust by Perl.

    SNOBOL/SPITBOL in the 1970s were sort of like Perl in the 1990s, I
    think. But, they are mostly of historical interest now. I think by the
    time Spitbol ran on anything resembling a personal computer or
    workstation, it was already history. It ran on old mainframe OS's and
    there wasn't much overlap.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeff Barnett@21:1/5 to Paul Rubin on Tue Apr 16 20:50:45 2024
    On 4/16/2024 8:04 PM, Paul Rubin wrote:
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    Had a quick look at that. I would say the whole SNOBOL family has been
    left in the dust by Perl.

    SNOBOL/SPITBOL in the 1970s were sort of like Perl in the 1990s, I
    think. But, they are mostly of historical interest now. I think by the
    time Spitbol ran on anything resembling a personal computer or
    workstation, it was already history. It ran on old mainframe OS's and
    there wasn't much overlap.

    FYI Lisp 2 (discussed in this thread) included a copy of Warren
    Teitelman's dissertation project - a data match and manipulate engine.
    It was called Flip or something simple but I don't remember. He spent a
    summer in Santa Monica converting it to Lisp2. Fred Blair from IBM
    Yorktown Heights was there the same summer and worked on importing
    Scratchpad to our Lisp too. There was a development, Formula Algol, that
    did a similar embedding into Algol so there was a lot of interest in the
    1960s of including some sort of pattern match and reconstruction
    primitives into programming languages.

    This stuff simply exacerbated our limited memory problems on old
    machines not matter how interesting they/it might be.
    --
    Jeff Barnett

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Jeff Barnett on Wed Apr 17 03:24:20 2024
    On Tue, 16 Apr 2024 20:50:45 -0600, Jeff Barnett wrote:

    ... so there was a lot of interest in the
    1960s of including some sort of pattern match and reconstruction
    primitives into programming languages.

    This stuff simply exacerbated our limited memory problems on old
    machines not matter how interesting they/it might be.

    Was it a matter of timing, then? Perl came along at just the point where
    the hardware was powerful enough to take the complexities of regular expressions in its stride, so that’s when the whole idea really took off.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to Lawrence D'Oliveiro on Wed Apr 17 00:56:18 2024
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    Was it a matter of timing, then? Perl came along at just the point where
    the hardware was powerful enough to take the complexities of regular expressions in its stride, so that’s when the whole idea really took off.

    Unix had regular expressions because Thompson's QED editor on some weird
    old GE(?) minicomputer had had them. It compiled the regexex into
    machine code, iirc. Perl was sort of Awk on steroids and Awk also had
    regexes. I think regexes per se were never very cpu or memory hungry.

    Snobol and Spitbol didn't have regexes. They did pattern matching by
    brute force backtracking. By that era though, computers had much more
    memory than they did when Lisp 2 was happening.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Madhu@21:1/5 to All on Wed Apr 17 16:31:58 2024
    * Paul Rubin <875xwgzal9.fsf@nightsong.com> :
    Wrote on Wed, 17 Apr 2024 00:56:18 -0700:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    Was it a matter of timing, then? Perl came along at just the point
    where the hardware was powerful enough to take the complexities of
    regular expressions in its stride, so that’s when the whole idea
    really took off.

    Unix had regular expressions because Thompson's QED editor on some
    weird old GE(?) minicomputer had had them. It compiled the regexex
    into machine code, iirc. Perl was sort of Awk on steroids and Awk
    also had regexes. I think regexes per se were never very cpu or
    memory hungry.

    Snobol and Spitbol didn't have regexes. They did pattern matching by
    brute force backtracking. By that era though, computers had much more
    memory than they did when Lisp 2 was happening.

    Languages in the next decade didn't seem to mind not having regex either
    REXX, ICON, REBOL (this one is much later)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to Jeff Barnett on Wed Apr 17 12:24:04 2024
    Jeff Barnett <jbb@notatt.com> wrote or quoted:
    Sir Walter Raleigh was the author of "The Lie"
    Did the Queen know that Raleigh wrote "The Lie"?
    might produce
    Did the Queen know TRUE?

    This here thing might have some connection to what folks call
    "Extensionality": "To find the value of an expression,
    the only thing one needs to know about a subexpression is its
    (the subexpression's) value."

    Now, we can say with a high degree of certainty that natural
    language ain't got no truck with this "Extensionality" business,
    at least not the way ol' man McCarthy was demonstratin' it.

    The very idea that logical statements are a good fit for
    modellin' natural language utterances, and that these bad
    boys have some kind of "truth value" as their "meaning"?
    Hoo-wee, that's a real doozy, let me tell you!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ben Bacarisse@21:1/5 to Paul Rubin on Wed Apr 17 17:44:01 2024
    Paul Rubin <no.email@nospam.invalid> writes:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    Was it a matter of timing, then? Perl came along at just the point where
    the hardware was powerful enough to take the complexities of regular
    expressions in its stride, so that’s when the whole idea really took off.

    Unix had regular expressions because Thompson's QED editor on some weird
    old GE(?) minicomputer had had them. It compiled the regexex into
    machine code, iirc. Perl was sort of Awk on steroids and Awk also had regexes. I think regexes per se were never very cpu or memory hungry.

    Snobol and Spitbol didn't have regexes. They did pattern matching by
    brute force backtracking. By that era though, computers had much more
    memory than they did when Lisp 2 was happening.

    SNOBOL's patterns were much more "procedural" than REs. For example,
    you could implement Russell's paradox in SNOBOL: a pattern that matches
    only those patterns that don't match themselves.

    --
    Ben.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Ben Bacarisse on Wed Apr 17 22:09:24 2024
    On Wed, 17 Apr 2024 17:44:01 +0100, Ben Bacarisse wrote:

    SNOBOL's patterns were much more "procedural" than REs. For example,
    you could implement Russell's paradox in SNOBOL: a pattern that matches
    only those patterns that don't match themselves.

    I would expect a paradox like that to behave the same way it does when expressed in λ-calculus: get stuck in an endless loop.

    Mathematicians seem to be scared of paradoxes. But if you realize that
    they are just equivalent to endless loops in a computation, which is
    something we deal with all the time in Comp Sci, then they are no longer
    so scary.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Madhu on Wed Apr 17 22:06:27 2024
    On Wed, 17 Apr 2024 16:31:58 +0530, Madhu wrote:

    * Paul Rubin <875xwgzal9.fsf@nightsong.com> :
    Wrote on Wed, 17 Apr 2024 00:56:18 -0700:

    Snobol and Spitbol didn't have regexes. They did pattern matching by
    brute force backtracking. By that era though, computers had much more
    memory than they did when Lisp 2 was happening.

    Languages in the next decade didn't seem to mind not having regex either REXX, ICON, REBOL (this one is much later)

    None of which are more than museum pieces at this stage. (And you forgot
    to mention BASIC.)

    Nowadays, say anything about “string processing”, and regexes are automatically assumed to be part of the mix.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Monnier@21:1/5 to All on Wed Apr 17 18:18:09 2024
    Mathematicians seem to be scared of paradoxes. But if you realize that
    they are just equivalent to endless loops in a computation, which is something we deal with all the time in Comp Sci, then they are no longer
    so scary.

    The problem is that mathematicians don't run their proofs, so such an
    inf-loop trips them up into thinking that everything is true.

    It's also a problem for computers when we don't want to run our proofs
    either (e.g. when we don't want to wait for that proof that the index is
    within bounds to finish before we access the array?).


    Stefan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to Lawrence D'Oliveiro on Wed Apr 17 16:00:38 2024
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    Nowadays, say anything about “string processing”, and regexes are automatically assumed to be part of the mix.

    Haskell has a regex library but people tend to use one of the parser
    combinator libraries instead (Parsec or Attoparsec). Parsec reminds me
    a bit of SNOBOL patterns though the mechanism is not at all similar.

    SNOBOL was a very old fashioned funky language. Every statement
    optionally contained up to two different GOTOs. ICON was more modern
    looking. I actually used SNOBOL as as a kid, and it was fun. But yes,
    museum piece.

    I'm not old enough to have been around for when large applications were
    written in assembly language, but SPITBOL was one of those applications,
    and perusing the source code is very impressive.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)