• Re: ?The end of software secrecy is almost upon

    From Lawrence D?Oliveiro@3:633/10 to All on Tue Oct 20 20:00:03 2026
    On Tue, 20 Oct 2026 19:04:55 GMT, Charlie Gibbs wrote:

    The undisciplined use of GOTOs is bad, agreed.

    Is there such a thing as a *disciplined* use of gotos?

    I find the C code I write tends to do a lot of dynamic resource
    allocations. These can sometimes fail with errors. So error recovery
    will invariably involve cleaning up those parts of the allocations
    which already succeeded. Gotos are no good for this; you need to exit
    levels of structure nesting one by one, disposing of allocations as
    you go.

    I put together an example here <https://gitlab.com/ldo/a_structured_discipline_of_programming>. This
    is an extension module that offers services to Python code, because
    that is just about the worst example I could think of, for those who
    think gotos can cut it.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Tue Oct 20 20:20:39 2026
    On Tue, 20 Oct 2026 15:06:48 -0500, Lynn McGuire wrote:

    The key to writing any software is lots of commenting.

    A key point about comments is they should explain *why* the code is
    doing what it?s doing, not simply repeat *what* it is doing. E.g.

    watcher = inotify.Watcher.create()
    watching = {}
    # Monitor immediate containing directories for possibility of files
    # disappearing, assuming those directories will not themselves disappear!
    FILE_EVENTS = \
    { # watch for the file itself changing or disappearing
    IN_BIT.CLOSE_WRITE,
    IN_BIT.DELETE_SELF,
    IN_BIT.MOVE_SELF,
    IN_BIT.MASK_CREATE, # files mustn?t be the same!
    }
    for key in path_keys :
    path = config[key]
    parent = os.path.dirname(path) # assumes I don?t need to normalize path
    watching[path] = watcher.watch(path, FILE_EVENTS)
    # plus a watch on parent directory for disappeared file coming back:
    # (This won?t work if file was symlinked; do I care?)
    if parent not in watching :
    # files will typically be in same directory
    watching[parent] = watcher.watch \
    (
    parent,
    {IN_BIT.CREATE, IN_BIT.MOVED_TO, IN_BIT.ONLYDIR}
    )
    #end if
    #end for

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Charlie Gibbs@3:633/10 to All on Tue Oct 20 23:18:44 2026
    On 2026-10-20, Lawrence D?Oliveiro <ldo@nz.invalid> wrote:

    On Tue, 20 Oct 2026 19:04:55 GMT, Charlie Gibbs wrote:

    The undisciplined use of GOTOs is bad, agreed.

    Is there such a thing as a *disciplined* use of gotos?

    Yes, especially in COBOL or assembly language. For instance,
    a GOTO to the end of a function ensures any of its cleanup code
    gets executed, and fulfils a goal of structured proramming:
    each function has one exit point.

    I find the C code I write tends to do a lot of dynamic resource
    allocations. These can sometimes fail with errors. So error recovery
    will invariably involve cleaning up those parts of the allocations
    which already succeeded. Gotos are no good for this; you need to exit
    levels of structure nesting one by one, disposing of allocations as
    you go.

    I know that a lot of CS types are going to stick pins into little
    dolls that look like me for saying this, but IMHO resource pointers,
    handles, etc. should be global. Possible exceptions are resources
    that are going to be used solely by the current function - but even
    then, if that function calls another function that fails horribly,
    there's stuff that might not get cleaned up. That's why all my
    C programs contain a function quit_cleanup(char *errmsg), which
    de-allocates all resources and then exits (displaying "errmsg"
    if it isn't NULL). I can call that function anywhere, safe in
    the knowledge that by the time it finishes (it never returns),
    everything will have be freed.

    --
    /~\ Charlie Gibbs | In this world there are
    \ / <cgibbs@kltpzyxm.invalid> | two kinds of people:
    X I'm really at ac.dekanfrus | 1. Those who can extrapolate
    / \ if you read it the right way. | from incomplete data.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Steven G. Kargl@3:633/10 to All on Tue Oct 20 23:20:58 2026
    On Tue, 20 Oct 2026 20:00:03 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Tue, 20 Oct 2026 19:04:55 GMT, Charlie Gibbs wrote:

    The undisciplined use of GOTOs is bad, agreed.

    Is there such a thing as a *disciplined* use of gotos?


    Yes. D. Knuth, Structured Programming with go to Statements,
    ACM Computing Surveys (CSUR), Vol 6, Issue 4, Pp 261-301, 1974 https://doi.org/10.1145/356635.356640

    --
    steve

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Nuno Silva@3:633/10 to All on Wed Oct 21 01:29:00 2026
    On 2026-10-20, Lawrence D?Oliveiro wrote:

    On Tue, 20 Oct 2026 19:04:55 GMT, Charlie Gibbs wrote:

    The undisciplined use of GOTOs is bad, agreed.

    Is there such a thing as a *disciplined* use of gotos?

    I find the C code I write tends to do a lot of dynamic resource
    allocations. These can sometimes fail with errors. So error recovery
    will invariably involve cleaning up those parts of the allocations
    which already succeeded. Gotos are no good for this; you need to exit
    levels of structure nesting one by one, disposing of allocations as
    you go.

    I put together an example here <https://gitlab.com/ldo/a_structured_discipline_of_programming>. This
    is an extension module that offers services to Python code, because
    that is just about the worst example I could think of, for those who
    think gotos can cut it.

    IIRC cleanup routines are one of the places where the logic may be such
    that you can't structure it neatly without gotos.

    --
    Nuno Silva

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Wed Oct 21 01:27:31 2026
    On Tue, 20 Oct 2026 23:18:44 GMT, Charlie Gibbs wrote:

    On 2026-10-20, Lawrence D?Oliveiro <ldo@nz.invalid> wrote:

    I find the C code I write tends to do a lot of dynamic resource
    allocations. These can sometimes fail with errors. So error
    recovery will invariably involve cleaning up those parts of the
    allocations which already succeeded. Gotos are no good for this;
    you need to exit levels of structure nesting one by one, disposing
    of allocations as you go.

    I know that a lot of CS types are going to stick pins into little
    dolls that look like me for saying this, but IMHO resource pointers,
    handles, etc. should be global.

    Surely any variable which is only used locally to a particular block
    should be declared local to that block. Why should resource pointers
    be any different?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Charlie Gibbs@3:633/10 to All on Wed Oct 21 03:22:12 2026
    On 2026-10-21, Lawrence D?Oliveiro <ldo@nz.invalid> wrote:

    On Tue, 20 Oct 2026 23:18:44 GMT, Charlie Gibbs wrote:

    I know that a lot of CS types are going to stick pins into little
    dolls that look like me for saying this, but IMHO resource pointers,
    handles, etc. should be global.

    Surely any variable which is only used locally to a particular block
    should be declared local to that block. Why should resource pointers
    be any different?

    Many resource pointers aren't local, though. Consider a program
    which loads a table from a file, then uses it for lookups while
    processing data in another file. You might decompose the program
    into a function that loads the table, and another that performs
    lookups. The main routine calls the table load routine, and opens
    the file to be processed. It then loops reading records, calling
    the lookup function each time. The table, dynamically allocated by
    the table load function, must remain allocated when the allocator
    exits, and must be available to the lookup function on each call;
    it cannot be local to either of those functions.

    --
    /~\ Charlie Gibbs | In this world there are
    \ / <cgibbs@kltpzyxm.invalid> | two kinds of people:
    X I'm really at ac.dekanfrus | 1. Those who can extrapolate
    / \ if you read it the right way. | from incomplete data.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Wed Oct 21 05:35:40 2026
    On Wed, 21 Oct 2026 03:22:12 GMT, Charlie Gibbs wrote:

    On 2026-10-21, Lawrence D?Oliveiro <ldo@nz.invalid> wrote:

    On Tue, 20 Oct 2026 23:18:44 GMT, Charlie Gibbs wrote:

    I know that a lot of CS types are going to stick pins into little
    dolls that look like me for saying this, but IMHO resource
    pointers, handles, etc. should be global.

    Surely any variable which is only used locally to a particular
    block should be declared local to that block. Why should resource
    pointers be any different?

    Many resource pointers aren't local, though. Consider a program
    which loads a table from a file, then uses it for lookups while
    processing data in another file. You might decompose the program
    into a function that loads the table, and another that performs
    lookups. The main routine calls the table load routine, and opens
    the file to be processed. It then loops reading records, calling the
    lookup function each time. The table, dynamically allocated by the
    table load function, must remain allocated when the allocator exits,
    and must be available to the lookup function on each call; it cannot
    be local to either of those functions.

    This is why OO was invented. You instantiate a Table instance, and
    that loads the table contents. Call the lookup method on the instance
    as many times as you need. Then, when finished with the Table
    instance, dispose of it.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Wed Oct 21 07:55:39 2026
    On Wed, 21 Oct 2026 07:42:30 -0000 (UTC), boltar wrote:

    On Wed, 21 Oct 2026 01:29:18 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Tue, 20 Oct 2026 17:24:27 -0000 (UTC), boltar wrote:

    ** The setting a flag method which has to be checked in every
    nested loop test is just an [asinine] way to code.

    If you have to do cleanup at each level before exiting, then it
    works perfectly well.

    It may well work but it doesn't make it good. Its harder to follow -
    whereas a goto out of a deeply nested loops is blindingly obvious -
    and its less efficient.

    The goto from the deep inner block to the outer one is ?blindingly
    obvious? ... ly wrong.

    What about the cleanup?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Wed Oct 21 08:05:02 2026
    On Wed, 21 Oct 2026 07:55:39 -0000 (UTC)
    Lawrence =?iso-8859-13?q?D=FFOliveiro?= <ldo@nz.invalid> wrote:
    On Wed, 21 Oct 2026 07:42:30 -0000 (UTC), boltar wrote:

    On Wed, 21 Oct 2026 01:29:18 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Tue, 20 Oct 2026 17:24:27 -0000 (UTC), boltar wrote:

    ** The setting a flag method which has to be checked in every
    nested loop test is just an [asinine] way to code.

    If you have to do cleanup at each level before exiting, then it
    works perfectly well.

    It may well work but it doesn't make it good. Its harder to follow -
    whereas a goto out of a deeply nested loops is blindingly obvious -
    and its less efficient.

    The goto from the deep inner block to the outer one is ?blindingly
    obvious? ... ly wrong.

    Fine, well you stick with your gotos-are-bad religious doctrine based on something one guy said 50 years ago and the rest of us will carry on writing usable and easy to follow code.

    What about the cleanup?

    What about it? you think a flag test in a loop automagically fixes that?



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Thomas Koenig@3:633/10 to All on Wed Oct 21 13:27:48 2026
    Lawrence D?Oliveiro <ldo@nz.invalid> schrieb:
    On Wed, 21 Oct 2026 07:42:30 -0000 (UTC), boltar wrote:

    On Wed, 21 Oct 2026 01:29:18 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Tue, 20 Oct 2026 17:24:27 -0000 (UTC), boltar wrote:

    ** The setting a flag method which has to be checked in every
    nested loop test is just an [asinine] way to code.

    If you have to do cleanup at each level before exiting, then it
    works perfectly well.

    It may well work but it doesn't make it good. Its harder to follow -
    whereas a goto out of a deeply nested loops is blindingly obvious -
    and its less efficient.

    The goto from the deep inner block to the outer one is ?blindingly
    obvious? ... ly wrong.

    What about the cleanup?

    What cleanup, exactly? We are talking Fortran, remember.


    --
    This USENET posting was made without artificial intelligence,
    artificial impertinence, artificial arrogance, artificial stupidity,
    artificial flavorings or artificial colorants.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Peter Flass@3:633/10 to All on Wed Oct 21 07:41:06 2026
    On 10/21/26 01:05, boltar@battlestar.co.uk wrote:
    On Wed, 21 Oct 2026 07:55:39 -0000 (UTC)
    Lawrence =?iso-8859-13?q?D=FFOliveiro?= <ldo@nz.invalid> wrote:
    On Wed, 21 Oct 2026 07:42:30 -0000 (UTC), boltar wrote:

    On Wed, 21 Oct 2026 01:29:18 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Tue, 20 Oct 2026 17:24:27 -0000 (UTC), boltar wrote:

    ** The setting a flag method which has to be checked in every
    nested loop test is just an [asinine] way to code.

    If you have to do cleanup at each level before exiting, then it
    works perfectly well.

    It may well work but it doesn't make it good. Its harder to follow -
    whereas a goto out of a deeply nested loops is blindingly obvious -
    and its less efficient.

    The goto from the deep inner block to the outer one is ?blindingly
    obvious? ... ly wrong.

    Fine, well you stick with your gotos-are-bad religious doctrine based on something one guy said 50 years ago and the rest of us will carry on writing usable and easy to follow code.

    What about the cleanup?

    What about it? you think a flag test in a loop automagically fixes that?

    I occasionally use GOTOs, but usually only after considering other alternatives. The flag test is the big red flag. If I have to keep
    testing a flag for several layers to get out of a loop, there has to be
    a better way.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Thu Oct 22 00:23:57 2026
    On Wed, 21 Oct 2026 08:05:02 -0000 (UTC), boltar wrote:

    On Wed, 21 Oct 2026 07:55:39 -0000 (UTC), Lawrence D?Oliveiro wrote:

    What about the cleanup?

    What about it? you think a flag test in a loop automagically fixes that?

    It needs to be done at each level before exiting to the outer level.

    I can show you some example code, if you like.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Thu Oct 22 00:24:48 2026
    On Wed, 21 Oct 2026 13:27:48 -0000 (UTC), Thomas Koenig wrote:

    Lawrence D?Oliveiro <ldo@nz.invalid> schrieb:

    On Wed, 21 Oct 2026 07:42:30 -0000 (UTC), boltar wrote:

    On Wed, 21 Oct 2026 01:29:18 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Tue, 20 Oct 2026 17:24:27 -0000 (UTC), boltar wrote:

    ** The setting a flag method which has to be checked in every
    nested loop test is just an [asinine] way to code.

    If you have to do cleanup at each level before exiting, then it
    works perfectly well.

    It may well work but it doesn't make it good. Its harder to follow
    - whereas a goto out of a deeply nested loops is blindingly
    obvious - and its less efficient.

    The goto from the deep inner block to the outer one is ?blindingly
    obvious? ... ly wrong.

    What about the cleanup?

    What cleanup, exactly? We are talking Fortran, remember.

    The principle applies to Fortran as it does to any language where you
    have to explicitly manage storage allocations.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Thu Oct 22 00:37:08 2026
    On 21 Oct 2026 16:02:16 GMT, Ted Nolan <tednolan> wrote:

    A co-worker actually tracked down such an issue. It turned out that
    in certain cases of misuse of indirection, you could assign new
    values to constants, such that '2' might have the value 1.

    Certain early Fortran implementations. Couldn?t happen in any other
    language ...

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Thu Oct 22 00:40:16 2026
    On Wed, 21 Oct 2026 07:41:06 -0700, Peter Flass wrote:

    I occasionally use GOTOs, but usually only after considering other alternatives. The flag test is the big red flag. If I have to keep
    testing a flag for several layers to get out of a loop, there has to
    be a better way.

    If the flag indicates ?an error has occurred?, then I think this is
    entirely reasonable.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Thu Oct 22 09:14:04 2026
    On 10/22/2026 8:24 AM, Lawrence D?Oliveiro wrote:
    On Wed, 21 Oct 2026 13:27:48 -0000 (UTC), Thomas Koenig wrote:

    Lawrence D?Oliveiro <ldo@nz.invalid> schrieb:

    On Wed, 21 Oct 2026 07:42:30 -0000 (UTC), boltar wrote:

    On Wed, 21 Oct 2026 01:29:18 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Tue, 20 Oct 2026 17:24:27 -0000 (UTC), boltar wrote:

    ** The setting a flag method which has to be checked in every
    nested loop test is just an [asinine] way to code.

    If you have to do cleanup at each level before exiting, then it
    works perfectly well.

    It may well work but it doesn't make it good. Its harder to follow
    - whereas a goto out of a deeply nested loops is blindingly
    obvious - and its less efficient.

    The goto from the deep inner block to the outer one is ?blindingly
    obvious? ... ly wrong.

    What about the cleanup?

    What cleanup, exactly? We are talking Fortran, remember.

    The principle applies to Fortran as it does to any language where you
    have to explicitly manage storage allocations.

    Never mind that when you use garbage collected languages, the finalizer
    can run at any point in the future, sometimes when you don't want it to.

    Such as too late.
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;
    Federated at https://fed.brid.gy/bsky/myrkraverk.bsky.social

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Thu Oct 22 02:00:29 2026
    On Thu, 22 Oct 2026 01:16:25 -0000 (UTC), Steven G. Kargl wrote:

    On Thu, 22 Oct 2026 00:24:48 -0000 (UTC), Lawrence D?Oliveiro wrote:

    The principle applies to Fortran as it does to any language where you
    have to explicitly manage storage allocations.

    Fortran 77 does not have dynamic memory allocation. So, again,
    how *exactly* does using GOTO to break out of a Fortran 77 do
    loop require cleanup?

    Read that again: ?explicitly manage storage allocations?.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Steven G. Kargl@3:633/10 to All on Thu Oct 22 02:17:59 2026
    On Thu, 22 Oct 2026 02:00:29 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 01:16:25 -0000 (UTC), Steven G. Kargl wrote:

    On Thu, 22 Oct 2026 00:24:48 -0000 (UTC), Lawrence D?Oliveiro wrote:

    The principle applies to Fortran as it does to any language where you
    have to explicitly manage storage allocations.

    Fortran 77 does not have dynamic memory allocation. So, again,
    how *exactly* does using GOTO to break out of a Fortran 77 do
    loop require cleanup?

    Read that again: ?explicitly manage storage allocations?.

    Sure, what is the EXACT clean up that you envision? Here's some
    good old Fortran 77

    c234567
    INTEGER I(100)
    DO 10 N = 1, 100
    I(N) = I
    IF (N .EQ. 42) GOTO 11
    10 CONTINUE
    11 CONTINUE
    PRINT *, N
    END

    What is the clean-up? Your goal post seem to move.

    --
    steve

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Thu Oct 22 11:05:37 2026
    On 10/22/2026 8:37 AM, Lawrence D?Oliveiro wrote:
    On 21 Oct 2026 16:02:16 GMT, Ted Nolan <tednolan> wrote:

    A co-worker actually tracked down such an issue. It turned out that
    in certain cases of misuse of indirection, you could assign new
    values to constants, such that '2' might have the value 1.

    Certain early Fortran implementations. Couldn?t happen in any other
    language ...

    Did you never experiment with

    const int i = 3 ;
    int *p = &i ;
    *p = 1 ;

    in C, as a student?
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;
    Federated at https://fed.brid.gy/bsky/myrkraverk.bsky.social

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Peter Flass@3:633/10 to All on Wed Oct 21 20:07:36 2026
    On 10/21/26 17:37, Lawrence D?Oliveiro wrote:
    On 21 Oct 2026 16:02:16 GMT, Ted Nolan <tednolan> wrote:

    A co-worker actually tracked down such an issue. It turned out that
    in certain cases of misuse of indirection, you could assign new
    values to constants, such that '2' might have the value 1.

    Certain early Fortran implementations. Couldn?t happen in any other
    language ...

    Probably called a subroutine with constant 2 as an argument, which the subroutine modified. I don't think FORTRAN used dummy arguments or call-by-value.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Thu Oct 22 03:35:07 2026
    On Thu, 22 Oct 2026 02:17:59 -0000 (UTC), Steven G. Kargl wrote:

    On Thu, 22 Oct 2026 02:00:29 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 01:16:25 -0000 (UTC), Steven G. Kargl wrote:

    On Thu, 22 Oct 2026 00:24:48 -0000 (UTC), Lawrence D?Oliveiro wrote:

    The principle applies to Fortran as it does to any language where
    you have to explicitly manage storage allocations.

    Fortran 77 does not have dynamic memory allocation. So, again, how
    *exactly* does using GOTO to break out of a Fortran 77 do loop
    require cleanup?

    Read that again: ?explicitly manage storage allocations?.

    Sure, what is the EXACT clean up that you envision?

    ?Storage allocations?.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Thomas Koenig@3:633/10 to All on Thu Oct 22 03:46:30 2026
    Lawrence D?Oliveiro <ldo@nz.invalid> schrieb:
    On Wed, 21 Oct 2026 13:27:48 -0000 (UTC), Thomas Koenig wrote:

    Lawrence D?Oliveiro <ldo@nz.invalid> schrieb:

    On Wed, 21 Oct 2026 07:42:30 -0000 (UTC), boltar wrote:

    On Wed, 21 Oct 2026 01:29:18 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Tue, 20 Oct 2026 17:24:27 -0000 (UTC), boltar wrote:

    ** The setting a flag method which has to be checked in every
    nested loop test is just an [asinine] way to code.

    If you have to do cleanup at each level before exiting, then it
    works perfectly well.

    It may well work but it doesn't make it good. Its harder to follow
    - whereas a goto out of a deeply nested loops is blindingly
    obvious - and its less efficient.

    The goto from the deep inner block to the outer one is ?blindingly
    obvious? ... ly wrong.

    What about the cleanup?

    What cleanup, exactly? We are talking Fortran, remember.

    The principle applies to Fortran as it does to any language where you
    have to explicitly manage storage allocations.

    DO loops do not introduce scope in Fortran.

    --
    This USENET posting was made without artificial intelligence,
    artificial impertinence, artificial arrogance, artificial stupidity,
    artificial flavorings or artificial colorants.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Steven G. Kargl@3:633/10 to All on Thu Oct 22 04:33:04 2026
    On Thu, 22 Oct 2026 03:35:07 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 02:17:59 -0000 (UTC), Steven G. Kargl wrote:

    On Thu, 22 Oct 2026 02:00:29 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 01:16:25 -0000 (UTC), Steven G. Kargl wrote:

    On Thu, 22 Oct 2026 00:24:48 -0000 (UTC), Lawrence D?Oliveiro wrote:

    The principle applies to Fortran as it does to any language where
    you have to explicitly manage storage allocations.

    Fortran 77 does not have dynamic memory allocation. So, again, how
    *exactly* does using GOTO to break out of a Fortran 77 do loop
    require cleanup?

    Read that again: ?explicitly manage storage allocations?.

    Sure, what is the EXACT clean up that you envision?

    ?Storage allocations?.

    There isn't any "storage allocation" to cleanup. Of course,
    it would help if you actually define what you mean by "storage
    allocation". I gave you an example of Fortran 77 code where
    a GOTO jumps out of a do-loop. There is nothing to cleanup.

    So, please define "storage allocation" in the context of
    the Fortran language, and then define EXACTLY what you
    mean by cleanup.

    --
    steve
    --
    steve

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Thu Oct 22 04:50:10 2026
    On Thu, 22 Oct 2026 04:33:04 -0000 (UTC), Steven G. Kargl wrote:

    On Thu, 22 Oct 2026 03:35:07 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 02:17:59 -0000 (UTC), Steven G. Kargl wrote:

    On Thu, 22 Oct 2026 02:00:29 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 01:16:25 -0000 (UTC), Steven G. Kargl wrote:

    On Thu, 22 Oct 2026 00:24:48 -0000 (UTC), Lawrence D?Oliveiro wrote: >>>>>
    The principle applies to Fortran as it does to any language
    where you have to explicitly manage storage allocations.

    Fortran 77 does not have dynamic memory allocation. So, again,
    how *exactly* does using GOTO to break out of a Fortran 77 do
    loop require cleanup?

    Read that again: ?explicitly manage storage allocations?.

    Sure, what is the EXACT clean up that you envision?

    ?Storage allocations?.

    There isn't any "storage allocation" to cleanup.

    Not in your example. Which is why it was irrelevant.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Thu Oct 22 04:51:11 2026
    On Thu, 22 Oct 2026 03:46:30 -0000 (UTC), Thomas Koenig wrote:

    Lawrence D?Oliveiro <ldo@nz.invalid> schrieb:

    On Wed, 21 Oct 2026 13:27:48 -0000 (UTC), Thomas Koenig wrote:

    Lawrence D?Oliveiro <ldo@nz.invalid> schrieb:

    On Wed, 21 Oct 2026 07:42:30 -0000 (UTC), boltar wrote:

    On Wed, 21 Oct 2026 01:29:18 -0000 (UTC), Lawrence D?Oliveiro wrote: >>>>>>
    On Tue, 20 Oct 2026 17:24:27 -0000 (UTC), boltar wrote:

    ** The setting a flag method which has to be checked in every
    nested loop test is just an [asinine] way to code.

    If you have to do cleanup at each level before exiting, then it
    works perfectly well.

    It may well work but it doesn't make it good. Its harder to
    follow - whereas a goto out of a deeply nested loops is
    blindingly obvious - and its less efficient.

    The goto from the deep inner block to the outer one is
    ?blindingly obvious? ... ly wrong.

    What about the cleanup?

    What cleanup, exactly? We are talking Fortran, remember.

    The principle applies to Fortran as it does to any language where
    you have to explicitly manage storage allocations.

    DO loops do not introduce scope in Fortran.

    Nobody said anything about ?scope?.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Steven G. Kargl@3:633/10 to All on Thu Oct 22 04:56:06 2026
    On Thu, 22 Oct 2026 04:50:10 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 04:33:04 -0000 (UTC), Steven G. Kargl wrote:


    Sure, what is the EXACT clean up that you envision?

    ?Storage allocations?.

    There isn't any "storage allocation" to cleanup.

    Not in your example. Which is why it was irrelevant.

    Then give a Fortran 77 example that requires cleanup.
    You can't, can you?

    Using GOTO to jump out of do-loop in Fortran 77 does
    not lead to some mysterious "storage allocation" to
    cleanup.

    PS: a smart compiler would actually not generate code
    to execute the do-loop for the code in my example.

    --
    steve

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Thu Oct 22 14:22:01 2026
    On 10/22/2026 11:07 AM, Peter Flass wrote:
    On 10/21/26 17:37, Lawrence D?Oliveiro wrote:
    On 21 Oct 2026 16:02:16 GMT, Ted Nolan <tednolan> wrote:

    A co-worker actually tracked down such an issue. It turned out that
    in certain cases of misuse of indirection, you could assign new
    values to constants, such that '2' might have the value 1.

    Certain early Fortran implementations. Couldn?t happen in any other
    language ...

    Probably called a subroutine with constant 2 as an argument, which the subroutine modified. I don't think FORTRAN used dummy arguments or call- by-value.

    Reminds me of a bit of Elisp I wrote in XEmacs. Someone complained it
    modified -- or tried to modify? -- the literal array (?) I had when us-
    ing GNU Emacs. It's been a while. Anyway, I never experienced it as a
    bug, and I suppose there was a difference in implementation.

    So no, it's not just /early Fortran/.
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;
    Federated at https://fed.brid.gy/bsky/myrkraverk.bsky.social

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Thu Oct 22 14:34:20 2026
    On 10/22/2026 12:56 PM, Steven G. Kargl wrote:
    On Thu, 22 Oct 2026 04:50:10 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 04:33:04 -0000 (UTC), Steven G. Kargl wrote:


    Sure, what is the EXACT clean up that you envision?

    ?Storage allocations?.

    There isn't any "storage allocation" to cleanup.

    Not in your example. Which is why it was irrelevant.

    Then give a Fortran 77 example that requires cleanup.
    You can't, can you?

    Using GOTO to jump out of do-loop in Fortran 77 does
    not lead to some mysterious "storage allocation" to
    cleanup.

    PS: a smart compiler would actually not generate code
    to execute the do-loop for the code in my example.


    Open Watcom Fortran 77 has /allocate/ and /deallocate/ according to a
    quick glance at the manual, but I have never used them.

    I guess the point is we don't want to allocate in a loop?
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;
    Federated at https://fed.brid.gy/bsky/myrkraverk.bsky.social

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Thomas Koenig@3:633/10 to All on Thu Oct 22 06:39:16 2026
    Lawrence D?Oliveiro <ldo@nz.invalid> schrieb:
    On Thu, 22 Oct 2026 03:46:30 -0000 (UTC), Thomas Koenig wrote:

    Lawrence D?Oliveiro <ldo@nz.invalid> schrieb:

    On Wed, 21 Oct 2026 13:27:48 -0000 (UTC), Thomas Koenig wrote:

    Lawrence D?Oliveiro <ldo@nz.invalid> schrieb:

    On Wed, 21 Oct 2026 07:42:30 -0000 (UTC), boltar wrote:

    On Wed, 21 Oct 2026 01:29:18 -0000 (UTC), Lawrence D?Oliveiro wrote: >>>>>>>
    On Tue, 20 Oct 2026 17:24:27 -0000 (UTC), boltar wrote:

    ** The setting a flag method which has to be checked in every
    nested loop test is just an [asinine] way to code.

    If you have to do cleanup at each level before exiting, then it
    works perfectly well.

    It may well work but it doesn't make it good. Its harder to
    follow - whereas a goto out of a deeply nested loops is
    blindingly obvious - and its less efficient.

    The goto from the deep inner block to the outer one is
    ?blindingly obvious? ... ly wrong.

    What about the cleanup?

    What cleanup, exactly? We are talking Fortran, remember.

    The principle applies to Fortran as it does to any language where
    you have to explicitly manage storage allocations.

    DO loops do not introduce scope in Fortran.

    Nobody said anything about ?scope?.

    Somebody who knows the first thing about Fortran, which you
    clearly don't, might have realized that scope is the only
    way to mandate storage allocation/deallocation in Fortran.


    --
    This USENET posting was made without artificial intelligence,
    artificial impertinence, artificial arrogance, artificial stupidity,
    artificial flavorings or artificial colorants.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Steven G. Kargl@3:633/10 to All on Thu Oct 22 07:31:48 2026
    On Thu, 22 Oct 2026 14:34:20 +0800, Johann 'Myrkraverk' Oskarsson wrote:

    On 10/22/2026 12:56 PM, Steven G. Kargl wrote:
    On Thu, 22 Oct 2026 04:50:10 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 04:33:04 -0000 (UTC), Steven G. Kargl wrote:


    Sure, what is the EXACT clean up that you envision?

    ?Storage allocations?.

    There isn't any "storage allocation" to cleanup.

    Not in your example. Which is why it was irrelevant.

    Then give a Fortran 77 example that requires cleanup.
    You can't, can you?

    Using GOTO to jump out of do-loop in Fortran 77 does
    not lead to some mysterious "storage allocation" to
    cleanup.

    PS: a smart compiler would actually not generate code
    to execute the do-loop for the code in my example.


    Open Watcom Fortran 77 has /allocate/ and /deallocate/ according to a
    quick glance at the manual, but I have never used them.

    Dynamic memory management via allocate/deallocate was introduce
    in Fortran 90. Open Watcom Fortran 77 may have added those as
    an extension. The Fortran 77 standard does have a dynamic memory
    feature. But, this seems irrelevant to Lawrence, who has coined
    the term "storage allocation", which is not Fortran terminology.
    We are now waiting for a definition for this term.

    I guess the point is we don't want to allocate in a loop?

    I allocate memory in do-loops all time. It would be a significant pessimization to write something like

    integer, allocatable :: i(:)
    i = [0] ! A 1-element array.
    do j = 1, 9
    i = [i,j] ! Re-allocate i on assignment
    end do
    10 print *, i
    end

    Note, there is no clean up of 'storage allocation' when the
    loop terminates. The Fortran standard does not mandate when
    memory that may have been freed during the re-allocation is
    actually garbaged collected. The program could return memory
    to the system during the re-allocation or when the program
    terminates.

    --
    steve


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Thu Oct 22 16:40:21 2026
    On 10/22/2026 3:31 PM, Steven G. Kargl wrote:
    On Thu, 22 Oct 2026 14:34:20 +0800, Johann 'Myrkraverk' Oskarsson wrote:

    On 10/22/2026 12:56 PM, Steven G. Kargl wrote:
    On Thu, 22 Oct 2026 04:50:10 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 04:33:04 -0000 (UTC), Steven G. Kargl wrote:


    Sure, what is the EXACT clean up that you envision?

    ?Storage allocations?.

    There isn't any "storage allocation" to cleanup.

    Not in your example. Which is why it was irrelevant.

    Then give a Fortran 77 example that requires cleanup.
    You can't, can you?

    Using GOTO to jump out of do-loop in Fortran 77 does
    not lead to some mysterious "storage allocation" to
    cleanup.

    PS: a smart compiler would actually not generate code
    to execute the do-loop for the code in my example.


    Open Watcom Fortran 77 has /allocate/ and /deallocate/ according to a
    quick glance at the manual, but I have never used them.

    Dynamic memory management via allocate/deallocate was introduce
    in Fortran 90. Open Watcom Fortran 77 may have added those as
    an extension. The Fortran 77 standard does have a dynamic memory
    feature. But, this seems irrelevant to Lawrence, who has coined
    the term "storage allocation", which is not Fortran terminology.
    We are now waiting for a definition for this term.

    Lawrence, in my experience, pretends to be a much more experienced pro-
    grammer than he is. In my opinion, he's just a Python influencer.

    So we keep waiting.


    I guess the point is we don't want to allocate in a loop?

    I allocate memory in do-loops all time. It would be a significant pessimization to write something like

    integer, allocatable :: i(:)
    i = [0] ! A 1-element array.
    do j = 1, 9
    i = [i,j] ! Re-allocate i on assignment
    end do
    10 print *, i
    end

    Note, there is no clean up of 'storage allocation' when the
    loop terminates. The Fortran standard does not mandate when
    memory that may have been freed during the re-allocation is
    actually garbaged collected. The program could return memory
    to the system during the re-allocation or when the program
    terminates.


    Thanks. I admit some lacking in understanding of Fortran, 77 and other-
    wise, so I'll read better upon this stuff before I start to use it.

    In other news, I have no problem understanding the Fortran 77 code snip-
    pets in my /Digital Image Processing/ (1993) by Gonzales and Woods.
    Sometimes code literacy is sufficient.

    Best wishes, and happy Fortran!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;
    Federated at https://fed.brid.gy/bsky/myrkraverk.bsky.social

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Peter Flass@3:633/10 to All on Thu Oct 22 07:26:21 2026
    On 10/21/26 20:35, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 02:17:59 -0000 (UTC), Steven G. Kargl wrote:

    On Thu, 22 Oct 2026 02:00:29 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 01:16:25 -0000 (UTC), Steven G. Kargl wrote:

    On Thu, 22 Oct 2026 00:24:48 -0000 (UTC), Lawrence D?Oliveiro wrote:

    The principle applies to Fortran as it does to any language where
    you have to explicitly manage storage allocations.

    Fortran 77 does not have dynamic memory allocation. So, again, how
    *exactly* does using GOTO to break out of a Fortran 77 do loop
    require cleanup?

    Read that again: ?explicitly manage storage allocations?.

    Sure, what is the EXACT clean up that you envision?

    ?Storage allocations?.

    That's why I try to use PL/I AUTOMATIC (stack) storage and not allocate
    a lot of stuff. You need to have a disciplined approach if you allocate
    random stuff here and there.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Thu Oct 22 14:53:36 2026
    On Thu, 22 Oct 2026 00:23:57 -0000 (UTC)
    Lawrence =?iso-8859-13?q?D=FFOliveiro?= <ldo@nz.invalid> wrote:
    On Wed, 21 Oct 2026 08:05:02 -0000 (UTC), boltar wrote:

    On Wed, 21 Oct 2026 07:55:39 -0000 (UTC), Lawrence D?Oliveiro wrote:

    What about the cleanup?

    What about it? you think a flag test in a loop automagically fixes that?

    It needs to be done at each level before exiting to the outer level.

    That depends on what you've done doesn't it. If you're stupid enough to
    use a raw new or malloc() then thats your lookout. The rest of us will use stack objects, shared_ptr or similar.

    I can show you some example code, if you like.

    No thanks, I'd rather not get any bad habits.



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From James Kuyper@3:633/10 to All on Thu Oct 22 11:18:03 2026
    On 2026-10-22 00:50, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 04:33:04 -0000 (UTC), Steven G. Kargl wrote:

    On Thu, 22 Oct 2026 03:35:07 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 02:17:59 -0000 (UTC), Steven G. Kargl wrote:

    On Thu, 22 Oct 2026 02:00:29 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 01:16:25 -0000 (UTC), Steven G. Kargl wrote:

    On Thu, 22 Oct 2026 00:24:48 -0000 (UTC), Lawrence D?Oliveiro wrote: >>>>>>
    The principle applies to Fortran as it does to any language
    where you have to explicitly manage storage allocations.

    Fortran 77 does not have dynamic memory allocation. So, again,
    how *exactly* does using GOTO to break out of a Fortran 77 do
    loop require cleanup?

    Read that again: ?explicitly manage storage allocations?.

    Sure, what is the EXACT clean up that you envision?

    ?Storage allocations?.

    There isn't any "storage allocation" to cleanup.

    Not in your example. Which is why it was irrelevant.

    So, why can't you provide an example of storage allocation, where
    cleanup is relevant, so that using a GOTO would be problematic. That way
    we could have some idea what you're talking about.
    This discussion is currently cross-posted to four newsgroups, only one
    of which is specifically about Fortran. You can reasonably assume that
    many people here are unfamiliar with Fortran. I've earned money writing Fortran, but very little, and most of it was a decades ago. I personally
    have no idea what you're referring to.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Charlie Gibbs@3:633/10 to All on Thu Oct 22 19:05:16 2026
    On 2026-10-22, Lawrence D?Oliveiro <ldo@nz.invalid> wrote:

    On Wed, 21 Oct 2026 08:05:02 -0000 (UTC), boltar wrote:

    On Wed, 21 Oct 2026 07:55:39 -0000 (UTC), Lawrence D?Oliveiro wrote:

    What about the cleanup?

    What about it? you think a flag test in a loop automagically fixes that?

    It needs to be done at each level before exiting to the outer level.

    I can show you some example code, if you like.

    Maybe the flag needs to be global. <g,d&r>

    --
    /~\ Charlie Gibbs | In this world there are
    \ / <cgibbs@kltpzyxm.invalid> | two kinds of people:
    X I'm really at ac.dekanfrus | 1. Those who can extrapolate
    / \ if you read it the right way. | from incomplete data.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Nuno Silva@3:633/10 to All on Fri Oct 23 00:23:10 2026
    [ Keeping the C++ group because that's at least in context, but I'm not
    subscribing to it at the moment. I suppose this could eventually go to
    folklore or alt.unix.geeks? ]

    On 2026-10-22, Scott Lurndal wrote:

    boltar@battlestar.co.uk writes:
    On Wed, 21 Oct 2026 19:01:38 -0000 (UTC)
    cross@spitfire.i.gajendra.net (Dan Cross) wrote:
    In article <11bb1da$qfn9$1@dont-email.me>, <boltar@battlestar.co.uk> wrote: >>>>Not sure why you think its conspiracy anything. I use the language on a >>>>daily basis and everytime a new version comes out I hope they've added >>>>something useful but since 2014 its been a law of diminishing returns. >>>>Plus there's unexplained omissions - eg threads have been part of the core >>>>language since 2011. Great, but what about processes? When do we get them? >>>>Sure, I could just use fork() but then I could also just use pthread_create()
    too.

    One can implement a pretty reasonable threads library given the
    virtual machine model of standard C or C++. Processes? With

    Virtual machine? Wrong language , comp.lang.java is that way --->

    The C/C++ "Virtual Machine Model" as described in the language
    specifications is an apple.

    A virtual machine (vmware, kvm, xen, et alia) is an orange.

    assert(apples != oranges);

    And here I think "virtual machine" was mistaken to be the Java Virtual
    Machine, not the orange type above?

    (A grapefruit? Pineapple? Banana?)

    --
    Nuno Silva

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Thu Oct 22 16:54:12 2026
    Thomas Koenig <tkoenig@netcologne.de> writes:
    [...]
    Somebody who knows the first thing about Fortran, which you
    clearly don't, might have realized that scope is the only
    way to mandate storage allocation/deallocation in Fortran.

    Is that true in more recent versions of Fortran?

    A quick web search indicates that Fortran 90 added "allocate"
    and "deallocate". If I understand correctly, you might have an
    "allocate" inside a DO loop, and breaking out of the loop could
    bypass the corresponding "deallocate".

    LDO doesn't write coherently enough to know whether that's what
    he's talking about.

    Disclaimer: I do know the first thing about Fortran, and probably
    the second, but not the third and fourth. Ironically, I happen
    to know the seventeenth, but I'll never tell.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Dan Cross@3:633/10 to All on Fri Oct 23 00:41:16 2026
    In article <11be5t7$19jbi$4@dont-email.me>,
    Nuno Silva <nunojsilva@invalid.invalid> wrote:
    [ Keeping the C++ group because that's at least in context, but I'm not
    subscribing to it at the moment. I suppose this could eventually go to
    folklore or alt.unix.geeks? ]

    On 2026-10-22, Scott Lurndal wrote:

    boltar@battlestar.co.uk writes:
    On Wed, 21 Oct 2026 19:01:38 -0000 (UTC)
    cross@spitfire.i.gajendra.net (Dan Cross) wrote:
    In article <11bb1da$qfn9$1@dont-email.me>, <boltar@battlestar.co.uk> wrote:
    Not sure why you think its conspiracy anything. I use the language on a >>>>>daily basis and everytime a new version comes out I hope they've added >>>>>something useful but since 2014 its been a law of diminishing returns. >>>>>Plus there's unexplained omissions - eg threads have been part of the core >>>>>language since 2011. Great, but what about processes? When do we get them? >>>>>Sure, I could just use fork() but then I could also just use pthread_create()
    too.

    One can implement a pretty reasonable threads library given the
    virtual machine model of standard C or C++. Processes? With

    Virtual machine? Wrong language , comp.lang.java is that way --->

    The C/C++ "Virtual Machine Model" as described in the language
    specifications is an apple.

    A virtual machine (vmware, kvm, xen, et alia) is an orange.

    assert(apples != oranges);

    And here I think "virtual machine" was mistaken to be the Java Virtual >Machine, not the orange type above?

    (A grapefruit? Pineapple? Banana?)

    The JVM is obviously a lemon. (Hey-O!)

    - Dan C.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Fri Oct 23 03:19:13 2026
    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach if
    you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the
    caller?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Fri Oct 23 03:21:49 2026
    On Thu, 22 Oct 2026 15:41:15 -0500, Lynn McGuire wrote:

    I have been advocating for quite a while that C++ should add a user
    interface programming model for quite a long time.

    First they need a standardized graphics API.

    I gather there?s been a proposal that?s been kicking around for some
    years, to adopt something based on Cairo
    <https://www.cairographics.org/>.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Fri Oct 23 03:33:44 2026
    On Thu, 22 Oct 2026 11:18:03 -0400, James Kuyper wrote:

    On Thu, 22 Oct 2026 00:24:48 -0000 (UTC), Lawrence D?Oliveiro wrote:

    The principle applies to Fortran as it does to any language where
    you have to explicitly manage storage allocations.

    So, why can't you provide an example of storage allocation, where
    cleanup is relevant, so that using a GOTO would be problematic. That
    way we could have some idea what you're talking about.

    The technique I use is based on a form of structured programming
    called a ?Nassi-Shneiderman diagram?. The overall structure looks like

    ... initialize object pointer to NULL ...
    do /*once*/
    {
    ... possible other stuff ...
    ... allocate object pointer ...
    if (error occurred)
    break;
    ... possible other stuff using object pointer ...
    }
    while (false);
    ... call free(3) (or equivalent) on object pointer ...

    So you can see there is no way out of the inner block without passing
    through the dispose call. Using gotos would contribute nothing except
    make it harder to assure yourself of the simplicity of the control
    flow.

    Looks deceptively simple. But the same technique can scale up to quite
    complex cases. Which we can get to, if you want.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Fri Oct 23 04:22:13 2026
    On Fri, 23 Oct 2026 04:10:39 -0000 (UTC), Steven G. Kargl wrote:

    On Fri, 23 Oct 2026 03:33:44 -0000 (UTC), Lawrence D?Oliveiro wrote:

    So you can see there is no way out of the inner block without passing
    through the dispose call.

    'break' is just another name for 'goto label'.

    Using gotos would contribute nothing except make it harder to
    assure yourself of the simplicity of the control flow.

    PS: We're still waiting on a definition of "storage allocation"

    ... allocate object pointer ...


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Thu Oct 22 22:29:45 2026
    On 10/22/2026 8:19 PM, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach if
    you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the
    caller?

    Have the caller have the object before hand and call a function to
    initialize it?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Thu Oct 22 22:31:07 2026
    On 10/22/2026 8:21 PM, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 15:41:15 -0500, Lynn McGuire wrote:

    I have been advocating for quite a while that C++ should add a user
    interface programming model for quite a long time.

    First they need a standardized graphics API.

    I gather there?s been a proposal that?s been kicking around for some
    years, to adopt something based on Cairo
    <https://www.cairographics.org/>.

    That's a fairly decent one.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Steven G. Kargl@3:633/10 to All on Fri Oct 23 05:54:44 2026
    On Fri, 23 Oct 2026 04:22:13 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Fri, 23 Oct 2026 04:10:39 -0000 (UTC), Steven G. Kargl wrote:

    On Fri, 23 Oct 2026 03:33:44 -0000 (UTC), Lawrence D?Oliveiro wrote:

    So you can see there is no way out of the inner block without passing
    through the dispose call.

    'break' is just another name for 'goto label'.

    Using gotos would contribute nothing except make it harder to
    assure yourself of the simplicity of the control flow.

    PS: We're still waiting on a definition of "storage allocation"

    ... allocate object pointer ...


    Nice use of quoting without adding context.

    It's okay to admit that you have no idea how Fortran
    works when one uses a goto to jump out of a do loop.
    There is no cleanup of "storage allocation".

    --
    steve

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Fri Oct 23 06:25:09 2026
    On Thu, 22 Oct 2026 22:29:45 -0700, Chris M. Thomasson wrote:

    On 10/22/2026 8:19 PM, Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach
    if you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the
    caller?

    Have the caller have the object before hand and call a function to
    initialize it?

    I?m assuming that all that BASIC programming hasn?t got to your head,
    and you?re not serious. ;)

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Fri Oct 23 06:27:10 2026
    On Thu, 22 Oct 2026 22:31:07 -0700, Chris M. Thomasson wrote:

    On 10/22/2026 8:21 PM, Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 15:41:15 -0500, Lynn McGuire wrote:

    I have been advocating for quite a while that C++ should add a
    user interface programming model for quite a long time.

    First they need a standardized graphics API.

    I gather there?s been a proposal that?s been kicking around for
    some years, to adopt something based on Cairo
    <https://www.cairographics.org/>.

    That's a fairly decent one.

    It is (based on PostScript but goes beyond it), but the draft proposal
    I?ve seen is somewhat butchered. No text/font API, for a start.

    The JavaScript browser-based 2D Canvas API is also based on Cairo, and
    that was also butchered, albeit in a different way.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Fri Oct 23 06:29:03 2026
    On Fri, 23 Oct 2026 05:43:56 -0000 (UTC), Thomas Koenig wrote:

    Keith Thompson <Keith.S.Thompson+u@gmail.com> schrieb:

    But "break" is useful because it can't branch to any arbitrary
    point in the enclosing function. It can only break out of a
    specific enclosing construct. That makes the code easier to read
    and write.

    The goto usually isn't the problem, you see it and you see where its
    target is.

    It doesn?t scale.

    My example was starting simple, but I intend to work my way gradually
    up as others ask for it.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael S@3:633/10 to All on Fri Oct 23 12:06:35 2026
    On Fri, 23 Oct 2026 00:23:10 +0100
    Nuno Silva <nunojsilva@invalid.invalid> wrote:

    [ Keeping the C++ group because that's at least in context, but I'm
    not subscribing to it at the moment. I suppose this could eventually
    go to folklore or alt.unix.geeks? ]

    On 2026-10-22, Scott Lurndal wrote:

    boltar@battlestar.co.uk writes:
    On Wed, 21 Oct 2026 19:01:38 -0000 (UTC)
    cross@spitfire.i.gajendra.net (Dan Cross) wrote:
    In article <11bb1da$qfn9$1@dont-email.me>,
    <boltar@battlestar.co.uk> wrote:
    Not sure why you think its conspiracy anything. I use the
    language on a daily basis and everytime a new version comes out I >>>>hope they've added something useful but since 2014 its been a law
    of diminishing returns. Plus there's unexplained omissions - eg >>>>threads have been part of the core language since 2011. Great,
    but what about processes? When do we get them? Sure, I could just
    use fork() but then I could also just use pthread_create() too.

    One can implement a pretty reasonable threads library given the
    virtual machine model of standard C or C++. Processes? With

    Virtual machine? Wrong language , comp.lang.java is that way --->

    The C/C++ "Virtual Machine Model" as described in the language specifications is an apple.

    A virtual machine (vmware, kvm, xen, et alia) is an orange.

    assert(apples != oranges);

    And here I think "virtual machine" was mistaken to be the Java Virtual Machine, not the orange type above?

    (A grapefruit? Pineapple? Banana?)


    The fruit of coffee tree is most commonly called cherry.



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Fri Oct 23 11:34:00 2026
    On 23/10/2026 05:21, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 15:41:15 -0500, Lynn McGuire wrote:

    I have been advocating for quite a while that C++ should add a user
    interface programming model for quite a long time.

    First they need a standardized graphics API.


    I hope that never happens. There are large numbers of graphics APIs,
    with huge ranges of what they support, how they work and their balance
    between features, efficiency, portability, size, hardware support, and
    what they are used for.

    People who think C++ should have a standardised graphics API usually
    mean they want to standardise the API they use on the one application
    type that they write.


    I gather there?s been a proposal that?s been kicking around for some
    years, to adopt something based on Cairo
    <https://www.cairographics.org/>.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Fri Oct 23 11:45:49 2026
    On 23/10/2026 08:25, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 22:29:45 -0700, Chris M. Thomasson wrote:

    On 10/22/2026 8:19 PM, Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach
    if you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the
    caller?

    Have the caller have the object before hand and call a function to
    initialize it?

    I?m assuming that all that BASIC programming hasn?t got to your head,
    and you?re not serious. ;)

    Chris' wording is perhaps poor, but the principle is right.

    I don't know PL/I or Fortran, but in C if you have :

    typedef struct data_struct { int a; int xs[20]; } S ;

    S build_some_data(void) {
    S s;

    s.a = 123;
    for (int i = 0; i < 20; i++) s.xs[i] = i;

    return s;
    }

    void foo() {
    S s = build_some_data();
    }


    then it is typically handled as though you had written :

    void build_some_data(S * p) {
    p->a = 123;
    for (int i = 0; i < 20; i++) p->xs[i] = i;

    return;
    }

    void foo() {
    S s;
    build_some_data(&s);
    }


    That is - the caller creates the /space/ for the returned object, but
    does not do any kind of initialisation. It passes a pointer to that
    space as a hidden parameter to the function that wants to return the object.

    That principle should work fine in any language, as long as the size of
    the returned object is known by the caller code.



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From boltar@3:633/10 to All on Fri Oct 23 10:11:46 2026
    On Fri, 23 Oct 2026 11:34:00 +0200
    David Brown <david.brown@hesbynett.no> gabbled:
    On 23/10/2026 05:21, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 15:41:15 -0500, Lynn McGuire wrote:

    I have been advocating for quite a while that C++ should add a user
    interface programming model for quite a long time.

    First they need a standardized graphics API.


    I hope that never happens. There are large numbers of graphics APIs,
    with huge ranges of what they support, how they work and their balance >between features, efficiency, portability, size, hardware support, and
    what they are used for.

    People who think C++ should have a standardised graphics API usually
    mean they want to standardise the API they use on the one application

    For once we're in agreement.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Peter Flass@3:633/10 to All on Fri Oct 23 09:02:50 2026
    On 10/22/26 22:29, Chris M. Thomasson wrote:
    On 10/22/2026 8:19 PM, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach if
    you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the
    caller?

    Have the caller have the object before hand and call a function to initialize it?

    That obviously wouldn't work, since then the caller would have to know something about the object beforehand. I think you'd have to depend on
    the compiler to destroy the object when it goes out of scope, unless the caller destroys it itself.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Peter Flass@3:633/10 to All on Fri Oct 23 09:55:48 2026
    On 10/23/26 02:34, David Brown wrote:
    On 23/10/2026 05:21, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 15:41:15 -0500, Lynn McGuire wrote:

    I have been advocating for quite a while that C++ should add a user
    interface programming model for quite a long time.

    First they need a standardized graphics API.


    I hope that never happens.˙ There are large numbers of graphics APIs,
    with huge ranges of what they support, how they work and their balance between features, efficiency, portability, size, hardware support, and
    what they are used for.

    People who think C++ should have a standardised graphics API usually
    mean they want to standardise the API they use on the one application
    type that they write.


    I gather there?s been a proposal that?s been kicking around for some
    years, to adopt something based on Cairo
    <https://www.cairographics.org/>.


    You need something with subsets. At least a "basic" subset, a "full"
    subset, and something in between that satisfies most uses. Or maybe
    subsets for different purposes, but they should all be compatible.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Peter Flass@3:633/10 to All on Fri Oct 23 09:57:01 2026
    On 10/23/26 02:45, David Brown wrote:
    On 23/10/2026 08:25, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 22:29:45 -0700, Chris M. Thomasson wrote:

    On 10/22/2026 8:19 PM, Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach
    if you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the
    caller?

    Have the caller have the object before hand and call a function to
    initialize it?

    I?m assuming that all that BASIC programming hasn?t got to your head,
    and you?re not serious. ;)

    Chris' wording is perhaps poor, but the principle is right.

    I don't know PL/I or Fortran, but in C if you have :

    ˙˙˙˙typedef struct data_struct { int a; int xs[20]; } S ;

    ˙˙˙˙S build_some_data(void) {
    ˙˙˙˙˙˙˙ S s;

    ˙˙˙˙˙˙˙ s.a = 123;
    ˙˙˙˙˙˙˙ for (int i = 0; i < 20; i++) s.xs[i] = i;

    ˙˙˙˙˙˙˙ return s;
    ˙˙˙˙}

    ˙˙˙˙void foo() {
    ˙˙˙˙˙˙˙ S s = build_some_data();
    ˙˙˙˙}


    then it is typically handled as though you had written :

    ˙˙˙˙void build_some_data(S * p) {
    ˙˙˙˙˙˙˙ p->a = 123;
    ˙˙˙˙˙˙˙ for (int i = 0; i < 20; i++) p->xs[i] = i;

    ˙˙˙˙˙˙˙ return;
    ˙˙˙˙}

    ˙˙˙˙void foo() {
    ˙˙˙˙˙˙˙ S s;
    ˙˙˙˙˙˙˙ build_some_data(&s);
    ˙˙˙˙}


    That is - the caller creates the /space/ for the returned object, but
    does not do any kind of initialisation.˙ It passes a pointer to that
    space as a hidden parameter to the function that wants to return the
    object.

    That principle should work fine in any language, as long as the size of
    the returned object is known by the caller code.

    That last sentence is why it would not work fine,

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Fri Oct 23 19:19:28 2026
    On Fri, 23 Oct 2026 09:02:50 -0700, Peter Flass wrote:

    On 10/22/26 22:29, Chris M. Thomasson wrote:

    On 10/22/2026 8:19 PM, Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach
    if you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the
    caller?

    Have the caller have the object before hand and call a function to
    initialize it?

    That obviously wouldn't work, since then the caller would have to
    know something about the object beforehand.

    And what if the object didn?t consist of just *one*
    dynamically-allocated block, but needed links to other blocks as well?
    What if it needed objects dynamically allocated by other APIs, the
    details of which are internal to those APIs? Is the caller required to
    know about all these implementation details?

    In short, the concept doesn?t scale, because it completely breaks the
    concept of data abstraction.

    And it just pushes the dynamic-allocation problem elsewhere, without
    making it easier.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Fri Oct 23 19:20:50 2026
    On Fri, 23 Oct 2026 05:54:44 -0000 (UTC), Steven G. Kargl wrote:

    On Fri, 23 Oct 2026 04:22:13 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Fri, 23 Oct 2026 04:10:39 -0000 (UTC), Steven G. Kargl wrote:

    On Fri, 23 Oct 2026 03:33:44 -0000 (UTC), Lawrence D?Oliveiro wrote:

    So you can see there is no way out of the inner block without passing
    through the dispose call.

    'break' is just another name for 'goto label'.

    Using gotos would contribute nothing except make it harder to
    assure yourself of the simplicity of the control flow.

    PS: We're still waiting on a definition of "storage allocation"

    ... allocate object pointer ...


    Nice use of quoting without adding context.

    Just pointing out (in case you didn?t notice) that the points you were
    raising were already addressed in the posting you were (supposedly)
    replying to ...

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Steven G. Kargl@3:633/10 to All on Fri Oct 23 19:38:09 2026
    On Fri, 23 Oct 2026 19:20:50 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Fri, 23 Oct 2026 05:54:44 -0000 (UTC), Steven G. Kargl wrote:
    On Fri, 23 Oct 2026 04:22:13 -0000 (UTC), Lawrence D?Oliveiro wrote:
    On Fri, 23 Oct 2026 04:10:39 -0000 (UTC), Steven G. Kargl wrote:
    On Fri, 23 Oct 2026 03:33:44 -0000 (UTC), Lawrence D?Oliveiro wrote:
    So you can see there is no way out of the inner block without passing >>>>> through the dispose call.

    'break' is just another name for 'goto label'.

    Using gotos would contribute nothing except make it harder to
    assure yourself of the simplicity of the control flow.

    PS: We're still waiting on a definition of "storage allocation"

    ... allocate object pointer ...


    Nice use of quoting without adding context.

    Just pointing out (in case you didn?t notice) that the points you were raising were already addressed in the posting you were (supposedly)
    replying to ...

    And, we are still waiting for your definition of "storage allocation"
    and its needed cleanup in the context of Fortran 77. It as been pointed
    out to you multiple times that Fortran 77 does not have dynamic memory allocation. Fortran 77 does not have pointers and it does not have
    objects. So, what is this mythical cleanup of storage allocation in
    Fortran 77?

    It's okay to admit that you were making a some generalization that
    does not apply to Fortran 77.

    --
    steve

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Fri Oct 23 12:48:58 2026
    On 10/22/2026 11:27 PM, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 22:31:07 -0700, Chris M. Thomasson wrote:

    On 10/22/2026 8:21 PM, Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 15:41:15 -0500, Lynn McGuire wrote:

    I have been advocating for quite a while that C++ should add a
    user interface programming model for quite a long time.

    First they need a standardized graphics API.

    I gather there?s been a proposal that?s been kicking around for
    some years, to adopt something based on Cairo
    <https://www.cairographics.org/>.

    That's a fairly decent one.

    It is (based on PostScript but goes beyond it), but the draft proposal
    I?ve seen is somewhat butchered. No text/font API, for a start.

    The JavaScript browser-based 2D Canvas API is also based on Cairo, and
    that was also butchered, albeit in a different way.

    Fwiw, Cairo is up on vcpkg, so its really easy to build and integrate
    with any MSVC project.

    https://vcpkg.io/en/package/cairo

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Fri Oct 23 12:55:02 2026
    On 10/23/2026 2:34 AM, David Brown wrote:
    On 23/10/2026 05:21, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 15:41:15 -0500, Lynn McGuire wrote:

    I have been advocating for quite a while that C++ should add a user
    interface programming model for quite a long time.

    First they need a standardized graphics API.


    I hope that never happens.˙ There are large numbers of graphics APIs,
    with huge ranges of what they support, how they work and their balance between features, efficiency, portability, size, hardware support, and
    what they are used for.

    People who think C++ should have a standardised graphics API usually
    mean they want to standardise the API they use on the one application
    type that they write.


    I gather there?s been a proposal that?s been kicking around for some
    years, to adopt something based on Cairo
    <https://www.cairographics.org/>.


    Fwiw, vcpkg has a lot of them, ready to automatically build and
    integrate. vcpkg is actually... Well, its pretty nice and so far...
    Seems to work for me.

    Want to use Cairo, just do it.

    https://vcpkg.io/en/package/cairo

    Actually vcpkg just builds the sucker. No manually installing mingw
    and/or cygwin or whatever fiddling on windows. Ugggg...

    Iirc, I think Bart got pissed off about manually building and/or
    installing certain things on Windows. Don't get me wrong, it was a
    bitch! But, vcpkg can help for sure.

    So far, works pretty damn nice.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Fri Oct 23 19:56:48 2026
    On Fri, 23 Oct 2026 12:48:58 -0700, Chris M. Thomasson wrote:

    Fwiw, Cairo is up on vcpkg, so its really easy to build and
    integrate with any MSVC project.

    https://vcpkg.io/en/package/cairo

    Do you get Fontconfig and FreeType as well?

    I thought Windows had native equivalents to all this functionality
    anyway, yet here you are, reimplementing the entire Free Software
    stack in parallel to it.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Fri Oct 23 12:57:23 2026
    On 10/22/2026 11:27 PM, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 22:31:07 -0700, Chris M. Thomasson wrote:

    On 10/22/2026 8:21 PM, Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 15:41:15 -0500, Lynn McGuire wrote:

    I have been advocating for quite a while that C++ should add a
    user interface programming model for quite a long time.

    First they need a standardized graphics API.

    I gather there?s been a proposal that?s been kicking around for
    some years, to adopt something based on Cairo
    <https://www.cairographics.org/>.

    That's a fairly decent one.

    It is (based on PostScript but goes beyond it), but the draft proposal
    I?ve seen is somewhat butchered. No text/font API, for a start.

    The JavaScript browser-based 2D Canvas API is also based on Cairo, and
    that was also butchered, albeit in a different way.

    For a gui, a pretty good one for opengl, directx, etc, is imgui. vcpkg
    has it as well:

    https://vcpkg.io/en/package/imgui

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Fri Oct 23 13:30:42 2026
    On 10/23/2026 12:56 PM, Lawrence D?Oliveiro wrote:
    On Fri, 23 Oct 2026 12:48:58 -0700, Chris M. Thomasson wrote:

    Fwiw, Cairo is up on vcpkg, so its really easy to build and
    integrate with any MSVC project.

    https://vcpkg.io/en/package/cairo

    Do you get Fontconfig and FreeType as well?

    I thought Windows had native equivalents to all this functionality
    anyway, yet here you are, reimplementing the entire Free Software
    stack in parallel to it.

    Yeah. It builds all dependencies.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Fri Oct 23 13:43:27 2026
    On 10/23/2026 9:57 AM, Peter Flass wrote:
    On 10/23/26 02:45, David Brown wrote:
    On 23/10/2026 08:25, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 22:29:45 -0700, Chris M. Thomasson wrote:

    On 10/22/2026 8:19 PM, Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach
    if you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the
    caller?

    Have the caller have the object before hand and call a function to
    initialize it?

    I?m assuming that all that BASIC programming hasn?t got to your head,
    and you?re not serious. ;)

    Chris' wording is perhaps poor, but the principle is right.

    I don't know PL/I or Fortran, but in C if you have :

    ˙˙˙˙˙typedef struct data_struct { int a; int xs[20]; } S ;

    ˙˙˙˙˙S build_some_data(void) {
    ˙˙˙˙˙˙˙˙ S s;

    ˙˙˙˙˙˙˙˙ s.a = 123;
    ˙˙˙˙˙˙˙˙ for (int i = 0; i < 20; i++) s.xs[i] = i;

    ˙˙˙˙˙˙˙˙ return s;
    ˙˙˙˙˙}

    ˙˙˙˙˙void foo() {
    ˙˙˙˙˙˙˙˙ S s = build_some_data();
    ˙˙˙˙˙}


    then it is typically handled as though you had written :

    ˙˙˙˙˙void build_some_data(S * p) {
    ˙˙˙˙˙˙˙˙ p->a = 123;
    ˙˙˙˙˙˙˙˙ for (int i = 0; i < 20; i++) p->xs[i] = i;

    ˙˙˙˙˙˙˙˙ return;
    ˙˙˙˙˙}

    ˙˙˙˙˙void foo() {
    ˙˙˙˙˙˙˙˙ S s;
    ˙˙˙˙˙˙˙˙ build_some_data(&s);
    ˙˙˙˙˙}


    That is - the caller creates the /space/ for the returned object, but
    does not do any kind of initialisation.˙ It passes a pointer to that
    space as a hidden parameter to the function that wants to return the
    object.

    That principle should work fine in any language, as long as the size
    of the returned object is known by the caller code.

    That last sentence is why it would not work fine,

    if a dynamic object is returned, we need to handle its lifetime. __________________________
    // pseudo code

    struct foo
    {
    struct bar* m_bar = nullptr;
    int m_a = 0;
    double m_b = .42;
    };


    foo_init(
    struct foo* const self
    ) {
    // assume foobar_lib_create succeeded...
    self->m_bar = foobar_lib_create(...);
    // now we must destroy it in foo_destroy after
    // the caller logic is done with it.
    }


    foo_destroy(
    struct foo const* const self
    ) {
    foobar_lib_destroy(self->m_bar);
    }
    __________________________


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Fri Oct 23 13:50:34 2026
    On 10/23/2026 9:57 AM, Peter Flass wrote:
    On 10/23/26 02:45, David Brown wrote:
    On 23/10/2026 08:25, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 22:29:45 -0700, Chris M. Thomasson wrote:

    On 10/22/2026 8:19 PM, Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach
    if you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the
    caller?

    Have the caller have the object before hand and call a function to
    initialize it?

    I?m assuming that all that BASIC programming hasn?t got to your head,
    and you?re not serious. ;)

    Chris' wording is perhaps poor, but the principle is right.

    I don't know PL/I or Fortran, but in C if you have :

    ˙˙˙˙˙typedef struct data_struct { int a; int xs[20]; } S ;

    ˙˙˙˙˙S build_some_data(void) {
    ˙˙˙˙˙˙˙˙ S s;

    ˙˙˙˙˙˙˙˙ s.a = 123;
    ˙˙˙˙˙˙˙˙ for (int i = 0; i < 20; i++) s.xs[i] = i;

    ˙˙˙˙˙˙˙˙ return s;
    ˙˙˙˙˙}

    ˙˙˙˙˙void foo() {
    ˙˙˙˙˙˙˙˙ S s = build_some_data();
    ˙˙˙˙˙}


    then it is typically handled as though you had written :

    ˙˙˙˙˙void build_some_data(S * p) {
    ˙˙˙˙˙˙˙˙ p->a = 123;
    ˙˙˙˙˙˙˙˙ for (int i = 0; i < 20; i++) p->xs[i] = i;

    ˙˙˙˙˙˙˙˙ return;
    ˙˙˙˙˙}

    ˙˙˙˙˙void foo() {
    ˙˙˙˙˙˙˙˙ S s;
    ˙˙˙˙˙˙˙˙ build_some_data(&s);
    ˙˙˙˙˙}


    That is - the caller creates the /space/ for the returned object, but
    does not do any kind of initialisation.˙ It passes a pointer to that
    space as a hidden parameter to the function that wants to return the
    object.

    That principle should work fine in any language, as long as the size
    of the returned object is known by the caller code.

    That last sentence is why it would not work fine,

    Or have an API that can give us the size of the object the caller needs
    to create. So, again pseudo code:

    size = foolib_create_get_size(...);
    foo_alloc_req fareq = { };
    foolib_create_get_alloc_req(&fareq);

    foo = create_on_the_stack_etc(size, &fareq);

    // The API would have all of that as prerequisites so the caller knows
    // about it. Alignment requirements, etc.

    foolib_init(foo);

    ...

    foolib_destroy(foo);

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Fri Oct 23 13:56:49 2026
    On 10/23/2026 12:19 PM, Lawrence D?Oliveiro wrote:
    On Fri, 23 Oct 2026 09:02:50 -0700, Peter Flass wrote:

    On 10/22/26 22:29, Chris M. Thomasson wrote:

    On 10/22/2026 8:19 PM, Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach
    if you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the
    caller?

    Have the caller have the object before hand and call a function to
    initialize it?

    That obviously wouldn't work, since then the caller would have to
    know something about the object beforehand.

    And what if the object didn?t consist of just *one*
    dynamically-allocated block, but needed links to other blocks as well?
    What if it needed objects dynamically allocated by other APIs, the
    details of which are internal to those APIs? Is the caller required to
    know about all these implementation details?

    In short, the concept doesn?t scale, because it completely breaks the
    concept of data abstraction.

    And it just pushes the dynamic-allocation problem elsewhere, without
    making it easier.

    It can be made to work, and if it fits in with your "scheme", okay, if
    not so what? Have an API that can give us the size of the object the
    caller needs to create. So, again pseudo code:

    size = foolib_create_get_size(...);
    foo_alloc_req fareq = { };
    foolib_create_get_alloc_req(&fareq);

    foo = create_on_the_stack_etc(size, &fareq);

    // The API would have all of that as prerequisites so the caller knows
    // about it. Alignment requirements, etc.

    foolib_init(foo);

    ...

    foolib_destroy(foo);


    The caller can gain the size, and the alignment requirements up front.
    It can allocate it using any of its means. Then use that to call into
    the lib. It works.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Fri Oct 23 14:00:25 2026
    On 10/23/2026 9:02 AM, Peter Flass wrote:
    On 10/22/26 22:29, Chris M. Thomasson wrote:
    On 10/22/2026 8:19 PM, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach if
    you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the
    caller?

    Have the caller have the object before hand and call a function to
    initialize it?

    That obviously wouldn't work, since then the caller would have to know something about the object beforehand. I think you'd have to depend on
    the compiler to destroy the object when it goes out of scope, unless the caller destroys it itself.

    Knowing a size and an alignment requirement doesn't mean the caller
    knows how the object works or what fields it holds. It just means they
    know the dimensions of the box. They get a handle or a raw pointer,
    while the internal layout remains entirely hidden behind the API. That
    is textbook encapsulation

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Thomas Koenig@3:633/10 to All on Fri Oct 23 21:00:30 2026
    David Brown <david.brown@hesbynett.no> schrieb:
    On 23/10/2026 05:21, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 15:41:15 -0500, Lynn McGuire wrote:

    I have been advocating for quite a while that C++ should add a user
    interface programming model for quite a long time.

    First they need a standardized graphics API.


    I hope that never happens.

    I have one Fortran program which has an excellent graphics API,
    it writes Postscript. Works fine. Can't do any mouse clicks on
    it and expect anything to happen, though :-)

    Works for all programming languages as long as they do text I/O.

    There are large numbers of graphics APIs,
    with huge ranges of what they support, how they work and their balance between features, efficiency, portability, size, hardware support, and
    what they are used for.

    I guess mine is an example rather restricted graphics API, then :-)

    --
    This USENET posting was made without artificial intelligence,
    artificial impertinence, artificial arrogance, artificial stupidity,
    artificial flavorings or artificial colorants.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Sat Oct 24 05:14:55 2026
    On 10/24/2026 5:00 AM, Thomas Koenig wrote:
    David Brown <david.brown@hesbynett.no> schrieb:
    On 23/10/2026 05:21, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 15:41:15 -0500, Lynn McGuire wrote:

    I have been advocating for quite a while that C++ should add a user
    interface programming model for quite a long time.

    First they need a standardized graphics API.


    I hope that never happens.

    I have one Fortran program which has an excellent graphics API,
    it writes Postscript. Works fine. Can't do any mouse clicks on
    it and expect anything to happen, though :-)

    Works for all programming languages as long as they do text I/O.

    There are large numbers of graphics APIs,
    with huge ranges of what they support, how they work and their balance
    between features, efficiency, portability, size, hardware support, and
    what they are used for.

    I guess mine is an example rather restricted graphics API, then :-)


    If I remember the manual correctly, Open Watcom Fortran 77 has Win 3.1 abstractions. Those never got ported to Win 95+, as far as I know of,
    so didn't last. I should try it one of these days, and see if it still
    works.
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;
    Federated at https://fed.brid.gy/bsky/myrkraverk.bsky.social

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Johann 'Myrkraverk' Oskarsson@3:633/10 to All on Sat Oct 24 05:19:54 2026
    On 10/24/2026 3:38 AM, Steven G. Kargl wrote:
    On Fri, 23 Oct 2026 19:20:50 -0000 (UTC), Lawrence D?Oliveiro wrote:

    On Fri, 23 Oct 2026 05:54:44 -0000 (UTC), Steven G. Kargl wrote:
    On Fri, 23 Oct 2026 04:22:13 -0000 (UTC), Lawrence D?Oliveiro wrote:
    On Fri, 23 Oct 2026 04:10:39 -0000 (UTC), Steven G. Kargl wrote:
    On Fri, 23 Oct 2026 03:33:44 -0000 (UTC), Lawrence D?Oliveiro wrote: >>>>>> So you can see there is no way out of the inner block without passing >>>>>> through the dispose call.

    'break' is just another name for 'goto label'.

    Using gotos would contribute nothing except make it harder to
    assure yourself of the simplicity of the control flow.

    PS: We're still waiting on a definition of "storage allocation"

    ... allocate object pointer ...


    Nice use of quoting without adding context.

    Just pointing out (in case you didn?t notice) that the points you were
    raising were already addressed in the posting you were (supposedly)
    replying to ...

    And, we are still waiting for your definition of "storage allocation"
    and its needed cleanup in the context of Fortran 77. It as been pointed
    out to you multiple times that Fortran 77 does not have dynamic memory allocation. Fortran 77 does not have pointers and it does not have
    objects. So, what is this mythical cleanup of storage allocation in
    Fortran 77?

    It's okay to admit that you were making a some generalization that
    does not apply to Fortran 77.


    Dear Steven,

    I'm sure you're well aware of the nerd-posturing that prohibits people
    from accepting their mistakes, or admit lacking in any programming ca-
    pacity. I believe Lawrence will never cop to any fault, because it'll
    /lower his social standing/ among the trolls of comp.lang.c++.


    So best wishes, and happy waiting forever for the nerds to apologize!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;
    Federated at https://fed.brid.gy/bsky/myrkraverk.bsky.social

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Fri Oct 23 14:29:22 2026
    On 10/23/2026 12:19 PM, Lawrence D?Oliveiro wrote:
    That obviously wouldn't work, since then the caller would have to
    know something about the object beforehand.

    non sequitur?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Fri Oct 23 22:42:21 2026
    On Fri, 23 Oct 2026 13:56:49 -0700, Chris M. Thomasson wrote:

    On 10/23/2026 12:19 PM, Lawrence D?Oliveiro wrote:

    In short, the concept doesn?t scale, because it completely breaks
    the concept of data abstraction.

    And it just pushes the dynamic-allocation problem elsewhere,
    without making it easier.

    It can be made to work ...

    I?m sure it?s *possible*, but what is the *point*?

    The whole aim of levels of abstraction is to tame the multi-headed
    beast of complexity that is computer programming. What you are doing
    here is breaking down those levels, all in the aid of, I don?t know,
    just to keep using gotos in your code, or something.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Fri Oct 23 22:43:11 2026
    On Fri, 23 Oct 2026 14:29:22 -0700, Chris M. Thomasson wrote:

    On 10/23/2026 12:19 PM, Lawrence D?Oliveiro wrote:

    That obviously wouldn't work, since then the caller would have to
    know something about the object beforehand.

    non sequitur?

    I don?t care, because ... I didn?t say that.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Fri Oct 23 22:46:17 2026
    On Fri, 23 Oct 2026 12:55:02 -0700, Chris M. Thomasson wrote:

    Fwiw, vcpkg has a lot of them, ready to automatically build and
    integrate. vcpkg is actually... Well, its pretty nice and so far...
    Seems to work for me.

    How does it work for end-users? Are your dependencies automatically
    brought in when they install your package? How are they kept
    up-to-date?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Fri Oct 23 22:57:28 2026
    On Fri, 23 Oct 2026 13:02:44 -0700, Chris M. Thomasson wrote:

    Well, for me. I had LOGO, PILOT and BASIC on my first Atari when I
    was a little kiddo in the early to mid 80's. Born in 1977. I had
    some books to go with them. So, I read the damn books. Started
    programming!

    My first exposure to a real computer system was a DEC PDP-11. I
    remember the first time I saw an Apple II running LOGO. Somebody tried
    telling it to do a file I/O command without a floppy in the drive. It
    ground away for a few seconds, and then produced an error message --
    of course.

    What was that error message? I was expecting something like ?DISK
    ERROR? or ?I/O ERROR?. Instead, it said

    I?m having trouble with the disk.

    To me, that was like a splash in the face with a pail of cold water.
    The idea of an error message phrased in plain, approachable language
    (using a first-person pronoun, even) instead of technical terms?? That
    was a revelation.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Charlie Gibbs@3:633/10 to All on Fri Oct 23 23:31:41 2026
    On 2026-10-23, Lawrence D?Oliveiro <ldo@nz.invalid> wrote:

    On Fri, 23 Oct 2026 13:02:44 -0700, Chris M. Thomasson wrote:

    Well, for me. I had LOGO, PILOT and BASIC on my first Atari when I
    was a little kiddo in the early to mid 80's. Born in 1977. I had
    some books to go with them. So, I read the damn books. Started
    programming!

    My first exposure to a real computer system was a DEC PDP-11. I
    remember the first time I saw an Apple II running LOGO. Somebody tried telling it to do a file I/O command without a floppy in the drive. It
    ground away for a few seconds, and then produced an error message --
    of course.

    What was that error message? I was expecting something like ?DISK
    ERROR? or ?I/O ERROR?. Instead, it said

    I?m having trouble with the disk.

    To me, that was like a splash in the face with a pail of cold water.
    The idea of an error message phrased in plain, approachable language
    (using a first-person pronoun, even) instead of technical terms?? That
    was a revelation.

    Unfortunately it's not the kind of revelation I welcome. Back
    in my mainframe days, I learned to hate catch-all error messages;
    they're the sign of a programmer who's too lazy to try to help
    the user. If something goes wrong, I want to be given some clues
    as to where to look. But more and more these days, your typical
    error message is "Something went wrong." Nothing more. This kind
    of conduct should be condemned.

    Think of it from a support person's point of view. A user calls
    and says, "I have an error message." "OK," you reply, "what is
    the message?" "It doesn't work." That's what the user would have
    said anyway - we've just wasted some time, and we still have to
    start the same old game of Twenty Questions.

    I'm not saying that we should go back to the days of cryptic error
    codes. But an error message can be both friendly and helpful.
    For your case, how about something like "There is no disk in the
    drive" or "The disk is write-protected"? And then follow it with
    an error code for those of us who know how to interpret them.
    Users shouldn't be made to guess what the computer already knows.

    --
    /~\ Charlie Gibbs | In this world there are
    \ / <cgibbs@kltpzyxm.invalid> | two kinds of people:
    X I'm really at ac.dekanfrus | 1. Those who can extrapolate
    / \ if you read it the right way. | from incomplete data.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Fri Oct 23 16:58:04 2026
    On 10/23/2026 3:46 PM, Lawrence D?Oliveiro wrote:
    On Fri, 23 Oct 2026 12:55:02 -0700, Chris M. Thomasson wrote:

    Fwiw, vcpkg has a lot of them, ready to automatically build and
    integrate. vcpkg is actually... Well, its pretty nice and so far...
    Seems to work for me.

    How does it work for end-users? Are your dependencies automatically
    brought in when they install your package? How are they kept
    up-to-date?

    Oh yeah. In your build directory, say Debug or Release, it has all of
    the built shared libs and everything you need to run it.

    Keeping them up to date is, afaict, manual.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Fri Oct 23 17:00:00 2026
    On 10/23/2026 4:58 PM, Chris M. Thomasson wrote:
    On 10/23/2026 3:46 PM, Lawrence D?Oliveiro wrote:
    On Fri, 23 Oct 2026 12:55:02 -0700, Chris M. Thomasson wrote:

    Fwiw, vcpkg has a lot of them, ready to automatically build and
    integrate. vcpkg is actually... Well, its pretty nice and so far...
    Seems to work for me.

    How does it work for end-users? Are your dependencies automatically
    brought in when they install your package? How are they kept
    up-to-date?

    Oh yeah. In your build directory, say Debug or Release, it has all of
    the built shared libs and everything you need to run it.

    Keeping them up to date is, afaict, manual.

    In the sense of going back to vcpkg, seeing if there is a new version, building it, and it updates everything. Then go back to your project(s),
    and rebuild them, or they might just link up.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Fri Oct 23 17:01:28 2026
    On 10/23/2026 3:42 PM, Lawrence D?Oliveiro wrote:
    On Fri, 23 Oct 2026 13:56:49 -0700, Chris M. Thomasson wrote:

    On 10/23/2026 12:19 PM, Lawrence D?Oliveiro wrote:

    In short, the concept doesn?t scale, because it completely breaks
    the concept of data abstraction.

    And it just pushes the dynamic-allocation problem elsewhere,
    without making it easier.

    It can be made to work ...

    I?m sure it?s *possible*, but what is the *point*?

    The whole aim of levels of abstraction is to tame the multi-headed
    beast of complexity that is computer programming. What you are doing
    here is breaking down those levels, all in the aid of, I don?t know,
    just to keep using gotos in your code, or something.

    Well, not about goto's and such. Just so a lib can inform the caller as
    to what it needs to work with. The caller sets it up, then calls into
    the init etc. Its being used in a lot of places. Take Vulkan.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Fri Oct 23 17:01:50 2026
    On 10/23/2026 3:43 PM, Lawrence D?Oliveiro wrote:
    On Fri, 23 Oct 2026 14:29:22 -0700, Chris M. Thomasson wrote:

    On 10/23/2026 12:19 PM, Lawrence D?Oliveiro wrote:

    That obviously wouldn't work, since then the caller would have to
    know something about the object beforehand.

    non sequitur?

    I don?t care, because ... I didn?t say that.

    Oh sorry.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Peter Flass@3:633/10 to All on Fri Oct 23 17:04:45 2026
    On 10/23/26 16:31, Charlie Gibbs wrote:
    On 2026-10-23, Lawrence D?Oliveiro <ldo@nz.invalid> wrote:

    On Fri, 23 Oct 2026 13:02:44 -0700, Chris M. Thomasson wrote:

    Well, for me. I had LOGO, PILOT and BASIC on my first Atari when I
    was a little kiddo in the early to mid 80's. Born in 1977. I had
    some books to go with them. So, I read the damn books. Started
    programming!

    My first exposure to a real computer system was a DEC PDP-11. I
    remember the first time I saw an Apple II running LOGO. Somebody tried
    telling it to do a file I/O command without a floppy in the drive. It
    ground away for a few seconds, and then produced an error message --
    of course.

    What was that error message? I was expecting something like ?DISK
    ERROR? or ?I/O ERROR?. Instead, it said

    I?m having trouble with the disk.

    To me, that was like a splash in the face with a pail of cold water.
    The idea of an error message phrased in plain, approachable language
    (using a first-person pronoun, even) instead of technical terms?? That
    was a revelation.

    Unfortunately it's not the kind of revelation I welcome. Back
    in my mainframe days, I learned to hate catch-all error messages;
    they're the sign of a programmer who's too lazy to try to help
    the user. If something goes wrong, I want to be given some clues
    as to where to look. But more and more these days, your typical
    error message is "Something went wrong." Nothing more. This kind
    of conduct should be condemned.

    Think of it from a support person's point of view. A user calls
    and says, "I have an error message." "OK," you reply, "what is
    the message?" "It doesn't work." That's what the user would have
    said anyway - we've just wasted some time, and we still have to
    start the same old game of Twenty Questions.

    I'm not saying that we should go back to the days of cryptic error
    codes. But an error message can be both friendly and helpful.
    For your case, how about something like "There is no disk in the
    drive" or "The disk is write-protected"? And then follow it with
    an error code for those of us who know how to interpret them.
    Users shouldn't be made to guess what the computer already knows.


    I like messages with codes AND descriptive text.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lynn Wheeler@3:633/10 to All on Fri Oct 23 14:29:50 2026
    boltar@battlestar.co.uk writes:
    Virtual machine? Wrong language , comp.lang.java is that way --->

    some of the CTSS/7094 went to the 5th flr to do Multics, others went to
    the IBM Cambridge Science Center on the 4th flr and did virtual machines (wanted 360/50 to modify with virtual memory but all the extras were
    going to FAA ATC project, so had to settle for 360/40 to modify with
    virtual memory and did CP40/CMS which morphs into CP67/CMS when 360/67
    standard with virtual memory becomes available, precursor to VM370/CMS), CP67-based science center wide-area network (morphs into internal
    corporate network larger than arpanet/internet from beginning until
    sometime mid/late 80s when forced to convert to SNA/VTAM, technology
    also had been used for corporate sponsord univ BITNET), invented GML in
    1969 (decade later morphs in SGML and after another decade morphs into
    HTML at CERN), etc

    I had taken 2credit hr intro to Fortran/Computers. At end of semester, I
    was hired to rewrite 1401 MPIO in 360 assembler for 360/30. Univ. was
    getting 360/67 for tss/360 replacing 709/1401 and got 360/30 temporarily replacing 1401 pending arrival of 360/67. Univ. shutdown datacenter on weekends and I would have place dedicated (although 48hrs w/o sleep made
    monday classes hard). I was given pile of hardware and software manuals
    and got to design and implement my own monitor, interrupt handlers,
    device drivers, storage management, error recovery, etc ... and within a
    few weeks had 2000 card assembler program (stand alone monitor, booted
    with BPS loader). Sometimes I would come in and production had finished
    early and everything had been powered off (and 360/30 would power
    on). Some number of documents and trail/error found if I put all the controllers in CE-mode, power on 360/30, power on all the controllers
    (and then take out of CE-mode).

    The 360/67 arrived within a year of taking intro class and I was hired
    fulltime responsible for os/360 (tss/360 not coming to production). 709
    did student fortran in less than second. 360/67 (as 360/65) os/360
    (MFT9.5) took over a minute, I install HASP cutting time in half. MFT11,
    I start redoing SYSGEN STAGE2 (partial tray) to carefully place datasets
    and PDS members to optimize arm seek and (PDS directory) multi-track
    search, cutting another 2/3rds to 12.9secs. OS/360 never got better than
    709 until I install Univ Waterloo WATFOR; as 360/65, WATFOR clocked at
    20,000 statements/min (333statements/sec), student fortran tended to run
    30-60 statements.

    Then CSC came out to install (virtual machine) CP/67 (3rd after CSC
    itself and MIT Lincoln Labs) and I mostly get to play with it during my
    weekend 48hr window. I then spend a few months rewriting pathlengths for running OS/360 in virtual machine. Bare machine test ran 322secs
    ... initially 856secs (CP67 CPU 534secs). After a few months I had CP67
    CPU down from 534secs to 113secs. I then start rewriting the dispatcher/scheduler (dynamic adaptive resource manager/default fair
    share scheduling policy), paging, adding ordered seek queuing (from
    FIFO) and mutli-page transfer channel programs (from FIFO and optimized
    for transfers/revolution, getting 2301 paging drum from 70-80 4k
    transfers/sec to channel transfer peak of 270). Six months after univ
    initial CP/67 install, CSC was giving one week class in LA. I arrive on
    Sunday afternoon and asked to teach the class, it turns out that the
    people that were going to teach it had resigned the Friday before to
    join one of the 60s CSC CP67 commercial online spin-offs

    Before graduate, I was hired fulltime into small group in the Boeing CFO
    office to help with the formation of Boeing Computer Services
    (consolidate all dataprocessing into an independent business unit). I
    think Renton datacenter largest in the world, 360/65s arriving faster
    than they could be installed, boxes constantly staged in hallways around
    the machine room (jokes about Boeing getting 360/65s like other
    companies acquired keypunches). Lots of politics between Renton director
    and CFO, who only had a 360/30 for payroll up at Boeing field (although
    they enlarge the room for a 1mbyte 360/67 for me to play with when I
    wasn't doing other stuff, sort of my personal computer).

    trivia: both Boeing and IBM told stories about 360 announcement day,
    Boeing submitted an order making the IBM marketing rep, highest paid IBM employee that year. Sales were still straight commission; IBM shifts to
    quota the following year.

    When I graduate, I join the science center (instead of staying with
    Boeing CFO)

    --
    virtualization experience starting Jan1968, online at home since Mar1970

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Sat Oct 24 03:33:34 2026
    On Fri, 23 Oct 2026 17:01:28 -0700, Chris M. Thomasson wrote:

    On 10/23/2026 3:42 PM, Lawrence D?Oliveiro wrote:

    On Fri, 23 Oct 2026 13:56:49 -0700, Chris M. Thomasson wrote:

    On 10/23/2026 12:19 PM, Lawrence D?Oliveiro wrote:

    In short, the concept doesn?t scale, because it completely breaks
    the concept of data abstraction.

    And it just pushes the dynamic-allocation problem elsewhere,
    without making it easier.

    It can be made to work ...

    I?m sure it?s *possible*, but what is the *point*?

    The whole aim of levels of abstraction is to tame the multi-headed
    beast of complexity that is computer programming. What you are
    doing here is breaking down those levels, all in the aid of, I
    don?t know, just to keep using gotos in your code, or something.

    Well, not about goto's and such. Just so a lib can inform the caller
    as to what it needs to work with. The caller sets it up, then calls
    into the init etc. Its being used in a lot of places. Take Vulkan.

    Where in Vulkan? Exposing implementation details to the caller not
    only increases complexity, it also limits the implementor?s ability to
    change those details later.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Sat Oct 24 12:38:36 2026
    On 23/10/2026 18:55, Peter Flass wrote:
    On 10/23/26 02:34, David Brown wrote:
    On 23/10/2026 05:21, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 15:41:15 -0500, Lynn McGuire wrote:

    I have been advocating for quite a while that C++ should add a user
    interface programming model for quite a long time.

    First they need a standardized graphics API.


    I hope that never happens.˙ There are large numbers of graphics APIs,
    with huge ranges of what they support, how they work and their balance
    between features, efficiency, portability, size, hardware support, and
    what they are used for.

    People who think C++ should have a standardised graphics API usually
    mean they want to standardise the API they use on the one application
    type that they write.


    I gather there?s been a proposal that?s been kicking around for some
    years, to adopt something based on Cairo
    <https://www.cairographics.org/>.


    You need something with subsets. At least a "basic" subset, a "full"
    subset, and something in between that satisfies most uses. Or maybe
    subsets for different purposes, but they should all be compatible.

    You can't do that for GUI's. All you get is a collection of subsets
    that are wrong for many people, and not nearly enough for most of them.

    Look at Python. It has a standard gui interface in the standard library
    - TKInter. Of serious Python programs with guis, it probably has a
    market share of a few percent - it's pretty much pointless having it in
    the standard library.

    There are a large number of gui toolkits used - QT, wx, GTK, SDL,
    "immediate mode" guis, embedded web browsers, etc. I have no
    statistics, but I doubt if there are any that have more than about 10% "market" share. Any many of these have wildly different paradigms - you
    can't easily combine them for a subset or abstraction.

    A standardised gui for C++ always sounds like a nice idea, but I can't
    see it being at all practical as part of the C++ standards process. At
    best, it could be a parallel setup with its own scheduling and its own publications. Trying to fit a gui into the model use for creating and maintaining the C++ standards would 5 years to produce a document that
    is 4 times the size of the current standard, 8 years out of date, and
    would be ignored by 95% of people writing gui programs in C++. And
    that's assuming you ignore one of the major users of C++ - the embedded
    world.




    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Sat Oct 24 12:43:02 2026
    On 23/10/2026 18:57, Peter Flass wrote:
    On 10/23/26 02:45, David Brown wrote:
    On 23/10/2026 08:25, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 22:29:45 -0700, Chris M. Thomasson wrote:

    On 10/22/2026 8:19 PM, Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach
    if you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the
    caller?

    Have the caller have the object before hand and call a function to
    initialize it?

    I?m assuming that all that BASIC programming hasn?t got to your head,
    and you?re not serious. ;)

    Chris' wording is perhaps poor, but the principle is right.

    I don't know PL/I or Fortran, but in C if you have :

    ˙˙˙˙˙typedef struct data_struct { int a; int xs[20]; } S ;

    ˙˙˙˙˙S build_some_data(void) {
    ˙˙˙˙˙˙˙˙ S s;

    ˙˙˙˙˙˙˙˙ s.a = 123;
    ˙˙˙˙˙˙˙˙ for (int i = 0; i < 20; i++) s.xs[i] = i;

    ˙˙˙˙˙˙˙˙ return s;
    ˙˙˙˙˙}

    ˙˙˙˙˙void foo() {
    ˙˙˙˙˙˙˙˙ S s = build_some_data();
    ˙˙˙˙˙}


    then it is typically handled as though you had written :

    ˙˙˙˙˙void build_some_data(S * p) {
    ˙˙˙˙˙˙˙˙ p->a = 123;
    ˙˙˙˙˙˙˙˙ for (int i = 0; i < 20; i++) p->xs[i] = i;

    ˙˙˙˙˙˙˙˙ return;
    ˙˙˙˙˙}

    ˙˙˙˙˙void foo() {
    ˙˙˙˙˙˙˙˙ S s;
    ˙˙˙˙˙˙˙˙ build_some_data(&s);
    ˙˙˙˙˙}


    That is - the caller creates the /space/ for the returned object, but
    does not do any kind of initialisation.˙ It passes a pointer to that
    space as a hidden parameter to the function that wants to return the
    object.

    That principle should work fine in any language, as long as the size
    of the returned object is known by the caller code.

    That last sentence is why it would not work fine,

    OK. Knowing the size of the returned object is an absolute requirement
    for pre-allocation by the caller, and it is a requirement that is fine
    for a lot of situations and a lot of languages. But if it is not the
    case for PL/I, Fortran, or any other particular language (or particular function in any language), then I fully agree - the object's space can't
    be handled by the caller.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sat Oct 24 13:26:07 2026
    On 10/23/2026 8:33 PM, Lawrence D?Oliveiro wrote:
    On Fri, 23 Oct 2026 17:01:28 -0700, Chris M. Thomasson wrote:

    On 10/23/2026 3:42 PM, Lawrence D?Oliveiro wrote:

    On Fri, 23 Oct 2026 13:56:49 -0700, Chris M. Thomasson wrote:

    On 10/23/2026 12:19 PM, Lawrence D?Oliveiro wrote:

    In short, the concept doesn?t scale, because it completely breaks
    the concept of data abstraction.

    And it just pushes the dynamic-allocation problem elsewhere,
    without making it easier.

    It can be made to work ...

    I?m sure it?s *possible*, but what is the *point*?

    The whole aim of levels of abstraction is to tame the multi-headed
    beast of complexity that is computer programming. What you are
    doing here is breaking down those levels, all in the aid of, I
    don?t know, just to keep using gotos in your code, or something.

    Well, not about goto's and such. Just so a lib can inform the caller
    as to what it needs to work with. The caller sets it up, then calls
    into the init etc. Its being used in a lot of places. Take Vulkan.

    Where in Vulkan? Exposing implementation details to the caller not
    only increases complexity, it also limits the implementor?s ability to
    change those details later.

    Iiic, vkGetBufferMemoryRequirements and vkGetImageMemoryRequirements,
    which return a VkMemoryRequirements struct containing size, alignment,
    and memoryTypeBits. The caller allocates the memory with
    vkAllocateMemory and binds it with vkBindBufferMemory.

    Also, iirc io_uring: IORING_SETUP_NO_MMAP (Linux 6.5+) lets the caller
    supply the memory for the rings and SQE array. It must be suitably
    aligned (page or huge page), and the caller has to compute how big it
    needs to be from the entry count and flags.

    So it can be made to work.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sat Oct 24 13:27:30 2026
    On 10/24/2026 1:26 PM, Chris M. Thomasson wrote:
    Iiic, vkGetBufferMemoryRequirements and vkGetImageMemoryRequirements,
    which return a VkMemoryRequirements struct containing size, alignment,
    and memoryTypeBits. The caller allocates the memory with
    vkAllocateMemory and binds it with vkBindBufferMemory.

    Also, iirc io_uring: IORING_SETUP_NO_MMAP (Linux 6.5+) lets the caller supply the memory for the rings and SQE array. It must be suitably
    aligned (page or huge page), and the caller has to compute how big it
    needs to be from the entry count and flags.

    So it can be made to work.

    Or what about miniaudio?s ma_engine_get_heap_size plus ma_engine_init_preallocated

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Sat Oct 24 22:32:03 2026
    On Sat, 24 Oct 2026 13:26:07 -0700, Chris M. Thomasson wrote:

    On 10/23/2026 8:33 PM, Lawrence D?Oliveiro wrote:

    On Fri, 23 Oct 2026 17:01:28 -0700, Chris M. Thomasson wrote:

    On 10/23/2026 3:42 PM, Lawrence D?Oliveiro wrote:

    The whole aim of levels of abstraction is to tame the
    multi-headed beast of complexity that is computer programming.
    What you are doing here is breaking down those levels, all in the
    aid of, I don?t know, just to keep using gotos in your code, or
    something.

    Well, not about goto's and such. Just so a lib can inform the
    caller as to what it needs to work with. The caller sets it up,
    then calls into the init etc. Its being used in a lot of places.
    Take Vulkan.

    Where in Vulkan? Exposing implementation details to the caller not
    only increases complexity, it also limits the implementor?s ability
    to change those details later.

    Iiic, vkGetBufferMemoryRequirements and
    vkGetImageMemoryRequirements, which return a VkMemoryRequirements
    struct containing size, alignment, and memoryTypeBits. The caller
    allocates the memory with vkAllocateMemory and binds it with vkBindBufferMemory.

    I had a quick look at that. It seems to have to do with the reality of
    graphics hardware implementing different kinds of memory with
    different kinds of characteristics, and the impossibility of
    completely such ignoring such issues in real-time 3D rendering.

    I expect higher-level APIs (e.g. game engines) will wrap all this
    behind their own higher-level abstractions, so regular
    programmers/game creators don?t have to worry about it.

    In short, it?s an abstraction that leaks that you accept only because
    you have to, not because it?s a good idea for abstractions in general.
    If you can successfully hide issues of memory and other resource
    allocation behind your abstraction, you would still rather do it than
    not.

    So, to get back to my point, the technique I use is based on a form of structured programming called a ?Nassi-Shneiderman diagram?. The
    overall structure looks like

    ... initialize object pointer to NULL ...
    do /*once*/
    {
    ... possible other stuff ...
    ... allocate object pointer ...
    if (error occurred)
    break;
    ... possible other stuff using object pointer ...
    }
    while (false);
    ... call free(3) (or equivalent) on object pointer ...

    So you can see there is no way out of the inner block without passing
    through the dispose call. Using gotos would contribute nothing except
    make it harder to assure yourself of the simplicity of the control
    flow.

    Looks deceptively simple. But the same technique can scale up to quite
    complex cases.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Sat Oct 24 22:32:25 2026
    On Sat, 24 Oct 2026 13:27:30 -0700, Chris M. Thomasson wrote:

    Or what about miniaudio?s ma_engine_get_heap_size plus ma_engine_init_preallocated

    No idea about that, but the same principle would apply.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Nuno Silva@3:633/10 to All on Sat Oct 24 23:59:31 2026
    On 2026-10-24, Gary R. Schmidt wrote:

    On 24/10/2026 03:06, Peter Flass wrote:
    On 10/23/26 01:01, boltar@caprica.universe wrote:
    On Thu, 22 Oct 2026 12:19:49 -0400 (EDT)
    kludge@panix.com (Scott Dorsey) gabbled:
    In article <11bd7tj$rh4f$1@dont-email.me>,˙
    <boltar@battlestar.co.uk> wrote:

    Most of us have a CS degree. But then we go out into the real
    world, get a
    job and find out what real programming on real products entails,
    not a load
    of virtual academic naval gazing.

    That's because it's not a trade school degree.˙ It's not there to teach >>>> you to program, it's there to teach you the fundamentals that you
    need to
    properly understand programming.

    No, it teaches you fundamentals of certain aspects of computer
    paradigms such
    as databases, graphics, AI. Most people into computers learn actual
    programming
    long before they hit university.

    Engineering schools are even more that way.˙ They don't teach you much >>>> engineering, but they give you all the background that you need to learn >>>> engineering.

    Programming isn't pure engineering - its a combination of
    engineering, logic,
    art and a trade.

    If you just want a job, getting one of these degrees is not for
    you. It's
    not there for that.

    Bill Gates never earned a degree. He seemed to do ok.

    From what I understand, he wasn't a very good programmer, though.

    A story I heard thirty-odd years ago about Bill Gates' purported
    programming ability:
    When MS started making money from their MSBASIC compiler, they started
    hiring real staff.
    One of them was tasked with working through the various functions that
    BASIC does, such as opening files, sorting arrays, and the like.
    When he looked at the sort routine, he exclaimed, loudly, "What idiot
    wrote this, it doesn't do anything!"
    Bill was in the room at the time, wandered over and had a look at what
    they were working on, and said, "Oh, the sort routine. I could never
    get that to work."
    Apparently it was not a career-limiting action by the programmer.

    Cheers,
    Gary B-)

    And this is probably an example of where it is important to have at
    least somehow learned (be it from a "CS" degree or not) that there are well-known sorting strategies and algorithms and that they perform
    differently, and that it's probably better to implement something
    sufficiently tested and reviewed? And to know how to pick one that
    doesn't work too terribly for the kind of data being sorted.

    Still, sorting is, I think, part of the fundamental basics covered in programming education, and at least at higher education level you can
    probably expect that to include a glance at the different algorithms.
    So, by the standards of at least 10-20 years ago, this would probably
    mean Gates wasn't much of a serious programmer? He wouldn't need to
    *memorize* all of them, but just to know that he could look it up and
    pick one. But maybe things were vastly different back then?


    --
    Nuno Silva

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Peter Flass@3:633/10 to All on Sat Oct 24 16:03:10 2026
    On 10/24/26 15:59, Nuno Silva wrote:
    On 2026-10-24, Gary R. Schmidt wrote:

    On 24/10/2026 03:06, Peter Flass wrote:
    On 10/23/26 01:01, boltar@caprica.universe wrote:
    On Thu, 22 Oct 2026 12:19:49 -0400 (EDT)
    kludge@panix.com (Scott Dorsey) gabbled:
    In article <11bd7tj$rh4f$1@dont-email.me>,
    <boltar@battlestar.co.uk> wrote:

    Most of us have a CS degree. But then we go out into the real
    world, get a
    job and find out what real programming on real products entails,
    not a load
    of virtual academic naval gazing.

    That's because it's not a trade school degree.˙ It's not there to teach >>>>> you to program, it's there to teach you the fundamentals that you
    need to
    properly understand programming.

    No, it teaches you fundamentals of certain aspects of computer
    paradigms such
    as databases, graphics, AI. Most people into computers learn actual
    programming
    long before they hit university.

    Engineering schools are even more that way.˙ They don't teach you much >>>>> engineering, but they give you all the background that you need to learn >>>>> engineering.

    Programming isn't pure engineering - its a combination of
    engineering, logic,
    art and a trade.

    If you just want a job, getting one of these degrees is not for
    you. It's
    not there for that.

    Bill Gates never earned a degree. He seemed to do ok.

    From what I understand, he wasn't a very good programmer, though.

    A story I heard thirty-odd years ago about Bill Gates' purported
    programming ability:
    When MS started making money from their MSBASIC compiler, they started
    hiring real staff.
    One of them was tasked with working through the various functions that
    BASIC does, such as opening files, sorting arrays, and the like.
    When he looked at the sort routine, he exclaimed, loudly, "What idiot
    wrote this, it doesn't do anything!"
    Bill was in the room at the time, wandered over and had a look at what
    they were working on, and said, "Oh, the sort routine. I could never
    get that to work."
    Apparently it was not a career-limiting action by the programmer.

    Cheers,
    Gary B-)

    And this is probably an example of where it is important to have at
    least somehow learned (be it from a "CS" degree or not) that there are well-known sorting strategies and algorithms and that they perform differently, and that it's probably better to implement something sufficiently tested and reviewed? And to know how to pick one that
    doesn't work too terribly for the kind of data being sorted.

    Still, sorting is, I think, part of the fundamental basics covered in programming education, and at least at higher education level you can probably expect that to include a glance at the different algorithms.
    So, by the standards of at least 10-20 years ago, this would probably
    mean Gates wasn't much of a serious programmer? He wouldn't need to *memorize* all of them, but just to know that he could look it up and
    pick one. But maybe things were vastly different back then?



    TAoCP was available 20 years ago.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sun Oct 25 16:16:26 2026
    On 10/22/2026 10:29 PM, Chris M. Thomasson wrote:
    On 10/22/2026 8:19 PM, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach if
    you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the
    caller?

    Have the caller have the object before hand and call a function to initialize it?

    Even analogous, to say, an API that says read n bytes and store into
    buffer. Well, the caller has lifetime of said buffer. The caller makes
    the buffer, calls into the function. The buffer bounds are known. Say a metadata stub:

    struct foobar_caller_alloc_helper
    {
    size_t m_size;
    size_t m_align;
    };





    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 00:42:55 2026
    On Sun, 25 Oct 2026 16:16:26 -0700, Chris M. Thomasson wrote:

    Even analogous, to say, an API that says read n bytes and store into
    buffer. Well, the caller has lifetime of said buffer. The caller makes
    the buffer, calls into the function.

    So how is the caller supposed to manage that memory?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sun Oct 25 19:11:48 2026
    On 10/25/2026 5:42 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 16:16:26 -0700, Chris M. Thomasson wrote:

    Even analogous, to say, an API that says read n bytes and store into
    buffer. Well, the caller has lifetime of said buffer. The caller makes
    the buffer, calls into the function.

    So how is the caller supposed to manage that memory?

    Ummm, say we wanted to have a buffer and use it.

    Say:

    {
    char buf[2048] = { '\0' };
    size_t bytes= foo_read(self, buf, 1024);
    }

    A caller provided buffer is normal with a lot of API's out there.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sun Oct 25 19:21:00 2026
    On 10/25/2026 5:42 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 16:16:26 -0700, Chris M. Thomasson wrote:

    Even analogous, to say, an API that says read n bytes and store into
    buffer. Well, the caller has lifetime of said buffer. The caller makes
    the buffer, calls into the function.

    So how is the caller supposed to manage that memory?

    Managing the memory is the caller?s job in C anyway. That?s the
    trade-off the language makes. read, recv, and mmap all work this way.
    This just applies the same contract to the lib?s own object.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Sun Oct 25 19:28:00 2026
    On 10/24/2026 3:32 PM, Lawrence D?Oliveiro wrote:
    I had a quick look at that. It seems to have to do with the reality of graphics hardware implementing different kinds of memory with
    different kinds of characteristics, and the impossibility of
    completely such ignoring such issues in real-time 3D rendering.

    I expect higher-level APIs (e.g. game engines) will wrap all this
    behind their own higher-level abstractions, so regular
    programmers/game creators don?t have to worry about it.

    In short, it?s an abstraction that leaks that you accept only because
    you have to, not because it?s a good idea for abstractions in general.
    If you can successfully hide issues of memory and other resource
    allocation behind your abstraction, you would still rather do it than
    not.

    So, to get back to my point, the technique I use is based on a form of structured programming called a ?Nassi-Shneiderman diagram?. The
    overall structure looks like

    ... initialize object pointer to NULL ...
    do /*once*/
    {
    ... possible other stuff ...
    ... allocate object pointer ...
    if (error occurred)
    break;
    ... possible other stuff using object pointer ...
    }
    while (false);
    ... call free(3) (or equivalent) on object pointer ...

    So you can see there is no way out of the inner block without passing
    through the dispose call. Using gotos would contribute nothing except
    make it harder to assure yourself of the simplicity of the control
    flow.

    Looks deceptively simple. But the same technique can scale up to quite complex cases.


    The graphics case is where the leak is unavoidable, but that?s not why
    I?d want it. A lib that never allocates behind your back is what you
    want in embedded, kernel, and arena code, and a foo_create wrapper on
    top gives you the hidden-allocation version for everyone else. Your
    do-once cleanup idiom works fine with it. You just call deinit and
    reclaim the block the way you made it. It?s a way to structure the
    caller?s error handling, and it doesn?t say anything about who owns the memory.

    Say memory on a threads stack, no free needed.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 03:39:38 2026
    On Sun, 25 Oct 2026 19:11:48 -0700, Chris M. Thomasson wrote:

    A caller provided buffer is normal with a lot of API's out there.

    No it isn?t. It?s not a good way to manage things, anyway: instead of
    solving the resource-allocation problem once and for all in the
    library API, you are pushing the burden onto all the client code, each
    one of which has to solve it for itself.

    That?s a dumb way to design things.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 03:40:23 2026
    On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:

    Managing the memory is the caller?s job in C anyway.

    Does that apply to the caller of library APIs like malloc(3) and
    free(3)?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 03:43:05 2026
    On Sun, 25 Oct 2026 19:28:00 -0700, Chris M. Thomasson wrote:

    A lib that never allocates behind your back is what you
    want in embedded, kernel, and arena code ...

    Even kernels want a common memory-management architecture, so addon
    modules don?t have to reinvent memory management on their own.

    Think of something like allocating low-priority cache memory, for
    stuff that can be dumped if necessary: that needs to be managed in the
    core of the kernel, so that if apps need regular memory for things
    they want to keep in memory, the kernel can free up cache as necessary
    to make more memory available.

    Stop trying to rationalize away the whole point of dynamic memory
    allocation.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 03:47:40 2026
    On Sun, 25 Oct 2026 22:54:14 -0400, Cryptoengineer wrote:

    I distinctly recall working with Sweet-16 on my ][+ back in the day,
    but can't recall the details.

    Interpreter for 16-bit integer arithmetic, according to <https://en.wikipedia.org/wiki/SWEET16>: ran at 1/10th the speed of
    native 6502 instructions, but took up just 300 bytes of RAM, but
    apparently cut the size of the whole Integer BASIC implementation by
    20%.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From John Ames@3:633/10 to All on Mon Oct 26 08:13:37 2026
    On 25 Oct 2026 20:10:26 -0400
    Rich Alderson <news@alderson.users.panix.com> wrote:

    The interpreter is assembled from source on a PDP-10 with at least
    128K (and preferably more) of 36 bit words,because it's implemented
    as local system call macros in PDP-10 assembler.

    Bill wrote the basic framework, Monte Davidoff wrote the
    transcendental math functions, and Paul Allen wrote the PDP-10 code
    to do the assembly.

    NB: I worked for Paul building Living Computers: Museum+Labs and
    working there as an engineer from 2003-2018, then till 2020 when we
    closed due to the pandemic. I've seen the original code, with named attributions.

    Thanks for weighing in - I had a notion someone here could provide
    direct info on the topic =^_^=


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 13:23:59 2026
    On 10/25/2026 8:43 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:28:00 -0700, Chris M. Thomasson wrote:

    A lib that never allocates behind your back is what you
    want in embedded, kernel, and arena code ...

    Even kernels want a common memory-management architecture, so addon
    modules don?t have to reinvent memory management on their own.

    Think of something like allocating low-priority cache memory, for
    stuff that can be dumped if necessary: that needs to be managed in the
    core of the kernel, so that if apps need regular memory for things
    they want to keep in memory, the kernel can free up cache as necessary
    to make more memory available.

    Stop trying to rationalize away the whole point of dynamic memory
    allocation.

    If you need dynamic memory fine. If a lib allocates things for itself,
    fine. Just make sure to know how to clean it up. Also, the caller can
    use dynamic memory if it wants to. RAII is pretty nice here.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 13:26:38 2026
    On 10/25/2026 8:39 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:11:48 -0700, Chris M. Thomasson wrote:

    A caller provided buffer is normal with a lot of API's out there.

    No it isn?t. It?s not a good way to manage things, anyway: instead of
    solving the resource-allocation problem once and for all in the
    library API, you are pushing the burden onto all the client code, each
    one of which has to solve it for itself.

    That?s a dumb way to design things.

    HUH? How do you call say, fread without a user provided buffer?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 13:29:05 2026
    On 10/25/2026 8:40 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:

    Managing the memory is the caller?s job in C anyway.

    Does that apply to the caller of library APIs like malloc(3) and
    free(3)?

    Yes. The caller calls malloc, if it succeeded, the caller needs to free
    what it got... Right?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 13:33:37 2026
    On 10/26/2026 1:29 PM, Chris M. Thomasson wrote:
    On 10/25/2026 8:40 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:

    Managing the memory is the caller?s job in C anyway.

    Does that apply to the caller of library APIs like malloc(3) and
    free(3)?

    Yes. The caller calls malloc, if it succeeded, the caller needs to free
    what it got... Right?

    Say a lib that has foo_create... Well, the damn called must remember to
    call foo_destroy, right?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Mon Oct 26 22:29:22 2026
    On 26/10/2026 21:29, Chris M. Thomasson wrote:
    On 10/25/2026 8:40 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:

    Managing the memory is the caller?s job in C anyway.

    Does that apply to the caller of library APIs like malloc(3) and
    free(3)?

    Yes. The caller calls malloc, if it succeeded, the caller needs to free
    what it got... Right?

    Exactly. The caller is responsible for /managing/ the memory (or it can
    pass on that responsibility to something else). malloc and free are
    provide and dispose of memory, they do not manage it.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 21:45:20 2026
    On Mon, 26 Oct 2026 13:33:37 -0700, Chris M. Thomasson wrote:

    Say a lib that has foo_create... Well, the damn called must remember
    to call foo_destroy, right?

    Are you backpedalling from your previous idea that the caller must
    allocate the memory for the library to use?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 21:45:54 2026
    On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:

    HUH? How do you call say, fread without a user provided buffer?

    Relevance being?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 21:46:30 2026
    On Mon, 26 Oct 2026 13:23:59 -0700, Chris M. Thomasson wrote:

    If you need dynamic memory fine.

    What the hell do you think we have been talking about this whole
    time??

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 14:47:07 2026
    On 10/26/2026 2:45 PM, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:

    HUH? How do you call say, fread without a user provided buffer?

    Relevance being?

    Ummm... What we were talking about. You snipped a lot. See, the caller
    needs to have the buffer in order to call fread, right?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 14:51:57 2026
    On 10/26/2026 2:46 PM, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 13:23:59 -0700, Chris M. Thomasson wrote:

    If you need dynamic memory fine.

    What the hell do you think we have been talking about this whole
    time??

    Why do you "seem" to think we "always" need dynamic memory? Then you ask
    this gem:
    __________
    Does that apply to the caller of library APIs like malloc(3) and
    free(3)?
    __________

    See, the caller is responsible for managing things. Say foo_create that succeeds. Well, now the caller must call foo_destroy.



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 14:53:48 2026
    On 10/26/2026 2:45 PM, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 13:33:37 -0700, Chris M. Thomasson wrote:

    Say a lib that has foo_create... Well, the damn called must remember
    to call foo_destroy, right?

    Are you backpedalling from your previous idea that the caller must
    allocate the memory for the library to use?

    Where did I say must? I said some libs allow the caller to create their internal state. You are the one that seems to not understand it? Either
    way, the caller needs to manage things in C. malloc/free, etc.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 14:58:35 2026
    On 10/26/2026 2:29 PM, David Brown wrote:
    On 26/10/2026 21:29, Chris M. Thomasson wrote:
    On 10/25/2026 8:40 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:

    Managing the memory is the caller?s job in C anyway.

    Does that apply to the caller of library APIs like malloc(3) and
    free(3)?

    Yes. The caller calls malloc, if it succeeded, the caller needs to
    free what it got... Right?

    Exactly.˙ The caller is responsible for /managing/ the memory (or it can pass on that responsibility to something else).˙ malloc and free are
    provide and dispose of memory, they do not manage it.


    Right. For instance take my ralloc thing. A user can create a big pile
    of memory, have rallocex carve it up for them (align, etc), and use it.
    But, the user needs to know how to free that memory. If its on the
    stack, well, easy. If not call free, or whatever it needs.

    ralloc does not give a crap where the memory came from.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Mon Oct 26 22:20:23 2026
    On Mon, 26 Oct 2026 14:53:48 -0700, Chris M. Thomasson wrote:

    On 10/26/2026 2:45 PM, Lawrence D?Oliveiro wrote:

    On Mon, 26 Oct 2026 13:33:37 -0700, Chris M. Thomasson wrote:

    Say a lib that has foo_create... Well, the damn called must
    remember to call foo_destroy, right?

    Are you backpedalling from your previous idea that the caller must
    allocate the memory for the library to use?

    Where did I say must?

    You said ?Managing the memory is the caller?s job in C anyway.? You
    didn?t say ?could be the caller?s job? as in ?the caller could have a
    choice?, you said ?*is* the caller?s job?. No choice. I.e. the caller
    *must* manage memory.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 15:42:31 2026
    On 10/26/2026 3:20 PM, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 14:53:48 -0700, Chris M. Thomasson wrote:

    On 10/26/2026 2:45 PM, Lawrence D?Oliveiro wrote:

    On Mon, 26 Oct 2026 13:33:37 -0700, Chris M. Thomasson wrote:

    Say a lib that has foo_create... Well, the damn called must
    remember to call foo_destroy, right?

    Are you backpedalling from your previous idea that the caller must
    allocate the memory for the library to use?

    Where did I say must?

    You said ?Managing the memory is the caller?s job in C anyway.? You
    didn?t say ?could be the caller?s job? as in ?the caller could have a choice?, you said ?*is* the caller?s job?. No choice. I.e. the caller
    *must* manage memory.

    But, the caller must take care in C. Say a lib that allows the caller to create their own memory from the requirements reaped from the lib. Okay.
    Fine. Also, take a lib that is more "encapsulated" than say a pure foo_create/destroy. The caller must remember to call foo_destroy, right?

    Using io_uring is a fun one. The caller created the memory, iirc from
    mmap, so the kernel can use it. The Kernel punts off the lifetime
    management of the users ring buffers.

    The C must manage things regardless. say malloc and free?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 15:46:04 2026
    On 10/25/2026 8:40 PM, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:

    Managing the memory is the caller?s job in C anyway.

    Does that apply to the caller of library APIs like malloc(3) and
    free(3)?

    you should print that out and frame it.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 16:06:08 2026
    On 10/26/2026 3:20 PM, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 14:53:48 -0700, Chris M. Thomasson wrote:

    On 10/26/2026 2:45 PM, Lawrence D?Oliveiro wrote:

    On Mon, 26 Oct 2026 13:33:37 -0700, Chris M. Thomasson wrote:

    Say a lib that has foo_create... Well, the damn called must
    remember to call foo_destroy, right?

    Are you backpedalling from your previous idea that the caller must
    allocate the memory for the library to use?

    Where did I say must?

    You said ?Managing the memory is the caller?s job in C anyway.? You
    didn?t say ?could be the caller?s job? as in ?the caller could have a choice?, you said ?*is* the caller?s job?. No choice. I.e. the caller
    *must* manage memory.

    A simple pattern... Now, some libs can do it others are simply not
    designed that way.


    foo_alloc_req r = foo_query_alloc(&cfg);
    void *mem = aligned_alloc(r.align, r.size); /* once */

    for (int i = 0; i < n_jobs; ++i) {
    foo *f = foo_init(mem, r.size, &cfg); /* build in the same
    block */
    /* ... use f ... */
    foo_deinit(f); /* object ends, block
    stays ours */
    }

    free(mem); /* once, at the very end */

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 19:29:29 2026
    On 10/24/2026 3:43 AM, David Brown wrote:
    On 23/10/2026 18:57, Peter Flass wrote:
    On 10/23/26 02:45, David Brown wrote:
    On 23/10/2026 08:25, Lawrence D?Oliveiro wrote:
    On Thu, 22 Oct 2026 22:29:45 -0700, Chris M. Thomasson wrote:

    On 10/22/2026 8:19 PM, Lawrence D?Oliveiro wrote:

    On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:

    That's why I try to use PL/I AUTOMATIC (stack) storage and not
    allocate a lot of stuff. You need to have a disciplined approach >>>>>>> if you allocate random stuff here and there.

    What if you?re building an object that needs to be returned to the >>>>>> caller?

    Have the caller have the object before hand and call a function to
    initialize it?

    I?m assuming that all that BASIC programming hasn?t got to your head,
    and you?re not serious. ;)

    Chris' wording is perhaps poor, but the principle is right.

    I don't know PL/I or Fortran, but in C if you have :

    ˙˙˙˙˙typedef struct data_struct { int a; int xs[20]; } S ;

    ˙˙˙˙˙S build_some_data(void) {
    ˙˙˙˙˙˙˙˙ S s;

    ˙˙˙˙˙˙˙˙ s.a = 123;
    ˙˙˙˙˙˙˙˙ for (int i = 0; i < 20; i++) s.xs[i] = i;

    ˙˙˙˙˙˙˙˙ return s;
    ˙˙˙˙˙}

    ˙˙˙˙˙void foo() {
    ˙˙˙˙˙˙˙˙ S s = build_some_data();
    ˙˙˙˙˙}


    then it is typically handled as though you had written :

    ˙˙˙˙˙void build_some_data(S * p) {
    ˙˙˙˙˙˙˙˙ p->a = 123;
    ˙˙˙˙˙˙˙˙ for (int i = 0; i < 20; i++) p->xs[i] = i;

    ˙˙˙˙˙˙˙˙ return;
    ˙˙˙˙˙}

    ˙˙˙˙˙void foo() {
    ˙˙˙˙˙˙˙˙ S s;
    ˙˙˙˙˙˙˙˙ build_some_data(&s);
    ˙˙˙˙˙}


    That is - the caller creates the /space/ for the returned object, but
    does not do any kind of initialisation.˙ It passes a pointer to that
    space as a hidden parameter to the function that wants to return the
    object.

    That principle should work fine in any language, as long as the size
    of the returned object is known by the caller code.

    That last sentence is why it would not work fine,

    OK.˙ Knowing the size of the returned object is an absolute requirement
    for pre-allocation by the caller, and it is a requirement that is fine
    for a lot of situations and a lot of languages.˙ But if it is not the
    case for PL/I, Fortran, or any other particular language (or particular function in any language), then I fully agree - the object's space can't
    be handled by the caller.


    Use when the API provides it, or else, well, read the api learn and know
    how to use it. If it allows the caller to make the memory it needs, so
    be it, if not, who cares?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 19:57:22 2026
    On 10/24/2026 3:32 PM, Lawrence D?Oliveiro wrote:
    On Sat, 24 Oct 2026 13:27:30 -0700, Chris M. Thomasson wrote:

    Or what about miniaudio?s ma_engine_get_heap_size plus
    ma_engine_init_preallocated

    No idea about that, but the same principle would apply.

    You sound like you never worked with any of it before?????

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Oct 26 20:09:48 2026
    On 10/24/2026 3:32 PM, Lawrence D?Oliveiro wrote:
    On Sat, 24 Oct 2026 13:27:30 -0700, Chris M. Thomasson wrote:

    Or what about miniaudio?s ma_engine_get_heap_size plus
    ma_engine_init_preallocated

    No idea about that, but the same principle would apply.

    Sure you do, or what are you writing about anyway? Really?

    You seem like the oracle, right?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Dan Cross@3:633/10 to All on Tue Oct 27 10:40:00 2026
    In article <20261027102255.00006052@yahoo.com>,
    Michael S <already5chosen@yahoo.com> wrote:
    On Tue, 27 Oct 2026 09:06:26 +0100
    David Brown <david.brown@hesbynett.no> wrote:
    [snip]
    And there are languages like Erlang that divide everything into
    micro-processes, and use the same mechanisms for controlling and
    passing data around regardless of whether this little processes are
    in the same thread, or different threads, different OS processes, or
    different computers. That works because there are very narrow and
    tightly controlled mechanisms for sharing data.

    Note that these are both languages that run on a VM, not compiled
    languages.

    What you wrote about Erlang resembles MPI, which of course is readily >available for many compiled or jitted languages, including Fortran, C
    and C++.
    I tried to utilize MPI 20 years ago, but the thinking behind it is to >different from mine, so I ran away in horror.

    Erlang uses the "actor" model to represent concurrency; state is
    held by each actor, and actors communicate via message passing,
    potentially changing state in response to messages. This is a
    model for _concurrency_, in which multiple independent threads
    of execution are coordinated to some in a single system.

    One may think of MPI-style systems this way, but there's a
    subtle distinction. The typical use case for something like MPI
    is _parallel_ computation of a numerically intensive problem,
    where "neighbors" nodes need to occasionally share state; this
    is usually about _parallelism_; that is, simultaneity. While a
    concurrency primitive is _necessary_ to think about parallelism
    (and MPI can be used in that fashion), the two are distinct
    concepts that are often conflated. To paraphrase Rob Pike on
    it, concurrency is about dealing with multiple things at once,
    while parallelism is about doing lots of things at the same
    time.

    - Dan C.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From James Kuyper@3:633/10 to All on Tue Oct 27 11:00:08 2026
    On 2026-10-26 17:45, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:
    [restore snippage]>> On 2026-10-25 23:39, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:11:48 -0700, Chris M. Thomasson wrote:

    A caller provided buffer is normal with a lot of API's out there.

    No it isn?t. It?s not a good way to manage things, anyway: instead of
    solving the resource-allocation problem once and for all in the
    library API, you are pushing the burden onto all the client code, each
    one of which has to solve it for itself.

    That?s a dumb way to design things.

    HUH? How do you call say, fread without a user provided buffer?

    Relevance being?

    fread() uses a caller-provided buffer, which, according to your previous comment, "push[es] the burden onto all the client code, each one of
    which has to solve it for itself", so according to you, "That's a dumb
    way to design things"..If that isn't your actual opinion of fread(),
    your comments need to be at least a little more nuanced to avoid
    applying to fread().

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Scott Lurndal@3:633/10 to All on Tue Oct 27 15:03:45 2026
    cross@spitfire.i.gajendra.net (Dan Cross) writes:
    In article <20261027102255.00006052@yahoo.com>,
    Michael S <already5chosen@yahoo.com> wrote:
    On Tue, 27 Oct 2026 09:06:26 +0100
    David Brown <david.brown@hesbynett.no> wrote:
    [snip]
    And there are languages like Erlang that divide everything into
    micro-processes, and use the same mechanisms for controlling and
    passing data around regardless of whether this little processes are
    in the same thread, or different threads, different OS processes, or
    different computers. That works because there are very narrow and
    tightly controlled mechanisms for sharing data.

    Note that these are both languages that run on a VM, not compiled
    languages.

    What you wrote about Erlang resembles MPI, which of course is readily >>available for many compiled or jitted languages, including Fortran, C
    and C++.
    I tried to utilize MPI 20 years ago, but the thinking behind it is to >>different from mine, so I ran away in horror.

    Erlang uses the "actor" model to represent concurrency; state is
    held by each actor, and actors communicate via message passing,
    potentially changing state in response to messages. This is a
    model for _concurrency_, in which multiple independent threads
    of execution are coordinated to some in a single system.

    Chorus (the microkernel) worked in a similar fashion. The
    microkernel coordinated between actors using message passing.

    The actors implemented the higher level operating system
    functionality. The Amadeus project, for example, implemented
    a version of unix on top of the microkernel using message
    passing between actors (The Object manager handled files and
    filesystems, the Process actor handled the POSIX process
    and thread (SVR4.2ES/MP threads) interfaces including fork,
    and light-weight processes that implemented threads, and
    the Streams actor provide system V streams support and
    networking.

    Unisys released the OS as part of their massively parallel
    OPUS computer system.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Peter Flass@3:633/10 to All on Tue Oct 27 09:41:16 2026
    On 10/27/26 08:00, James Kuyper wrote:
    On 2026-10-26 17:45, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:
    [restore snippage]>> On 2026-10-25 23:39, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:11:48 -0700, Chris M. Thomasson wrote:

    A caller provided buffer is normal with a lot of API's out there.

    No it isn?t. It?s not a good way to manage things, anyway: instead of
    solving the resource-allocation problem once and for all in the
    library API, you are pushing the burden onto all the client code, each >>>> one of which has to solve it for itself.

    That?s a dumb way to design things.

    HUH? How do you call say, fread without a user provided buffer?

    Relevance being?

    fread() uses a caller-provided buffer, which, according to your previous comment, "push[es] the burden onto all the client code, each one of
    which has to solve it for itself", so according to you, "That's a dumb
    way to design things"..If that isn't your actual opinion of fread(),
    your comments need to be at least a little more nuanced to avoid
    applying to fread().

    The difference is that the size of the buffer for fread() is the maximum
    you want/expect to read. The size of an object is the size it is, not necessarily what you expect. If you don't provide enough space you will truncate.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Scott Lurndal@3:633/10 to All on Tue Oct 27 18:36:48 2026
    Peter Flass <Peter@Iron-Spring.com> writes:
    On 10/27/26 08:00, James Kuyper wrote:
    On 2026-10-26 17:45, Lawrence D?Oliveiro wrote:
    On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:
    [restore snippage]>> On 2026-10-25 23:39, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 19:11:48 -0700, Chris M. Thomasson wrote:

    A caller provided buffer is normal with a lot of API's out there.

    No it isn?t. It?s not a good way to manage things, anyway: instead of >>>>> solving the resource-allocation problem once and for all in the
    library API, you are pushing the burden onto all the client code, each >>>>> one of which has to solve it for itself.

    That?s a dumb way to design things.

    HUH? How do you call say, fread without a user provided buffer?

    Relevance being?

    fread() uses a caller-provided buffer, which, according to your previous
    comment, "push[es] the burden onto all the client code, each one of
    which has to solve it for itself", so according to you, "That's a dumb
    way to design things"..If that isn't your actual opinion of fread(),
    your comments need to be at least a little more nuanced to avoid
    applying to fread().

    The difference is that the size of the buffer for fread() is the maximum
    you want/expect to read. The size of an object is the size it is, not >necessarily what you expect. If you don't provide enough space you will >truncate.

    Which isn't a significant issue with fread, since the underlying stdio
    buffer (or kernel file cache or terminal driver buffer) will hold the
    unread information for the next call to fread.

    fread(3) is basically obsolete for most high-performance applications
    which map the file directly into the process address space (mmap).

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Tue Oct 27 22:22:12 2026
    On Tue, 27 Oct 2026 11:00:08 -0400, James Kuyper wrote:

    On 2026-10-26 17:45, Lawrence D?Oliveiro wrote:

    On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:

    On 2026-10-25 23:39, Lawrence D?Oliveiro wrote:

    On Sun, 25 Oct 2026 19:11:48 -0700, Chris M. Thomasson wrote:

    A caller provided buffer is normal with a lot of API's out there.

    No it isn?t. It?s not a good way to manage things, anyway:
    instead of solving the resource-allocation problem once and for
    all in the library API, you are pushing the burden onto all the
    client code, each one of which has to solve it for itself.

    That?s a dumb way to design things.

    HUH? How do you call say, fread without a user provided buffer?

    Relevance being?

    fread() uses a caller-provided buffer, which, according to your previous comment, "push[es] the burden onto all the client code, each one of
    which has to solve it for itself", so according to you, "That's a dumb
    way to design things"..

    Not even paying attention to what?s being said in the parts you
    quoted, never mind the parts you didn?t. Note my remark above about
    ?solving the resource allocation problem?; elsewhere I asked: ?What if
    you?re building an object that needs to be returned to the caller??

    Not clear yet what we?re talking about here? We?re not talking about
    random API calls, we?re talking about libraries that need to create
    and manage abstract objects that encapsulate the function they are
    providing!

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From James Kuyper@3:633/10 to All on Tue Oct 27 21:35:09 2026
    Thanks to my killfile, I don't see messages posted by Chris M.
    Thomasson, just other people's responses to them.

    On 2026-10-25 20:42, Lawrence D?Oliveiro wrote:
    On Sun, 25 Oct 2026 16:16:26 -0700, Chris M. Thomasson wrote:

    Even analogous, to say, an API that says read n bytes and store into
    buffer. Well, the caller has lifetime of said buffer. The caller makes
    the buffer, calls into the function.

    So how is the caller supposed to manage that memory?

    That's the oldest message I can find on this sub-thread, and also the
    very last message I can find preceding the one quoted below, and it's
    clearly describing an fread()-like interface, not a function that
    returns objects of sizes unknown to the caller. If the messages I don't
    see gave some other context to this sub-thread, I had no way of knowing
    about it.

    On 2026-10-27 18:22, Lawrence D?Oliveiro wrote:
    On Tue, 27 Oct 2026 11:00:08 -0400, James Kuyper wrote:

    On 2026-10-26 17:45, Lawrence D?Oliveiro wrote:

    On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:

    On 2026-10-25 23:39, Lawrence D?Oliveiro wrote:

    On Sun, 25 Oct 2026 19:11:48 -0700, Chris M. Thomasson wrote:

    A caller provided buffer is normal with a lot of API's out there.

    No it isn?t. It?s not a good way to manage things, anyway:
    instead of solving the resource-allocation problem once and for
    all in the library API, you are pushing the burden onto all the
    client code, each one of which has to solve it for itself.

    That?s a dumb way to design things.

    HUH? How do you call say, fread without a user provided buffer?

    Relevance being?

    fread() uses a caller-provided buffer, which, according to your previous
    comment, "push[es] the burden onto all the client code, each one of
    which has to solve it for itself", so according to you, "That's a dumb
    way to design things"..

    Not even paying attention to what?s being said in the parts you
    quoted, never mind the parts you didn?t. Note my remark above about
    ?solving the resource allocation problem?; elsewhere I asked: ?What if
    you?re building an object that needs to be returned to the caller??

    Yes, and without the context that applies elsewhere, your comment about resource allocation comes off as a non-sequitur.
    Not clear yet what we?re talking about here? We?re not talking about
    random API calls, we?re talking about libraries that need to create
    and manage abstract objects that encapsulate the function they are
    providing!

    I can find no mention of that topic anywhere on this sub-thread. It
    might be in the parts of Chris's messages that I didn't see and you
    didn't quote.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Wed Oct 28 01:43:55 2026
    On Tue, 27 Oct 2026 21:35:09 -0400, James Kuyper wrote:

    ... without the context that applies elsewhere, your comment about
    resource allocation comes off as a non-sequitur.

    That?s just an excuse. Other comments of mine, from further back in
    this particular line of this thread:

    * ?What if you?re building an object that needs to be returned to the
    caller??
    * ?The principle applies to Fortran as it does to any language where
    you have to explicitly manage storage allocations.?
    * ?If you have to do cleanup at each level before exiting, then it works
    perfectly well.?

    Did you notice any of that?

    From elsewhere in the discussion:

    I find the C code I write tends to do a lot of dynamic resource
    allocations. These can sometimes fail with errors. So error
    recovery will invariably involve cleaning up those parts of the
    allocations which already succeeded. Gotos are no good for this;
    you need to exit levels of structure nesting one by one, disposing
    of allocations as you go.

    I put together an example here
    <https://gitlab.com/ldo/a_structured_discipline_of_programming>.
    This is an extension module that offers services to Python code,
    because that is just about the worst example I could think of, for
    those who think gotos can cut it.

    Did you pay attention to any of that?

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From James Kuyper@3:633/10 to All on Tue Oct 27 22:18:54 2026
    On 2026-10-27 21:43, Lawrence D?Oliveiro wrote:
    On Tue, 27 Oct 2026 21:35:09 -0400, James Kuyper wrote:

    ... without the context that applies elsewhere, your comment about
    resource allocation comes off as a non-sequitur.

    That?s just an excuse. Other comments of mine, from further back in
    this particular line of this thread:

    * ?What if you?re building an object that needs to be returned to the
    caller??
    * ?The principle applies to Fortran as it does to any language where
    you have to explicitly manage storage allocations.?
    * ?If you have to do cleanup at each level before exiting, then it works
    perfectly well.?

    Did you notice any of that?
    No, none of those comments appear anywhere in this sub-thread as
    displayed by Thunderbird. How do they fit in to the sequence of messages
    that lead to this one? If they appeared in some other sub-thread, that's
    not relevant; the fact that something is being discussed in another
    sub-thread doesn't make it relevant to what's being discussed in this
    one. However, if those comments occur in Chris' text that I never saw,
    or in messages on this sub-thread that are prior to the earliest one I
    quoted, then they would be relevant.
    The references for the oldest message I quoted indicate that there were
    20 previous ones in that sub-thread, but they don't display as
    predecessors of that message. This is a common problem when I filter out
    all the messages posted by someone. If that person is a significant
    contributor to a particular thread, that thread gets chopped up into
    pieces and Thunderbird fails to notice that those pieces are related to
    each other.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Peter Flass@3:633/10 to All on Tue Oct 27 19:28:47 2026
    On 10/27/26 18:43, Lawrence D?Oliveiro wrote:
    On Tue, 27 Oct 2026 21:35:09 -0400, James Kuyper wrote:

    ... without the context that applies elsewhere, your comment about
    resource allocation comes off as a non-sequitur.

    That?s just an excuse. Other comments of mine, from further back in
    this particular line of this thread:

    * ?What if you?re building an object that needs to be returned to the
    caller??
    * ?The principle applies to Fortran as it does to any language where
    you have to explicitly manage storage allocations.?
    * ?If you have to do cleanup at each level before exiting, then it works
    perfectly well.?

    Did you notice any of that?

    From elsewhere in the discussion:

    I find the C code I write tends to do a lot of dynamic resource
    allocations. These can sometimes fail with errors. So error
    recovery will invariably involve cleaning up those parts of the
    allocations which already succeeded. Gotos are no good for this;
    you need to exit levels of structure nesting one by one, disposing
    of allocations as you go.

    I put together an example here
    <https://gitlab.com/ldo/a_structured_discipline_of_programming>.
    This is an extension module that offers services to Python code,
    because that is just about the worst example I could think of, for
    those who think gotos can cut it.

    Did you pay attention to any of that?

    You could keep track of the allocations in a list (or whatever) and then
    walk thru and clean them up at once.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)