• Python (Re: iso646.h)

    From Kalevi Kolttonen@21:1/5 to bart on Tue Jan 23 19:32:26 2024
    bart <bc@freeuk.com> wrote:
    Presumably everyone knows what AND and OR mean. So
    why not just use AND and OR?

    Maybe back in the early days of C even a one byte
    mattered? strlen("AND") is 3 and strlen("&&") is 2.
    So they chose "&&" and then "||" was chosen because
    of symmetry? Just speculation, of course.

    Dennis Ritchie has said that he regretted the
    spelling of creat(2) function. Presumably the
    abbreviation was supposed to save one byte of
    storage.

    Anyway, sorry for the off-topic, but Python aims to
    be like what you say. It should be like executable
    pseudo-code in the sense that your carefully written
    code reads almost like plain English. I once wrote
    a 300 line Python script without any comments simply
    because all the identifiers were long enough and
    carefully chosen so that comments were not needed.

    But the Python designers botched at least one thing
    concerning that philosophy: private functions are not
    defined by "private" keyword like in Java but instead
    the designers violated their own basic principle of easy
    readability: the "privateness" is defined by
    by prefixing the function names with an underscore ("_").

    I find that decision wrong.

    br,
    KK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From bart@21:1/5 to Kalevi Kolttonen on Tue Jan 23 19:59:56 2024
    On 23/01/2024 19:32, Kalevi Kolttonen wrote:
    bart <bc@freeuk.com> wrote:
    Presumably everyone knows what AND and OR mean. So
    why not just use AND and OR?

    Maybe back in the early days of C even a one byte
    mattered?

    Plenty of languages already existed that used 'and', 'or' and 'not'.

    My first language did so as well, and was implemented on a smaller
    machine than the first C compiler.

    If compact code was advantageous, then you have to wonder about the considerable amount of punctuation in C.

    strlen("AND") is 3 and strlen("&&") is 2.
    So they chose "&&" and then "||" was chosen because
    of symmetry? Just speculation, of course.

    Why two & and two |? Was '|' even commonly available on keyboards at the
    time? I'm pretty sure 'o' and 'r' were!

    Although whether in lower case, I don't know. If not, then just typing
    'if' was going to be a problem.


    Dennis Ritchie has said that he regretted the
    spelling of creat(2) function. Presumably the
    abbreviation was supposed to save one byte of
    storage.

    Such identifiers would been exposed to external tools such as assemblers
    and linkers, which may have had their own limits. Keywords such as 'and'
    are internal to the C compiler.


    Anyway, sorry for the off-topic, but Python aims to
    be like what you say. It should be like executable
    pseudo-code

    That's a good idea. I've often wondered why, if pseudo-code is so easy
    to understand, why it isn't used more for real languages.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kalevi Kolttonen@21:1/5 to bart on Tue Jan 23 20:18:07 2024
    bart <bc@freeuk.com> wrote:
    On 23/01/2024 19:32, Kalevi Kolttonen wrote:
    bart <bc@freeuk.com> wrote:
    Presumably everyone knows what AND and OR mean. So
    why not just use AND and OR?

    Maybe back in the early days of C even a one byte
    mattered?

    Plenty of languages already existed that used 'and', 'or' and 'not'.

    I actually know that but it could have mattered
    to Dennis Ritchie to be as succinct as possible.

    In the same spirit as UNIX has "ls" not "list", "cp"
    not "copy" and "mv" not "move".

    My first language did so as well, and was implemented on a smaller
    machine than the first C compiler.

    If compact code was advantageous, then you have to wonder about the considerable amount of punctuation in C.

    True.

    strlen("AND") is 3 and strlen("&&") is 2.
    So they chose "&&" and then "||" was chosen because
    of symmetry? Just speculation, of course.

    Why two & and two |? Was '|' even commonly available on keyboards at the time? I'm pretty sure 'o' and 'r' were!

    I really do not know. I never thought of that but
    it does seem strange especially if one claims
    that they wanted to save storage.

    I guess some old formal logic books use
    a single "&" for logical AND before the operators
    became standardized.

    Although whether in lower case, I don't know. If not,
    then just typing
    'if' was going to be a problem.


    Dennis Ritchie has said that he regretted the
    spelling of creat(2) function. Presumably the
    abbreviation was supposed to save one byte of
    storage.

    Such identifiers would been exposed to external tools such as assemblers
    and linkers, which may have had their own limits. Keywords such as 'and'
    are internal to the C compiler.

    I don't believe strlen("create") == 6 would have
    exceeded any limits. Ritchie's regret seems to
    confirm that. It implies that he could have chosen
    "create" as well, but for some reason he did not
    do so.

    Anyway, sorry for the off-topic, but Python aims to
    be like what you say. It should be like executable
    pseudo-code

    That's a good idea. I've often wondered why, if pseudo-code
    is so easy to understand, why it isn't used more for real
    languages.

    Yes, Python is a nice language but the last time
    I checked, an O'Reilly Learning Python book was something
    like 2000 pages long...

    ChatGPT did not know the answer, but this time Google
    did: Learning Python, 5th edition (2013) is 1643 pages.

    I have no problem with large texts, but I just have to
    live with a proper subset of Python features.

    br,
    KK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Kalevi Kolttonen on Tue Jan 23 21:55:56 2024
    On Tue, 23 Jan 2024 19:32:26 -0000 (UTC), Kalevi Kolttonen wrote:

    Dennis Ritchie has said that he regretted the spelling of creat(2)
    function. Presumably the abbreviation was supposed to save one byte of storage.

    Given that, in POSIX, all the functions of creat(2) have been subsumed
    under open(2) anyway, we can largely ignore that.

    There are other worse problems with C. Like its use of “=” (the mathematical equality operator) for assignment, instead of using the “:=” symbol that the Algols had adopted.

    But the Python designers botched at least one thing concerning that philosophy: private functions are not defined by "private" keyword like
    in Java but instead the designers violated their own basic principle of
    easy readability: the "privateness" is defined by by prefixing the
    function names with an underscore ("_").

    That is merely a convention, a hint that the user might want to stay away
    from such a symbol, not a hard requirement, which is why it was designed
    that way. As Guido van Rossum has said: “We are all consenting adults here”.

    There are things wrong with Python you can complain about. But that isn’t
    one of them.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Keith Thompson on Tue Jan 23 22:00:28 2024
    On Tue, 23 Jan 2024 12:09:09 -0800, Keith Thompson wrote:

    C's predecessor language B ...

    Let me see if I understand the genealogy:

    B was an adaptation of Martin Richards’ BCPL. BCPL was a low-level,
    typeless language designed for system programming. It originated before byte-addressable machines became popular. In fact, Richards looked at
    adapting BCPL to the PDP-11, and came away unimpressed with the latter’s architecture.

    So B was BCPL adapted by the Bell Labs crew to work on a byte-addressable machine. But it still didn’t have types. And types turned out to be rather important to the implementation of a decent OS and accompanying software.
    So the Bell Labs came up with the successor language C, which did have
    types.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kalevi Kolttonen@21:1/5 to Lawrence D'Oliveiro on Tue Jan 23 22:47:30 2024
    Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Tue, 23 Jan 2024 19:32:26 -0000 (UTC), Kalevi Kolttonen wrote:

    Dennis Ritchie has said that he regretted the spelling of creat(2)
    function. Presumably the abbreviation was supposed to save one byte of
    storage.

    Given that, in POSIX, all the functions of creat(2) have been subsumed
    under open(2) anyway, we can largely ignore that.

    I know. creat() is now completely redundant because
    open() suffices. The reason I brought it up was just
    so that people would realize that at least sometimes
    it was a matter of saving storage space - even one
    byte.

    There are other worse problems with C. Like its use of “=” (the mathematical equality operator) for assignment, instead of using the “:=” symbol that the Algols had adopted.

    Well I started with Microsoft BASIC on Commodore 64 39 years ago.
    So I am well used to "=" and do not consider it a problem.

    But the Python designers botched at least one thing concerning that
    philosophy: private functions are not defined by "private" keyword like
    in Java but instead the designers violated their own basic principle of
    easy readability: the "privateness" is defined by by prefixing the
    function names with an underscore ("_").

    That is merely a convention, a hint that the user might want to stay away from such a symbol, not a hard requirement, which is why it was designed
    that way. As Guido van Rossum has said: “We are all consenting adults here”.

    What?! Are you saying that there is no way to label functions as private
    in Python? That sounds absolutely horrible. Why would anyone design a
    language with object-oriented features without support for encapsulation?

    br,
    KK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Kalevi Kolttonen on Tue Jan 23 23:37:40 2024
    On Tue, 23 Jan 2024 22:47:30 -0000 (UTC), Kalevi Kolttonen wrote:

    What?! Are you saying that there is no way to label functions as private
    in Python? That sounds absolutely horrible. Why would anyone design a language with object-oriented features without support for
    encapsulation?

    Because Python is not Java.

    For comparison, Java’s core language reference manual is (last I checked) around 900 pages. Python’s core language is less than a quarter of that.
    And yet it manages to include features, like custom operator overloads,
    that Java does not.

    Python also has metaclasses. Does your favourite OO language have
    metaclasses?

    Python doesn’t need “final” or “private” or “protected”, because it is
    after all a dynamic language. You can write functions which are class
    factories and function factories.

    Actually, you can achieve the effect of access restrictions that way.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Kalevi Kolttonen on Tue Jan 23 23:51:53 2024
    kalevi@kolttonen.fi (Kalevi Kolttonen) writes:
    Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Tue, 23 Jan 2024 19:32:26 -0000 (UTC), Kalevi Kolttonen wrote:

    Dennis Ritchie has said that he regretted the spelling of creat(2)
    function. Presumably the abbreviation was supposed to save one byte of
    storage.

    Given that, in POSIX, all the functions of creat(2) have been subsumed
    under open(2) anyway, we can largely ignore that.

    I know. creat() is now completely redundant because
    open() suffices. The reason I brought it up was just
    so that people would realize that at least sometimes
    it was a matter of saving storage space - even one
    byte.

    IIRC, it was more about allowing space for a leading underscore
    added during the link process.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From bart@21:1/5 to Kalevi Kolttonen on Wed Jan 24 00:06:14 2024
    On 23/01/2024 22:47, Kalevi Kolttonen wrote:
    Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Tue, 23 Jan 2024 19:32:26 -0000 (UTC), Kalevi Kolttonen wrote:

    Dennis Ritchie has said that he regretted the spelling of creat(2)
    function. Presumably the abbreviation was supposed to save one byte of
    storage.

    Given that, in POSIX, all the functions of creat(2) have been subsumed
    under open(2) anyway, we can largely ignore that.

    I know. creat() is now completely redundant because
    open() suffices. The reason I brought it up was just
    so that people would realize that at least sometimes
    it was a matter of saving storage space - even one
    byte.

    There are other worse problems with C. Like its use of “=” (the
    mathematical equality operator) for assignment, instead of using the “:=”
    symbol that the Algols had adopted.

    Well I started with Microsoft BASIC on Commodore 64 39 years ago.
    So I am well used to "=" and do not consider it a problem.

    I've used ":=" with Algol and "=" with Fortran (a bit longer ago).

    That is not itself the problem.

    The problem is allowing both assignment and equality within the same expression, which is what C does. Algol, Fortran and BASIC didn't do that.

    If that wasn't the case, then you could use "=" for both assignment, and equality, without ambiguity.

    Languages that use ":=" and "=" for those operations, fare better than C
    that uses "=" and "==".

    But the Python designers botched at least one thing concerning that
    philosophy: private functions are not defined by "private" keyword like
    in Java but instead the designers violated their own basic principle of
    easy readability: the "privateness" is defined by by prefixing the
    function names with an underscore ("_").

    That is merely a convention, a hint that the user might want to stay away
    from such a symbol, not a hard requirement, which is why it was designed
    that way. As Guido van Rossum has said: “We are all consenting adults
    here”.

    What?! Are you saying that there is no way to label functions as private
    in Python? That sounds absolutely horrible. Why would anyone design a language with object-oriented features without support for encapsulation?

    Python is 'ultra-dynamic'. That's why it's so hard to make it
    performant. So you can do this:

    import math

    math.pi = "pie"
    math.sqrt = lambda x:x*x

    print(math.pi*2)
    print(math.sqrt(10))

    Output is:

    piepie
    100

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Keith Thompson on Wed Jan 24 00:41:02 2024
    On Tue, 23 Jan 2024 15:35:39 -0800, Keith Thompson wrote:

    The keyboard required a lot more physical force than modern keyboards
    do, which made names like "mv" and "rm" easier to type than, say
    "rename" and "delete".

    And yet it turns out the OS calls are indeed things like “rename” and “unlink”, not “mv” or “rm”.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Lawrence D'Oliveiro on Wed Jan 24 03:13:05 2024
    On 2024-01-24, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Tue, 23 Jan 2024 15:35:39 -0800, Keith Thompson wrote:

    The keyboard required a lot more physical force than modern keyboards
    do, which made names like "mv" and "rm" easier to type than, say
    "rename" and "delete".

    And yet it turns out the OS calls are indeed things like “rename” and “unlink”, not “mv” or “rm”.

    Consider that the /bin/mv executable perhaps only contains as few
    as just one call to the rename function.

    The mv program is invoked many more times than the number of
    times someone typed out the rename call in its source code.

    Short keyboard sequences in the UI level are much more important
    than function names in the source code.

    --
    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 Janis Papanagnou@21:1/5 to Kalevi Kolttonen on Wed Jan 24 08:38:39 2024
    On 23.01.2024 21:32, Kalevi Kolttonen wrote:

    The term "conditional and" is probably not so good, but the
    meaning of it here refers to the familiar short-circuiting
    behaviour of C's "&&". The same behaviour exists in, I
    think, all UNIX shells.

    If I write this in bash:

    rm foo.txt && rm bar.txt

    then if the first rm-command fails with a non-zero exit value,
    then the second rm-command is not executed at all.

    I don't think shell's behavior is so intuitive (unless also
    considering the evaluation semantics)

    $ echo a || echo b && echo c
    a
    c


    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to bart on Wed Jan 24 12:37:48 2024
    On 24/01/2024 01:06, bart wrote:
    On 23/01/2024 22:47, Kalevi Kolttonen wrote:
    Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Tue, 23 Jan 2024 19:32:26 -0000 (UTC), Kalevi Kolttonen wrote:

    Dennis Ritchie has said that he regretted the spelling of creat(2)
    function. Presumably the abbreviation was supposed to save one byte of >>>> storage.

    Given that, in POSIX, all the functions of creat(2) have been subsumed
    under open(2) anyway, we can largely ignore that.

    I know. creat() is now completely redundant because
    open() suffices. The reason I brought it up was just
    so that people would realize that at least sometimes
    it was a matter of saving storage space - even one
    byte.

    There are other worse problems with C. Like its use of “=” (the
    mathematical equality operator) for assignment, instead of using the
    “:=”
    symbol that the Algols had adopted.

    Well I started with Microsoft BASIC on Commodore 64 39 years ago.
    So I am well used to "=" and do not consider it a problem.

    I've used ":=" with Algol and "=" with Fortran (a bit longer ago).

    That is not itself the problem.

    The problem is allowing both assignment and equality within the same expression, which is what C does. Algol, Fortran and BASIC didn't do that.

    If that wasn't the case, then you could use "=" for both assignment, and equality, without ambiguity.

    Languages that use ":=" and "=" for those operations, fare better than C
    that uses "=" and "==".

    But the Python designers botched at least one thing concerning that
    philosophy: private functions are not defined by "private" keyword like >>>> in Java but instead the designers violated their own basic principle of >>>> easy readability: the "privateness" is defined by by prefixing the
    function names with an underscore ("_").

    That is merely a convention, a hint that the user might want to stay
    away
    from such a symbol, not a hard requirement, which is why it was designed >>> that way. As Guido van Rossum has said: “We are all consenting adults
    here”.

    What?! Are you saying that there is no way to label functions as private
    in Python? That sounds absolutely horrible. Why would anyone design a
    language with object-oriented features without support for encapsulation?

    Python is 'ultra-dynamic'. That's why it's so hard to make it
    performant. So you can do this:

        import math

        math.pi = "pie"
        math.sqrt = lambda x:x*x

        print(math.pi*2)
        print(math.sqrt(10))

    Output is:

        piepie
        100


    Nothing beats Forth:

    : 1 2 ; ok
    1 1 + . 4 ok

    Redefining "1" to mean "2" is a great way to obfuscate your code :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Cross@21:1/5 to Kalevi Kolttonen on Wed Jan 24 13:30:04 2024
    In article <uop48a$1dmoe$1@dont-email.me>,
    Kalevi Kolttonen <kalevi@kolttonen.fi> wrote:
    bart <bc@freeuk.com> wrote:
    Presumably everyone knows what AND and OR mean. So
    why not just use AND and OR?

    Maybe back in the early days of C even a one byte
    mattered? strlen("AND") is 3 and strlen("&&") is 2.
    So they chose "&&" and then "||" was chosen because
    of symmetry? Just speculation, of course.

    Dennis Ritchie has said that he regretted the
    spelling of creat(2) function. Presumably the
    abbreviation was supposed to save one byte of
    storage.

    Dennis did not say that; Ken Thompson did. It was a bit of a
    gag reply to the question, "if you had to do Unix over again,
    what would you change?"

    `creat` dates from PDP-7 Unix, and the PDP-7 was word oriented.
    It's unclear why it's spelled that way, however; there was also
    a `rename` system call that uses the full 6 characters for its
    name. Perhaps because internally, `creat` calls a subroutine
    called `icreat` which has a full six character name, and there
    was a desire for symmetry in the identifiers. Note that
    identifiers were limited to six characters on that system,
    though `creat` is only 5.

    - Dan C.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kalevi Kolttonen@21:1/5 to Joe Pfeiffer on Wed Jan 24 15:07:57 2024
    Joe Pfeiffer <pfeiffer@cs.nmsu.edu> wrote:
    Back when I was learning Unix and C (late 1970s), the consensus belief
    in my department was that they were simply poor typists. So many
    commands that use two letters, one that can be typed with each hand, or commands that are one letter repeated (I've got a dd copying a disk
    image even as we speak).

    That could well be. Or maybe they wanted terse
    commands so that everybody could enter them quicker.

    I am actually a big fan of those short commands. It
    is not difficult to remember them and they are
    so fast to enter.

    br,
    KK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joe Pfeiffer@21:1/5 to Kalevi Kolttonen on Wed Jan 24 07:49:25 2024
    kalevi@kolttonen.fi (Kalevi Kolttonen) writes:

    bart <bc@freeuk.com> wrote:
    On 23/01/2024 19:32, Kalevi Kolttonen wrote:
    bart <bc@freeuk.com> wrote:
    Presumably everyone knows what AND and OR mean. So
    why not just use AND and OR?

    Maybe back in the early days of C even a one byte
    mattered?

    Plenty of languages already existed that used 'and', 'or' and 'not'.

    I actually know that but it could have mattered
    to Dennis Ritchie to be as succinct as possible.

    In the same spirit as UNIX has "ls" not "list", "cp"
    not "copy" and "mv" not "move".

    My first language did so as well, and was implemented on a smaller
    machine than the first C compiler.

    If compact code was advantageous, then you have to wonder about the
    considerable amount of punctuation in C.

    True.

    strlen("AND") is 3 and strlen("&&") is 2.
    So they chose "&&" and then "||" was chosen because
    of symmetry? Just speculation, of course.

    Why two & and two |? Was '|' even commonly available on keyboards at the
    time? I'm pretty sure 'o' and 'r' were!

    I really do not know. I never thought of that but
    it does seem strange especially if one claims
    that they wanted to save storage.

    Back when I was learning Unix and C (late 1970s), the consensus belief
    in my department was that they were simply poor typists. So many
    commands that use two letters, one that can be typed with each hand, or commands that are one letter repeated (I've got a dd copying a disk
    image even as we speak).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Cross@21:1/5 to pfeiffer@cs.nmsu.edu on Wed Jan 24 15:17:53 2024
    In article <1bbk9a4wi2.fsf@pfeifferfamily.net>,
    Joe Pfeiffer <pfeiffer@cs.nmsu.edu> wrote:
    kalevi@kolttonen.fi (Kalevi Kolttonen) writes:
    [snip]
    Why two & and two |? Was '|' even commonly available on keyboards at the >>> time? I'm pretty sure 'o' and 'r' were!

    I really do not know. I never thought of that but
    it does seem strange especially if one claims
    that they wanted to save storage.

    Back when I was learning Unix and C (late 1970s), the consensus belief
    in my department was that they were simply poor typists. So many
    commands that use two letters, one that can be typed with each hand, or >commands that are one letter repeated (I've got a dd copying a disk
    image even as we speak).

    The two-letter command thing dates from Multics, where most
    commands had a "long" form (e.g., `list`) and a short form
    (`ls`).

    It is true that they were using teletypes like the ASR-33, which
    were both slow and difficult to type on (more force required per
    keystroke compared to modern keyboards), so brevity was prized.
    Also, line rates were very slow, 110 or 300 BAUD; economy of
    expression giving brevity lead to greater throughput.

    One sees this carry through to B: in Dennis Ritchie's paper on
    the history of C, one sees that many of the characteristics of
    B were designed to economize on space, as the PDP-7 was a small
    machine. https://www.bell-labs.com/usr/dmr/www/chist.html

    - Dan C.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Joe Pfeiffer on Wed Jan 24 15:56:08 2024
    Joe Pfeiffer <pfeiffer@cs.nmsu.edu> writes:
    kalevi@kolttonen.fi (Kalevi Kolttonen) writes:

    bart <bc@freeuk.com> wrote:
    On 23/01/2024 19:32, Kalevi Kolttonen wrote:
    bart <bc@freeuk.com> wrote:
    Presumably everyone knows what AND and OR mean. So
    why not just use AND and OR?

    Maybe back in the early days of C even a one byte
    mattered?

    Plenty of languages already existed that used 'and', 'or' and 'not'.

    I actually know that but it could have mattered
    to Dennis Ritchie to be as succinct as possible.

    In the same spirit as UNIX has "ls" not "list", "cp"
    not "copy" and "mv" not "move".

    My first language did so as well, and was implemented on a smaller
    machine than the first C compiler.

    If compact code was advantageous, then you have to wonder about the
    considerable amount of punctuation in C.

    True.

    strlen("AND") is 3 and strlen("&&") is 2.
    So they chose "&&" and then "||" was chosen because
    of symmetry? Just speculation, of course.

    Why two & and two |? Was '|' even commonly available on keyboards at the >>> time? I'm pretty sure 'o' and 'r' were!

    I really do not know. I never thought of that but
    it does seem strange especially if one claims
    that they wanted to save storage.

    Back when I was learning Unix and C (late 1970s), the consensus belief
    in my department was that they were simply poor typists.

    It's difficult to type quickly on an ASR-33, I suspect that
    would have part of the reason for short commands. Two
    letter commands were common on the burroughs mainframes
    in the 60s and 70s and likely on other systems as well.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From bart@21:1/5 to Dan Cross on Wed Jan 24 15:46:04 2024
    On 24/01/2024 15:17, Dan Cross wrote:
    In article <1bbk9a4wi2.fsf@pfeifferfamily.net>,
    Joe Pfeiffer <pfeiffer@cs.nmsu.edu> wrote:
    kalevi@kolttonen.fi (Kalevi Kolttonen) writes:
    [snip]
    Why two & and two |? Was '|' even commonly available on keyboards at the >>>> time? I'm pretty sure 'o' and 'r' were!

    I really do not know. I never thought of that but
    it does seem strange especially if one claims
    that they wanted to save storage.

    Back when I was learning Unix and C (late 1970s), the consensus belief
    in my department was that they were simply poor typists. So many
    commands that use two letters, one that can be typed with each hand, or
    commands that are one letter repeated (I've got a dd copying a disk
    image even as we speak).

    The two-letter command thing dates from Multics, where most
    commands had a "long" form (e.g., `list`) and a short form
    (`ls`).

    It is true that they were using teletypes like the ASR-33, which
    were both slow and difficult to type on (more force required per
    keystroke compared to modern keyboards), so brevity was prized.
    Also, line rates were very slow, 110 or 300 BAUD; economy of
    expression giving brevity lead to greater throughput.

    I think you're just making excuses.

    I used ASR33s extensively and had no trouble typing on them. (Other than
    a small latency between pressing a key and having it printed that you
    got used to, but it didn't affect your typing speed.)

    A 110 baud speed means max 10 characters per second, about 120 words per minute. That's twice as fast as an expert typist on a modern keyboard.

    So it's hardly as though that was the limiting factor.

    It's also laughable that I get shouted down when I complain about all
    the extra junk you have to type here:

    cc prog.c -o prog -lm

    compared with a minimal:

    cc prog

    but the use of 2-letter abbbreviations to save having to type out a 3 or 4-letter word (which is easier and quicker to type type than random punctuation) gets lauded.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Cross@21:1/5 to bc@freeuk.com on Wed Jan 24 16:27:31 2024
    In article <uorbbr$1s2e2$1@dont-email.me>, bart <bc@freeuk.com> wrote:
    On 24/01/2024 15:17, Dan Cross wrote:
    In article <1bbk9a4wi2.fsf@pfeifferfamily.net>,
    Joe Pfeiffer <pfeiffer@cs.nmsu.edu> wrote:
    kalevi@kolttonen.fi (Kalevi Kolttonen) writes:
    [snip]
    Why two & and two |? Was '|' even commonly available on keyboards at the >>>>> time? I'm pretty sure 'o' and 'r' were!

    I really do not know. I never thought of that but
    it does seem strange especially if one claims
    that they wanted to save storage.

    Back when I was learning Unix and C (late 1970s), the consensus belief
    in my department was that they were simply poor typists. So many
    commands that use two letters, one that can be typed with each hand, or
    commands that are one letter repeated (I've got a dd copying a disk
    image even as we speak).

    The two-letter command thing dates from Multics, where most
    commands had a "long" form (e.g., `list`) and a short form
    (`ls`).

    It is true that they were using teletypes like the ASR-33, which
    were both slow and difficult to type on (more force required per
    keystroke compared to modern keyboards), so brevity was prized.
    Also, line rates were very slow, 110 or 300 BAUD; economy of
    expression giving brevity lead to greater throughput.

    I think you're just making excuses.

    Rather, I'm simply explaining the history.

    I used ASR33s extensively and had no trouble typing on them. (Other than
    a small latency between pressing a key and having it printed that you
    got used to, but it didn't affect your typing speed.)

    Anecdotal. I, too, have typed on an ASR-33. I did not find it
    pleasant and my hands hurt after a short time.

    A 110 baud speed means max 10 characters per second, about 120 words per >minute. That's twice as fast as an expert typist on a modern keyboard.

    So it's hardly as though that was the limiting factor.

    It's also laughable that I get shouted down when I complain about all
    the extra junk you have to type here:

    cc prog.c -o prog -lm

    compared with a minimal:

    cc prog

    but the use of 2-letter abbbreviations to save having to type out a 3 or >4-letter word (which is easier and quicker to type type than random >punctuation) gets lauded.

    That all seems irrelevant to the introduction of two- and three-
    letter command names in Unix. Which, as I mentioned, largely
    came from Multics.

    - Dan C.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From bart@21:1/5 to Dan Cross on Wed Jan 24 19:55:59 2024
    On 24/01/2024 16:27, Dan Cross wrote:
    In article <uorbbr$1s2e2$1@dont-email.me>, bart <bc@freeuk.com> wrote:

    I think you're just making excuses.

    Rather, I'm simply explaining the history.

    I used ASR33s extensively and had no trouble typing on them. (Other than
    a small latency between pressing a key and having it printed that you
    got used to, but it didn't affect your typing speed.)

    Anecdotal. I, too, have typed on an ASR-33. I did not find it
    pleasant and my hands hurt after a short time.


    If this is the same terminal that you have to type program source code
    on (especially C source!), and edit it, then clearly having two-letter
    shell file commands instead of 3 or 4 letters is giving to make little
    overall difference to how long development might take, or any fatigue experienced.

    (I don't remember that bit, but maybe my programs were short, and I
    could only book terminals for an hour at a time anyway.)

    I think it was suggested somewhere that the characteristics of such a
    terminal were a reason for the short commands.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Cross@21:1/5 to bc@freeuk.com on Wed Jan 24 20:57:16 2024
    In article <uorq0d$1ueal$1@dont-email.me>, bart <bc@freeuk.com> wrote:
    On 24/01/2024 16:27, Dan Cross wrote:
    In article <uorbbr$1s2e2$1@dont-email.me>, bart <bc@freeuk.com> wrote:

    I think you're just making excuses.

    Rather, I'm simply explaining the history.

    I used ASR33s extensively and had no trouble typing on them. (Other than >>> a small latency between pressing a key and having it printed that you
    got used to, but it didn't affect your typing speed.)

    Anecdotal. I, too, have typed on an ASR-33. I did not find it
    pleasant and my hands hurt after a short time.

    If this is the same terminal that you have to type program source code
    on (especially C source!), and edit it, then clearly having two-letter
    shell file commands instead of 3 or 4 letters is giving to make little >overall difference to how long development might take, or any fatigue >experienced.

    That seems subjective.

    (I don't remember that bit, but maybe my programs were short, and I
    could only book terminals for an hour at a time anyway.)

    I think it was suggested somewhere that the characteristics of such a >terminal were a reason for the short commands.

    Dunno. That's what some folks on the Multics project told me.
    Unix just carried forward what they were familiar with, and they
    seemed to think it was easier to type, as well.

    Perhaps you personally had a different experience on an ASR-33.
    I suppose that's nice for you, but hardly relevant to the
    mindset of a different group of people more than 50 years ago.

    - Dan C.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to bart on Wed Jan 24 20:17:53 2024
    On Wed, 24 Jan 2024 15:46:04 +0000, bart wrote:

    It's also laughable that I get shouted down when I complain about all
    the extra junk you have to type here:

    cc prog.c -o prog -lm

    We normally have Makefiles to do that for us.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From bart@21:1/5 to Lawrence D'Oliveiro on Thu Jan 25 12:13:27 2024
    On 24/01/2024 20:17, Lawrence D'Oliveiro wrote:
    On Wed, 24 Jan 2024 15:46:04 +0000, bart wrote:

    It's also laughable that I get shouted down when I complain about all
    the extra junk you have to type here:

    cc prog.c -o prog -lm

    We normally have Makefiles to do that for us.

    You have 17 different source files like 'prog.c' in the same folder,
    each a different program, and are using 4 different compilers, which are invoked in ad hoc permutations.

    So your answer is to just put it all in a makefile (I'd like to see what
    you'd put in it) and type 'make', which magically knows your intentions?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kalevi Kolttonen@21:1/5 to bart on Thu Jan 25 14:57:14 2024
    bart <bc@freeuk.com> wrote:
    On 24/01/2024 20:17, Lawrence D'Oliveiro wrote:
    On Wed, 24 Jan 2024 15:46:04 +0000, bart wrote:

    It's also laughable that I get shouted down when I complain about all
    the extra junk you have to type here:

    cc prog.c -o prog -lm

    We normally have Makefiles to do that for us.

    You have 17 different source files like 'prog.c' in the same folder,
    each a different program, and are using 4 different compilers, which are invoked in ad hoc permutations.

    So your answer is to just put it all in a makefile (I'd like to see what you'd put in it) and type 'make', which magically knows your intentions?

    I think I have said this before: The first mistake in that approach is
    lumping all the different C source files in the same directory. You
    should use subdirectories for different programs and their corresponding
    source files.

    Anyway, even in this insane situation, you could use a Makefile. But
    typing "make" would not suffice, you would have to use something like:

    make <program name>

    br,
    KK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Kalevi Kolttonen on Thu Jan 25 16:17:12 2024
    On 25/01/2024 15:57, Kalevi Kolttonen wrote:
    bart <bc@freeuk.com> wrote:
    On 24/01/2024 20:17, Lawrence D'Oliveiro wrote:
    On Wed, 24 Jan 2024 15:46:04 +0000, bart wrote:

    It's also laughable that I get shouted down when I complain about all
    the extra junk you have to type here:

    cc prog.c -o prog -lm

    We normally have Makefiles to do that for us.

    You have 17 different source files like 'prog.c' in the same folder,
    each a different program, and are using 4 different compilers, which are
    invoked in ad hoc permutations.

    So your answer is to just put it all in a makefile (I'd like to see what
    you'd put in it) and type 'make', which magically knows your intentions?

    "Any sufficiently advanced technology is indistinguishable from magic."


    I think I have said this before: The first mistake in that approach is lumping all the different C source files in the same directory. You
    should use subdirectories for different programs and their corresponding source files.

    Anyway, even in this insane situation, you could use a Makefile. But
    typing "make" would not suffice, you would have to use something like:

    make <program name>


    Or you start your makefile with:

    .PHONY all
    all : prog1 prog2 prog3 prog4

    and then by default it will build all the programs.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From bart@21:1/5 to Kalevi Kolttonen on Thu Jan 25 15:52:09 2024
    On 25/01/2024 14:57, Kalevi Kolttonen wrote:
    bart <bc@freeuk.com> wrote:
    On 24/01/2024 20:17, Lawrence D'Oliveiro wrote:
    On Wed, 24 Jan 2024 15:46:04 +0000, bart wrote:

    It's also laughable that I get shouted down when I complain about all
    the extra junk you have to type here:

    cc prog.c -o prog -lm

    We normally have Makefiles to do that for us.

    You have 17 different source files like 'prog.c' in the same folder,
    each a different program, and are using 4 different compilers, which are
    invoked in ad hoc permutations.

    So your answer is to just put it all in a makefile (I'd like to see what
    you'd put in it) and type 'make', which magically knows your intentions?

    I think I have said this before: The first mistake in that approach is lumping all the different C source files in the same directory.

    Then you will instead be issuing commands to switch between directories
    all the time.

    Is that what you do with, say, image files, have a dedicated folder per picture?

    What's wrong having of lots of instances of the same type of file in one folder? (Most cameras do exactly that.) Then if you had a program P to
    operate on an image, you just type:

    P file

    (Without even an extension if P only works with .jpg for example.)

    This is how I think it is reasonable for a compiler for a specific
    language to work.

    You
    should use subdirectories for different programs and their corresponding source files.

    Anyway, even in this insane situation, you could use a Makefile.

    A typical session in a console or terminal (at least for me) is typing
    commands to copy, create, delete, rename files and folders, or to
    navigate between folders, launch programs which have parameters, etc. etc.

    Some of those programs could be compilers, others the programs they
    generate.

    All lots of ad hoc activities with no particular pattern.

    You wouldn't put such an arbitrary sequence, that you don't know in
    advance anyway, into a script such as a makefile. Only if you see a
    repeating pattern that you will invoke repeatedly.

    Fortunately most such commands mentioned are sensible: there is rarely extraneous detail you have to enter over and over again, when it is
    something that it should know or assume anyway.

    My comment was anyway just highlighting the difference between people
    getting uptight about having to type 'list' instead 'ls', and those who
    just shrug at having to do 'gcc prog.c -o prog.c -lm ...'. Apparently
    that is acceptable.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kalevi Kolttonen@21:1/5 to bart on Thu Jan 25 16:14:29 2024
    bart <bc@freeuk.com> wrote:
    On 25/01/2024 14:57, Kalevi Kolttonen wrote:
    bart <bc@freeuk.com> wrote:
    On 24/01/2024 20:17, Lawrence D'Oliveiro wrote:
    On Wed, 24 Jan 2024 15:46:04 +0000, bart wrote:

    It's also laughable that I get shouted down when I complain about all >>>>> the extra junk you have to type here:

    cc prog.c -o prog -lm

    We normally have Makefiles to do that for us.

    You have 17 different source files like 'prog.c' in the same folder,
    each a different program, and are using 4 different compilers, which are >>> invoked in ad hoc permutations.

    So your answer is to just put it all in a makefile (I'd like to see what >>> you'd put in it) and type 'make', which magically knows your intentions?

    I think I have said this before: The first mistake in that approach is
    lumping all the different C source files in the same directory.

    Then you will instead be issuing commands to switch between directories
    all the time.

    You can stay in the top level directory where you can do:

    make -C <subdirectory> <makefile target>

    Make will then descend into the subdirectory but your shell's working
    directory will not change.

    Is that what you do with, say, image files, have a dedicated folder per picture?

    Image files are different in that normally you do not need to
    use external programs to generate them like building binary programs
    from source code.

    But it makes sense to use subdirectories even with pictures. For
    example to have a dedicated directory for:

    1) Your recent New York holiday
    2) Christmas 2023
    3) Your rabbits

    But having single photos in their dedicated directories does
    not sound too great.

    What's wrong having of lots of instances of the same type of file in one folder? (Most cameras do exactly that.) Then if you had a program P to operate on an image, you just type:

    P file

    (Without even an extension if P only works with .jpg for example.)

    Yes, your C files are the same "type" as they are all C code. But
    their content is not related to each other, they are are all for
    different programs and should be separated to subdirectories.

    But I see that you are not open to this idea that I find obvious
    so it is pretty useless to discuss it any longer.

    By the way, I have leeched some obscure movies using BitTorrent.

    I always put them into their own subdirectories under ~/movies
    even though they might contain only one, two or three files
    (i.e. the movie itself, maybe a subtitles file and some kind of warez NFO file).

    This is how I think it is reasonable for a compiler for a specific
    language to work.

    You
    should use subdirectories for different programs and their corresponding
    source files.

    Anyway, even in this insane situation, you could use a Makefile.

    A typical session in a console or terminal (at least for me) is typing commands to copy, create, delete, rename files and folders, or to
    navigate between folders, launch programs which have parameters, etc. etc.

    Some of those programs could be compilers, others the programs they
    generate.

    All lots of ad hoc activities with no particular pattern.

    You wouldn't put such an arbitrary sequence, that you don't know in
    advance anyway, into a script such as a makefile. Only if you see a
    repeating pattern that you will invoke repeatedly.

    Fortunately most such commands mentioned are sensible: there is rarely extraneous detail you have to enter over and over again, when it is
    something that it should know or assume anyway.

    My comment was anyway just highlighting the difference between people
    getting uptight about having to type 'list' instead 'ls', and those who
    just shrug at having to do 'gcc prog.c -o prog.c -lm ...'. Apparently
    that is acceptable.

    Like somebody said: At least on UNIX/Linux/*BSD/Mac you rarely invoke
    the compiler directly. Yeah I know you hate them but the commands are
    buried inside Makefiles so that you can type easy make commands.

    br,
    KK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to bart on Thu Jan 25 18:06:04 2024
    On 2024-01-25, bart <bc@freeuk.com> wrote:
    On 24/01/2024 20:17, Lawrence D'Oliveiro wrote:
    On Wed, 24 Jan 2024 15:46:04 +0000, bart wrote:

    It's also laughable that I get shouted down when I complain about all
    the extra junk you have to type here:

    cc prog.c -o prog -lm

    We normally have Makefiles to do that for us.

    You have 17 different source files like 'prog.c' in the same folder,
    each a different program, and are using 4 different compilers, which are invoked in ad hoc permutations.

    So your answer is to just put it all in a makefile (I'd like to see what you'd put in it) and type 'make', which magically knows your intentions?

    Putting that into any file at all would be a good start.

    The situation can be organized very nicely with GNU make.


    compile_xcc = touch $(2) # fictitious
    compile_gcc = gcc $(1) -o $(2)

    srcs := $(wildcard *.c)

    progs.gcc := $(patsubst %.c,%.gcc,$(srcs))
    progs.xcc := $(patsubst %.c,%.xcc,$(srcs))
    progs := $(progs.gcc) $(progs.xcc)

    %.gcc : %.c; $(call compile_gcc,$<,$@)

    %.xcc : %.c; $(call compile_xcc,$<,$@)

    .PHONY: all clean
    all : $(progs)

    clean : ; rm -f $(progs)



    Now if we type "make", every .c file is built into a .gcc
    and .xcc file.

    We can use "make whatever.gcc" just to update that, if necessary.

    "make clean" removes all the executables.

    "make -n" will show commands without running them.

    Suppose we want the gcc executables in a gcc/ directory,
    and the xcc ones in xcc/. We can make it a bit more complicated,
    and actually make the creation of the directory a dependency.
    Because the timestamps of directories is irrelevant (only their
    existence or absence) we use the "order only prerequisite" feature
    of GNU Make, indicated by the | character.



    compile_xcc = touch $(2) # fictitious
    compile_gcc = gcc $(1) -o $(2)

    srcs := $(wildcard *.c)

    progs.gcc := $(patsubst %.c,gcc/%,$(srcs))
    progs.xcc := $(patsubst %.c,xcc/%,$(srcs))
    progs := $(progs.gcc) $(progs.xcc)

    gcc/% : %.c; $(call compile_gcc,$<,$@)

    xcc/% : %.c; $(call compile_xcc,$<,$@)

    % : ; mkdir $@

    .PHONY: all clean
    all : $(progs)

    $(progs.gcc) : | gcc
    $(progs.xcc) : | xcc

    clean : ; rm -f $(progs); rmdir xcc gcc



    Example session:

    $ ls
    Makefile prog.c
    $ make
    mkdir gcc
    gcc prog.c -o gcc/prog
    mkdir xcc
    touch xcc/prog
    $ ls gcc
    prog
    $ ls xcc
    prog
    $ rm -rf gcc
    $ make
    mkdir gcc
    gcc prog.c -o gcc/prog
    $ rm -rf xcc
    $ make
    mkdir xcc
    touch xcc/prog
    $ make clean
    rm -f gcc/prog xcc/prog; rmdir xcc gcc

    --
    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 bart@21:1/5 to Kaz Kylheku on Thu Jan 25 19:35:00 2024
    On 25/01/2024 18:06, Kaz Kylheku wrote:
    On 2024-01-25, bart <bc@freeuk.com> wrote:
    On 24/01/2024 20:17, Lawrence D'Oliveiro wrote:
    On Wed, 24 Jan 2024 15:46:04 +0000, bart wrote:

    It's also laughable that I get shouted down when I complain about all
    the extra junk you have to type here:

    cc prog.c -o prog -lm

    We normally have Makefiles to do that for us.

    You have 17 different source files like 'prog.c' in the same folder,
    each a different program, and are using 4 different compilers, which are
    invoked in ad hoc permutations.

    So your answer is to just put it all in a makefile (I'd like to see what
    you'd put in it) and type 'make', which magically knows your intentions?

    Putting that into any file at all would be a good start.



    You're sort of missing the point. There is no actual project here. This
    is a set of small test programs. The set may grow or shrink.

    I may try different compilers, or perhaps the same one with different
    options. Or I might try versions in a different language. Or work with intermediate obj or asm files.

    I just want to have those invocations as minimal as possible and as
    flexible as possible without adding an extra layer of indirection via
    scripting (and in a syntax that I find impossible) when it's not needed.

    When I need scripting, it'll likely be to chain together two more ops in
    order to compile and test.

    Actually one use-case, which is to compile A.c to A.exe with one
    compiler, run it, and then compile A.c to A.exe with another compiler,
    would run foul of how make works, which is to not recompile A.c because
    it thinks A.exe is up-to-date.

    Now you have to start fighting it, and even then you're never quite sure
    if you have the latest EXE.

    (Actually, gcc's habit of naming everything a.exe instead of prog.exe
    helps here, provided you remember it is a.exe. But it also hinders it,
    since a.exe clashes with my A.exe above (Windows being case
    insensitive.) 'A.c' was not specially chosen for my example, it was a coincidedence.)

    In short I just want to manually type these ad hoc commands from the
    command like I do anything else. I don't appreciate long-winded versions
    or ones which work differently from everything else.




    The situation can be organized very nicely with GNU make.


    compile_xcc = touch $(2) # fictitious
    compile_gcc = gcc $(1) -o $(2)

    srcs := $(wildcard *.c)

    progs.gcc := $(patsubst %.c,%.gcc,$(srcs))
    progs.xcc := $(patsubst %.c,%.xcc,$(srcs))
    progs := $(progs.gcc) $(progs.xcc)

    %.gcc : %.c; $(call compile_gcc,$<,$@)

    %.xcc : %.c; $(call compile_xcc,$<,$@)

    .PHONY: all clean
    all : $(progs)

    clean : ; rm -f $(progs)



    Now if we type "make", every .c file is built into a .gcc
    and .xcc file.

    We can use "make whatever.gcc" just to update that, if necessary.

    "make clean" removes all the executables.

    "make -n" will show commands without running them.

    Suppose we want the gcc executables in a gcc/ directory,
    and the xcc ones in xcc/. We can make it a bit more complicated,
    and actually make the creation of the directory a dependency.
    Because the timestamps of directories is irrelevant (only their
    existence or absence) we use the "order only prerequisite" feature
    of GNU Make, indicated by the | character.



    compile_xcc = touch $(2) # fictitious
    compile_gcc = gcc $(1) -o $(2)

    srcs := $(wildcard *.c)

    progs.gcc := $(patsubst %.c,gcc/%,$(srcs))
    progs.xcc := $(patsubst %.c,xcc/%,$(srcs))
    progs := $(progs.gcc) $(progs.xcc)

    gcc/% : %.c; $(call compile_gcc,$<,$@)

    xcc/% : %.c; $(call compile_xcc,$<,$@)

    % : ; mkdir $@

    .PHONY: all clean
    all : $(progs)

    $(progs.gcc) : | gcc
    $(progs.xcc) : | xcc

    clean : ; rm -f $(progs); rmdir xcc gcc



    Example session:

    $ ls
    Makefile prog.c
    $ make
    mkdir gcc
    gcc prog.c -o gcc/prog
    mkdir xcc
    touch xcc/prog
    $ ls gcc
    prog
    $ ls xcc
    prog
    $ rm -rf gcc
    $ make
    mkdir gcc
    gcc prog.c -o gcc/prog
    $ rm -rf xcc
    $ make
    mkdir xcc
    touch xcc/prog
    $ make clean
    rm -f gcc/prog xcc/prog; rmdir xcc gcc


    I'm lost.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Blue-Maned_Hawk@21:1/5 to Kalevi Kolttonen on Thu Jan 25 22:55:44 2024
    Kalevi Kolttonen wrote:

    What?! Are you saying that there is no way to label functions as private
    in Python? That sounds absolutely horrible. Why would anyone design a language with object-oriented features without support for
    encapsulation?

    Frankly, i would like to see that kind of thing adopted everywhere.
    Private variables, static subroutines, and opaque types are all things
    that serve only to forcibly restrict a programmer. Instead of putting up
    a barrier that can be hopped over when it's really necessary, they
    establish a thick, unclimbable wall that can never be bypassed even when
    you need to.



    --
    Blue-Maned_Hawk│shortens to Hawk│/ blu.mɛin.dʰak/ │he/him/his/himself/Mr.
    blue-maned_hawk.srht.site

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Lawrence D'Oliveiro on Fri Jan 26 05:48:25 2024
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Tue, 23 Jan 2024 22:47:30 -0000 (UTC), Kalevi Kolttonen wrote:

    What?! Are you saying that there is no way to label functions as
    private in Python? That sounds absolutely horrible. Why would
    anyone design a language with object-oriented features without
    support for encapsulation?

    I have to admit, this question made me laugh.

    [...]
    Python also has metaclasses. Does your favourite OO language have metaclasses?

    It does.

    But this being comp.lang.c, I am confining my remarks to
    commentary related to C.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ben Bacarisse@21:1/5 to Lawrence D'Oliveiro on Sat Jan 27 22:12:56 2024
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Tue, 23 Jan 2024 12:09:09 -0800, Keith Thompson wrote:

    C's predecessor language B ...

    Let me see if I understand the genealogy:

    B was an adaptation of Martin Richards’ BCPL. BCPL was a low-level, typeless language designed for system programming. It originated before byte-addressable machines became popular.

    In fact, Richards looked at
    adapting BCPL to the PDP-11, and came away unimpressed with the latter’s architecture.

    I didn't know that. Do you have a reference I can read?

    So B was BCPL adapted by the Bell Labs crew to work on a byte-addressable machine.

    Not really. B also worked on words. There were no language changes
    aimed at byte addressing. Both B and early BCPL accessed bytes with
    library functions. I say early BCPL because, while B evolved in to C,
    BCPL also evolved and later acquired a byte access operator, "%", along
    with the word access one: "!".

    But it still didn’t have types. And types turned out to be rather
    important to the implementation of a decent OS and accompanying
    software.

    Yes. Early C had types, but there were hardly checked. Their main
    purposes were to allow structures to be defined and to allow convenient
    access to operations that in B and BCPL needed different operators.
    Apart from the obvious byte, short, int and long accesses expressed
    using * and [..], C could also express integer and floating point
    addition with the same operator symbols. BCPL needed separate symbols
    for that and could not do mix-mode arithmetic with any ease at all.

    So the Bell Labs came up with the successor language C, which did have
    types.

    --
    Ben.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Ben Bacarisse on Sun Jan 28 00:29:56 2024
    On Sat, 27 Jan 2024 22:12:56 +0000, Ben Bacarisse wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    In fact, Richards looked at adapting BCPL to the PDP-11, and came away
    unimpressed with the latter’s architecture.

    I didn't know that. Do you have a reference I can read?

    I was trying to look for one, but couldn’t find it. I recall it had
    something to do with a report by Richards into the portability of BCPL.

    So B was BCPL adapted by the Bell Labs crew to work on a
    byte-addressable machine.

    Not really. B also worked on words.

    Yeah. According to this <https://user-web.icecube.wisc.edu/~dglo/c_class/history.html>, it was
    used on the PDP-7, and turned out to be unsuitable for the byte-
    addressable PDP-11.

    Elsewhere I read that B was a very close port of BCPL.

    I say early BCPL because, while B evolved in to C,
    BCPL also evolved and later acquired a byte access operator, "%", along
    with the word access one: "!".

    There a was a language used at DEC, called BLISS, which was typeless like
    BCPL. But it accessed things as generalized bitfields (I think assuming
    the compiler would suitably optimize constant values for offsets and bit widths). So it worked fine on byte-addressable machines. It was used for
    some system software on VMS.

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