• New VSI post on Youtube

    From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Mon Aug 12 22:53:57 2024
    Oracle and VMS Software on Application Development and Migration to x86:

    https://www.youtube.com/watch?v=BmLEI5O1JSw

    I have not seen & heard it all yet.

    Somewhere in the middle they summarize the status of the x86-64 port
    as: 8920 tests succeed + 271 tests fail + 608 test not run yet.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Wed Aug 14 10:03:28 2024
    On 8/12/2024 10:53 PM, Arne Vajhøj wrote:
    Oracle and VMS Software on Application Development and Migration to x86:

    https://www.youtube.com/watch?v=BmLEI5O1JSw

    I have not seen & heard it all yet.

    Somewhere in the middle they summarize the status of the x86-64 port
    as: 8920 tests succeed + 271 tests fail + 608 test not run yet.

    Did this get lost in all the spam filters?

    I guess a YouTube link does look like spam, but ...

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to arne@vajhoej.dk on Wed Aug 14 17:48:40 2024
    On 2024-08-14, Arne Vajhj <arne@vajhoej.dk> wrote:
    On 8/12/2024 10:53 PM, Arne Vajhj wrote:
    Oracle and VMS Software on Application Development and Migration to x86:

    https://www.youtube.com/watch?v=BmLEI5O1JSw

    I have not seen & heard it all yet.

    Somewhere in the middle they summarize the status of the x86-64 port
    as: 8920 tests succeed + 271 tests fail + 608 test not run yet.

    Did this get lost in all the spam filters?

    I guess a YouTube link does look like spam, but ...


    I did see this the first time around, but had nothing to say at the time.

    However, since you ask, I prefer a writeup rather than a 40 minute video
    for this kind of update, but based on the numbers above, they are making
    good progress but are not there yet.

    Based on the above, I would guess/hope early next year for them to be ready, which would put them a year behind schedule. It would be interesting to
    know the reasons for the failures however and what is different about the x86-64 environment that resulted in test differences that ended up being classified as failures.

    In total, there's about 10% of the tests which have not been done or have failed, but as we all know the first 90% of a project takes 90% of the
    time and the last 10% takes the other 90% of the time. :-)

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robert A. Brooks@21:1/5 to Simon Clubley on Wed Aug 14 14:07:02 2024
    On 8/14/2024 1:48 PM, Simon Clubley wrote:

    It would be interesting to
    know the reasons for the failures however and what is different about the x86-64 environment that resulted in test differences that ended up being classified as failures.

    I don't know specifically, but with my very limited experience with C++, the X86_64 compiler is much less accepting of the syntax that the Alpha and IA64 compilers
    accepted.

    Some of the changes are pretty mechanical (casting or simple refactoring); some are not.

    Don't ask me to describe the "some are not" part, because I'm getting help to deal wit
    those.

    For the tests failing, it may be due to code not yet working, but I don't have any inside knowledge there.


    --
    -- Rob

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Wed Aug 14 14:07:31 2024
    On 8/14/2024 1:48 PM, Simon Clubley wrote:
    On 2024-08-14, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 8/12/2024 10:53 PM, Arne Vajhøj wrote:
    Oracle and VMS Software on Application Development and Migration to x86: >>>
    https://www.youtube.com/watch?v=BmLEI5O1JSw

    I have not seen & heard it all yet.

    Somewhere in the middle they summarize the status of the x86-64 port
    as: 8920 tests succeed + 271 tests fail + 608 test not run yet.

    Did this get lost in all the spam filters?

    I guess a YouTube link does look like spam, but ...


    I did see this the first time around, but had nothing to say at the time.

    However, since you ask, I prefer a writeup rather than a 40 minute video
    for this kind of update, but based on the numbers above, they are making
    good progress but are not there yet.

    I 100% agree.

    There is a link to the slide decks on Youtube.

    Based on the above, I would guess/hope early next year for them to be ready, which would put them a year behind schedule. It would be interesting to
    know the reasons for the failures however and what is different about the x86-64 environment that resulted in test differences that ended up being classified as failures.

    In total, there's about 10% of the tests which have not been done or have failed, but as we all know the first 90% of a project takes 90% of the
    time and the last 10% takes the other 90% of the time. :-)

    Slide 39 says H1CY2025 so "early next year".

    The slides list some of the challenges they had.

    In my poor wording:
    * like everybody else they had to start with cross compilers
    and then switch to native compilers
    * they need to generate native code, so they needed to get
    GEM2LLVM and LLVM backends from VSI and integrate them
    * like everybody else they got problems with C++ code because
    clang is not compatible with traditional VMS C++
    * they relied on some tools build with VAX SCAN and first
    VESTed and later AESTed - since no IEST exist they had to
    rewrite those tools (in Java)

    The slides does not say so, but it is probably a huge code base
    and given that some of it is 4 decades old, then there may be some
    hacks in the code.

    Oracle DB - what is known as Oracle Classic in the VMS world:
    https://news.ycombinator.com/item?id=18442941

    :-)

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robert A. Brooks@21:1/5 to All on Wed Aug 14 14:45:17 2024
    On 8/14/2024 2:33 PM, Arne Vajhøj wrote:
    On 8/14/2024 2:07 PM, Robert A. Brooks wrote:

    Some of the changes are pretty mechanical (casting or simple refactoring); some are not.

    Don't ask me to describe the "some are not" part, because I'm getting help to deal wit
    those.

    Being more strict is just one thing.

    I also believe it is missing some of the VMS specific extensions.

    And it has different size of long and pointers. Causing problems
    for two cases:
    * code that make implicit assumptions that those are 32 bit

    /POINTER_SIZE = 32 is your friend. In my case, all the pointers
    were 32 bits long, so that was an easy thing to add to the build.

    This is for the OMNI and OSAP products for industrial control.

    --
    -- Rob

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Robert A. Brooks on Wed Aug 14 14:33:27 2024
    On 8/14/2024 2:07 PM, Robert A. Brooks wrote:
    On 8/14/2024 1:48 PM, Simon Clubley wrote:
    It would be interesting to
    know the reasons for the failures however and what is different about the
    x86-64 environment that resulted in test differences that ended up being
    classified as failures.

    I don't know specifically, but with my very limited experience with C++,
    the
    X86_64 compiler is much less accepting of the syntax that the Alpha and
    IA64 compilers
    accepted.

    Some of the changes are pretty mechanical (casting or simple
    refactoring); some are not.

    Don't ask me to describe the "some are not" part, because I'm getting
    help to deal wit
    those.

    Being more strict is just one thing.

    I also believe it is missing some of the VMS specific extensions.

    And it has different size of long and pointers. Causing problems
    for two cases:
    * code that make implicit assumptions that those are 32 bit
    * mixing C and C++

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Robert A. Brooks on Wed Aug 14 14:57:02 2024
    On 8/14/2024 2:45 PM, Robert A. Brooks wrote:
    On 8/14/2024 2:33 PM, Arne Vajhøj wrote:
    And it has different size of long and pointers. Causing problems
    for two cases:
    * code that make implicit assumptions that those are 32 bit

    /POINTER_SIZE = 32 is your friend.  In my case, all the pointers
    were 32 bits long, so that was an easy thing to add to the build.

    compile/POINTER_SIZE=32, LINK/SEG=CODE=P0 etc. can all help get stuff
    working.

    But it is not the right long term solution.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Wed Aug 14 14:48:04 2024
    On 8/14/2024 2:33 PM, Arne Vajhøj wrote:
    And it has different size of long and pointers. Causing problems
    for two cases:
    * code that make implicit assumptions that those are 32 bit
    * mixing C and C++

    I am getting more and more convinced that C and C++
    code should completely switch to the explicit length
    model.

    So:

    #include <stdint.h>

    or:

    #include <cstdint>

    and use:

    int8_t
    int16_t
    int32_t
    int64_t
    uint8_t
    uint16_t
    uint32_t
    uint64_t

    and consider putting:

    #define int ">>>> DO NOT USE INT <<<<"
    #define short ">>>> DO NOT USE SHORT <<<<"
    #define long ">>>> DO NOT USE LONG <<<<"

    in as well to enforce.

    Where did I put that asbestos suit to protect me
    from the C/C++ crowd?

    :-)

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robert A. Brooks@21:1/5 to All on Wed Aug 14 15:49:28 2024
    On 8/14/2024 2:57 PM, Arne Vajhøj wrote:

    compile/POINTER_SIZE=32, LINK/SEG=CODE=P0 etc. can all help get stuff working.

    But it is not the right long term solution.

    For C++, the default pointer size should have remained 32.
    It was a mistake to change the default from what it was on Alpha and IA64.

    There is a lot of VMS-developed C++ code that expects a pointer size of 32,
    so in the case I cited, that compilation qualifer will remain forever, because the code will not change.

    --
    -- Rob

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Wed Aug 14 16:23:47 2024
    On 8/14/2024 2:33 PM, Arne Vajhøj wrote:
    And it has different size of long and pointers. Causing problems
    for two cases:
    * code that make implicit assumptions that those are 32 bit
    * mixing C and C++

    And in case someone has not seen it:

    $ type long.h
    #ifdef __cplusplus
    extern "C" {
    #endif

    struct data
    {
    long a;
    long b;
    long c;
    long d;
    };

    #ifdef __cplusplus
    }
    #endif
    $ type long1.cxx
    #include "long.h"

    extern "C" {
    void f(struct data *d);
    }

    int main()
    {
    struct data o;
    o.a = 1;
    o.b = 2;
    o.c = 3;
    o.d = 4;
    f(&o);
    return 0;
    }
    $ type long2.c
    #include <stdio.h>

    #include "long.h"

    void f(struct data *o)
    {
    printf("%ld %ld %ld %ld\n", o->a, o->b, o->c, o->d);
    }
    $ cxx/name=upper long1
    $ cc long2
    $ link/exe=long long1 + long2
    $ run long
    1 0 2 0

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Robert A. Brooks on Wed Aug 14 16:21:39 2024
    On 8/14/2024 3:49 PM, Robert A. Brooks wrote:
    On 8/14/2024 2:57 PM, Arne Vajhøj wrote:
    compile/POINTER_SIZE=32, LINK/SEG=CODE=P0 etc. can all help get stuff
    working.

    But it is not the right long term solution.

    For C++, the default pointer size should have remained 32.
    It was a mistake to change the default from what it was on Alpha and IA64.

    Given how much C vs C++ issues we have seen, then I think there
    is a case for that.

    But as I understand it the plan was to keep C++ very close to out of
    the box clang.

    In hindsight ...

    There is a lot of VMS-developed C++ code that expects a pointer size of 32,

    I believe that.

    so in the case I cited, that compilation qualifer will remain forever, because
    the code will not change.

    Unless the system in question has EOL and replacement planned, then
    I doubt that.

    Everything eventually change or die.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Wed Aug 14 19:18:11 2024
    On 8/14/2024 4:23 PM, Arne Vajhøj wrote:
    On 8/14/2024 2:33 PM, Arne Vajhøj wrote:
    And it has different size of long and pointers. Causing problems
    for two cases:
    * code that make implicit assumptions that those are 32 bit
    * mixing C and C++

    And in case someone has not seen it:

    $ type long.h

    And the same with pointers:

    $ type ptr.h
    #ifdef __cplusplus
    extern "C" {
    #endif

    struct data
    {
    void* a;
    void* b;
    void* c;
    void* d;
    };

    #ifdef __cplusplus
    }
    #endif
    $ type ptr1.cxx
    #include "ptr.h"

    extern "C" {
    void f(struct data *d);
    }

    int main()
    {
    struct data o;
    o.a = (void *)1;
    o.b = (void *)2;
    o.c = (void *)3;
    o.d = (void *)4;
    f(&o);
    return 0;
    }
    $ type ptr2.c
    #include <stdio.h>

    #include "ptr.h"

    void f(struct data *o)
    {
    printf("%p %p %p %p\n", o->a, o->b, o->c, o->d);
    }
    $ cxx/name=upper ptr1
    $ cc ptr2
    $ link/exe=ptr ptr1 + ptr2
    $ run ptr
    1 0 2 0
    $ cxx/name=upper/pointer=32 ptr1
    $ cc ptr2
    $ link/exe=ptr ptr1 + ptr2
    $ run ptr
    1 2 3 4
    $ cxx/name=upper ptr1
    $ cc/pointer=64 ptr2
    $ link/exe=ptr ptr1 + ptr2
    $ run ptr
    1 2 3 4

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Wed Aug 14 19:58:30 2024
    On 8/14/2024 7:47 PM, Lawrence D'Oliveiro wrote:
    On Wed, 14 Aug 2024 14:33:27 -0400, Arne Vajhøj wrote:
    And it has different size of long and pointers.

    If you wanted an integer type that is compatible with pointers, that was always intptr_t and uintptr_t, surely


    I am not being particular clear.

    I am not saying that:

    default sizeof long C++ x64 <> default sizeof pointer C++ x64

    I am saying that:

    default sizeof long C++ x64 <> default sizeof long C++ Itanium & Alpha
    default sizeof pointer C++ x64 <> default sizeof pointer C++ Itanium & Alpha

    and later:

    default sizeof long C++ x64 <> default sizeof long C x64
    default sizeof pointer C++ x64 <> default sizeof pointer C x64

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Thu Aug 15 00:07:41 2024
    On Wed, 14 Aug 2024 19:58:30 -0400, Arne Vajhøj wrote:

    I am saying that:

    default sizeof long C++ x64 <> default sizeof long C++ Itanium & Alpha default sizeof pointer C++ x64 <> default sizeof pointer C++ Itanium &
    Alpha

    and later:

    default sizeof long C++ x64 <> default sizeof long C x64

    This is why you have stdint.h.

    default sizeof pointer C++ x64 <> default sizeof pointer C x64

    Interesting ... is C++ always supposed to be ABI-compatible with C?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Wed Aug 14 23:47:06 2024
    On Wed, 14 Aug 2024 14:33:27 -0400, Arne Vajhøj wrote:

    And it has different size of long and pointers.

    If you wanted an integer type that is compatible with pointers, that was
    always intptr_t and uintptr_t, surely

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Wed Aug 14 20:24:04 2024
    On 8/14/2024 8:07 PM, Lawrence D'Oliveiro wrote:
    On Wed, 14 Aug 2024 19:58:30 -0400, Arne Vajhøj wrote:
    I am saying that:

    default sizeof long C++ x64 <> default sizeof long C++ Itanium & Alpha
    default sizeof pointer C++ x64 <> default sizeof pointer C++ Itanium &
    Alpha

    and later:

    default sizeof long C++ x64 <> default sizeof long C x64

    This is why you have stdint.h.

    Yes.

    But short/int/long/long long are unfortunately very common in C/C++
    code probably an order of magnitude larger than
    int8_t/int16_t/int32_t/int64_t.

    default sizeof pointer C++ x64 <> default sizeof pointer C x64

    Interesting ... is C++ always supposed to be ABI-compatible with C?

    I don't think there is any guarantee for such compatibility. Two
    different compilers are free to behave differently.

    But they were compatible on Alpha and Itanium.

    And I think C++ and C compilers of same origin are usually compatible
    on other platforms as well.

    It is practical. C++ code calling C code is quite common.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Hoffman@21:1/5 to Robert A. Brooks on Wed Aug 14 20:35:07 2024
    On 2024-08-14 19:49:28 +0000, Robert A. Brooks said:

    On 8/14/2024 2:57 PM, Arne Vajhj wrote:

    compile/POINTER_SIZE=32, LINK/SEG=CODE=P0 etc. can all help get stuff working.

    But it is not the right long term solution.
    For C++, the default pointer size should have remained 32.
    It was a mistake to change the default from what it was on Alpha and IA64.

    It was a mistake to use 32 and not 64 on Alpha and Itanium, but that
    pain will continue for the foreseeable future.


    --
    Pure Personal Opinion | HoffmanLabs LLC

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Hoffman@21:1/5 to All on Wed Aug 14 20:34:01 2024
    On 2024-08-14 18:48:04 +0000, Arne Vajhj said:

    On 8/14/2024 2:33 PM, Arne Vajhj wrote:
    And it has different size of long and pointers. Causing problems
    for two cases:
    * code that make implicit assumptions that those are 32 bit
    * mixing C and C++

    I am getting more and more convinced that C and C++ code should
    completely switch to the explicit length model.
    ...
    Where did I put that asbestos suit to protect me from the C/C++ crowd?

    :-)

    Arne

    I'd have no issues with that.

    Don't forget [u]int_{fast,least}{n}_t available in C99 and later, too.

    That, and add deprecation warnings for the problem calls.

    One bunch has the deprecation warnings enabled by default, with _CRT_SECURE_NO_WARNINGS to disable those checks.

    Related (and eventually probably more accessible on OpenVMS x86-64) is clang-tidy: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/unsafe-functions.html


    Semi-related to interoperating with C: https://ziglang.org/learn/why_zig_rust_d_cpp/

    Semi-related to Rdb: What is "large" to SQLite is quite possibly very
    much larger than OpenVMS and its apps.

    But given forty years of existing code in Rdb (and in OpenVMS),
    wholesale language migrations just aren't happening ever, and any
    incremental migrations, and refactoring and overhauls, are going to
    happen over decades at the fastest.



    --
    Pure Personal Opinion | HoffmanLabs LLC

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Craig A. Berry@21:1/5 to Stephen Hoffman on Wed Aug 14 20:26:00 2024
    On 8/14/24 7:35 PM, Stephen Hoffman wrote:
    On 2024-08-14 19:49:28 +0000, Robert A. Brooks said:

    On 8/14/2024 2:57 PM, Arne Vajhøj wrote:

    compile/POINTER_SIZE=32, LINK/SEG=CODE=P0 etc. can all help get stuff
    working.

    But it is not the right long term solution.
      For C++, the default pointer size should have remained 32.
    It was a mistake to change the default from what it was on Alpha and
    IA64.

    It was a mistake to use 32 and not 64 on Alpha and Itanium, but that
    pain will continue for the foreseeable future.

    It is past time to change the default. I suspect a lot of the
    difficulties in porting are not just from pointer sizes but also integer
    sizes. Specifying "long" because the docs for an API say to use a
    longword is a 40-year-old habit that will be hard to break, and not all
    of the APIs have 64-bit equivalents. A lot of things probably assume
    "long" is the same size as "int" even though that is now no longer the
    case. As far as I know there is no compiler switch to say
    /DATA_MODEL=ILP32 to override the new default of LP64.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Dallman@21:1/5 to Robert A. Brooks on Thu Aug 15 09:41:00 2024
    In article <v9iro6$fql6$1@dont-email.me>, FIRST.LAST@vmssoftware.com
    (Robert A. Brooks) wrote:

    I don't know specifically, but with my very limited experience with
    C++, the X86_64 compiler is much less accepting of the syntax that
    the Alpha and IA64 compilers accepted.

    C++ compilers have been getting pickier over the last couple of decades gradually. Programmers who have been using a succession of Microsoft or
    GCC versions over that time have made the changes incrementally, but
    doing them all at once would be a bit of a shock.

    John

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to arne@vajhoej.dk on Thu Aug 15 12:34:22 2024
    On 2024-08-14, Arne Vajhj <arne@vajhoej.dk> wrote:
    On 8/14/2024 2:33 PM, Arne Vajhj wrote:
    And it has different size of long and pointers. Causing problems
    for two cases:
    * code that make implicit assumptions that those are 32 bit
    * mixing C and C++

    I am getting more and more convinced that C and C++
    code should completely switch to the explicit length
    model.

    So:

    #include <stdint.h>

    or:

    #include <cstdint>

    and use:

    int8_t
    int16_t
    int32_t
    int64_t
    uint8_t
    uint16_t
    uint32_t
    uint64_t

    and consider putting:

    #define int ">>>> DO NOT USE INT <<<<"
    #define short ">>>> DO NOT USE SHORT <<<<"
    #define long ">>>> DO NOT USE LONG <<<<"

    in as well to enforce.

    Where did I put that asbestos suit to protect me
    from the C/C++ crowd?


    That works great until you need to interface to the OS unfortunately.

    BTW, I've been writing my own code with explicit sizing for many years.

    To extend this, I also know the difference between signed and unsigned variables and I have a default-unsigned approach unless I absolutely
    _need_ a signed variable.

    Unfortunately, a lot of the material out there doesn't seem to understand
    that designing a program is about modelling a real-world problem and that
    it isn't OK to just use a signed integer to store an unsigned value.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to John Dallman on Thu Aug 15 08:24:39 2024
    On 8/15/2024 4:41 AM, John Dallman wrote:
    In article <v9iro6$fql6$1@dont-email.me>, FIRST.LAST@vmssoftware.com
    (Robert A. Brooks) wrote:
    I don't know specifically, but with my very limited experience with
    C++, the X86_64 compiler is much less accepting of the syntax that
    the Alpha and IA64 compilers accepted.

    C++ compilers have been getting pickier over the last couple of decades gradually. Programmers who have been using a succession of Microsoft or
    GCC versions over that time have made the changes incrementally, but
    doing them all at once would be a bit of a shock.

    Why do I think of:

    VAX C 3.x -> DEC C 4.x -> DEC C 5.x

    back in the 90's?

    :-)

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to arne@vajhoej.dk on Thu Aug 15 12:38:28 2024
    On 2024-08-15, Arne Vajhj <arne@vajhoej.dk> wrote:
    On 8/15/2024 4:41 AM, John Dallman wrote:
    In article <v9iro6$fql6$1@dont-email.me>, FIRST.LAST@vmssoftware.com
    (Robert A. Brooks) wrote:
    I don't know specifically, but with my very limited experience with
    C++, the X86_64 compiler is much less accepting of the syntax that
    the Alpha and IA64 compilers accepted.

    C++ compilers have been getting pickier over the last couple of decades
    gradually. Programmers who have been using a succession of Microsoft or
    GCC versions over that time have made the changes incrementally, but
    doing them all at once would be a bit of a shock.

    Why do I think of:

    VAX C 3.x -> DEC C 4.x -> DEC C 5.x

    back in the 90's?

    :-)


    Why do I think of John having to support /STANDARD=VAXC in 2024 ? :-)

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Thu Aug 15 10:00:26 2024
    On 8/15/2024 8:34 AM, Simon Clubley wrote:
    On 2024-08-14, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 8/14/2024 2:33 PM, Arne Vajhøj wrote:
    And it has different size of long and pointers. Causing problems
    for two cases:
    * code that make implicit assumptions that those are 32 bit
    * mixing C and C++

    I am getting more and more convinced that C and C++
    code should completely switch to the explicit length
    model.

    That works great until you need to interface to the OS unfortunately.

    Encapsulate and handle the conversion between stdint API and
    various CRTL/OS API's.

    Do test builds on all sorts of platforms with high warning level to
    see if someone went unnoticed.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Thu Aug 15 23:57:42 2024
    On Wed, 14 Aug 2024 14:07:31 -0400, Arne Vajhøj wrote:

    However, since you ask, I prefer a writeup rather than a 40 minute
    video for this kind of update ...

    I 100% agree.

    Have you tried playing the video at a higher speed, to get through it
    quicker?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to Lawrence D'Oliveiro on Fri Aug 16 12:07:02 2024
    On 2024-08-15, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Wed, 14 Aug 2024 14:07:31 -0400, Arne Vajhj wrote:

    However, since you ask, I prefer a writeup rather than a 40 minute
    video for this kind of update ...

    I 100% agree.

    Have you tried playing the video at a higher speed, to get through it quicker?

    That's a hack, not a solution (and there are severe limits to how much incremental time you can save with this approach).

    Written material is a far better solution in this situation.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Hoffman@21:1/5 to Craig A. Berry on Fri Aug 16 12:11:16 2024
    On 2024-08-15 01:26:00 +0000, Craig A. Berry said:

    On 8/14/24 7:35 PM, Stephen Hoffman wrote:
    On 2024-08-14 19:49:28 +0000, Robert A. Brooks said:

    On 8/14/2024 2:57 PM, Arne Vajhj wrote:

    compile/POINTER_SIZE=32, LINK/SEG=CODE=P0 etc. can all help get stuff working.

    But it is not the right long term solution.
    For C++, the default pointer size should have remained 32.
    It was a mistake to change the default from what it was on Alpha and IA64. >>
    It was a mistake to use 32 and not 64 on Alpha and Itanium, but that
    pain will continue for the foreseeable future.

    It is past time to change the default. I suspect a lot of the
    difficulties in porting are not just from pointer sizes but also
    integer sizes. Specifying "long" because the docs for an API say to
    use a longword is a 40-year-old habit that will be hard to break, and
    not all of the APIs have 64-bit equivalents. A lot of things probably
    assume "long" is the same size as "int" even though that is now no
    longer the case. As far as I know there is no compiler switch to say /DATA_MODEL=ILP32 to override the new default of LP64.


    In the approaches available to apps likely to be ported, cranking up
    the compiler diagnostics settings can find a whole lot of latent bad.
    This even if there isn't an app port in the immediate future.

    Expect that anybody providing maintenance or porting estimates will
    likely increase those estimates for each instance of /VAXC located, for instance.

    The 32-/64-bit addressing design was the right decision at the time.

    That the design worked as well as it's done, and allowed code
    coexistence was and is valuable.

    But we're most of 30 years past Eagle/Theta/V7.0.

    Different times. Different tradeoffs. Different hardware. Different expectations.

    Developers have been adding to the complexity here with new work, too.
    Which isn't a good place.

    If the existing API morass ever gets resolved, flat 64-bit would be preferred.

    Because the whole what-does-it-return and which-call-can-I-use and the size_t/ptrdiff_t mess we ended up with from Eagle/Theta/V7.0 is, well,
    a mess.

    Yes, that means dragging some apps forward. And dragging systen APIs forward.

    It also means an opportunity to age out and deprecate the most
    problematic of the old APIs.

    And it means leaving the old stuff building and running in 32-bit and 32-/64-bit legacy-compatibility mode and for the foreseeable future.

    But any replacement really needs to be further forward than flat 64-bit
    using previous-millennium API designs and coding practices.

    Which gets into discussions of compiler and API overhauls and other
    topics for new 64-bit code.

    As for itemlists and descriptors. Good ideas ~40 years ago. Now, not so much.

    To be absolutely clear, the existing 32-/64-bit morass would have to
    continue in parallel with the 64-bit environment for a decade or so.

    All of which have been discussed before.

    VSI have far larger projects. Which means this "pain will continue for
    the foreseeable future".

    And some perspective: we're a decade farther from Eagle/Theta/V7.0 now
    than Eagle/Theta/V7.0 was from VAX/VMS V1.0.



    --
    Pure Personal Opinion | HoffmanLabs LLC

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to Simon Clubley on Fri Aug 16 13:16:00 2024
    On 8/16/2024 8:07 AM, Simon Clubley wrote:
    On 2024-08-15, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Wed, 14 Aug 2024 14:07:31 -0400, Arne Vajhøj wrote:

    However, since you ask, I prefer a writeup rather than a 40 minute
    video for this kind of update ...

    I 100% agree.

    Have you tried playing the video at a higher speed, to get through it
    quicker?

    That's a hack, not a solution (and there are severe limits to how much incremental time you can save with this approach).

    Written material is a far better solution in this situation.

    Simon.


    People can process written material at their own chosen speed ...

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to bill on Fri Aug 16 14:56:56 2024
    On 8/16/2024 2:52 PM, bill wrote:
    On 8/16/2024 1:16 PM, Dave Froble wrote:
    On 8/16/2024 8:07 AM, Simon Clubley wrote:
    On 2024-08-15, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Wed, 14 Aug 2024 14:07:31 -0400, Arne Vajhøj wrote:

    However, since you ask, I prefer a writeup rather than a 40 minute >>>>>> video for this kind of update ...

    I 100% agree.

    Have you tried playing the video at a higher speed, to get through it
    quicker?

    That's a hack, not a solution (and there are severe limits to how much
    incremental time you can save with this approach).

    Written material is a far better solution in this situation.

    People can process written material at their own chosen speed ...

    More importantly, how are all you people accessing YouTube under VMS?

    I doubt that any of the very old browsers available for VMS support
    the required JavaScript and video format.

    But the common PC with Windows/Linux/macOS should be able to do it.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Dallman@21:1/5 to Robert A. Brooks on Fri Aug 16 21:38:00 2024
    In article <v9j1o8$fql6$3@dont-email.me>, FIRST.LAST@vmssoftware.com
    (Robert A. Brooks) wrote:

    There is a lot of VMS-developed C++ code that expects a pointer
    size of 32, so in the case I cited, that compilation qualifer
    will remain forever, because the code will not change.

    Presumably, most of the open source ported to VMS uses 32-bit pointers?

    John

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to John Dallman on Fri Aug 16 17:17:09 2024
    On 8/16/2024 4:38 PM, John Dallman wrote:
    In article <v9j1o8$fql6$3@dont-email.me>, FIRST.LAST@vmssoftware.com
    (Robert A. Brooks) wrote:
    There is a lot of VMS-developed C++ code that expects a pointer
    size of 32, so in the case I cited, that compilation qualifer
    will remain forever, because the code will not change.

    Presumably, most of the open source ported to VMS uses 32-bit pointers?

    My guess would be that most C++ open source comes from the Linux
    world and is mostly tested with 64 bit pointers.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Sat Aug 17 01:06:20 2024
    On Fri, 16 Aug 2024 17:17:09 -0400, Arne Vajhøj wrote:

    My guess would be that most C++ open source comes from the Linux world
    and is mostly tested with 64 bit pointers.

    A lot of open source is still compatible with both 32-bit and 64-bit
    platforms. Debian, for example, is still available in 32-bit form, and has
    been going through a conversion to 64-bit time_t to avoid the upcoming year-2038 problem.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Stephen Hoffman on Sat Aug 17 01:06:51 2024
    On Fri, 16 Aug 2024 12:11:16 -0400, Stephen Hoffman wrote:

    Yes, that means dragging some apps forward. And dragging systen APIs forward.

    Reinventing POSIX?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Craig A. Berry@21:1/5 to John Dallman on Fri Aug 16 20:22:08 2024
    On 8/16/24 3:38 PM, John Dallman wrote:
    In article <v9j1o8$fql6$3@dont-email.me>, FIRST.LAST@vmssoftware.com
    (Robert A. Brooks) wrote:

    There is a lot of VMS-developed C++ code that expects a pointer
    size of 32, so in the case I cited, that compilation qualifer
    will remain forever, because the code will not change.

    Presumably, most of the open source ported to VMS uses 32-bit pointers?

    Yes, but very little of it is written in C++. Mark Berryman has been
    wrestling with mariadb and xpdf as reported on the VSI forum, but most
    of what has been ported before is just C, not C++.

    I suspect most of the C++ on VMS has been customer code.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Craig A. Berry@21:1/5 to Lawrence D'Oliveiro on Fri Aug 16 20:29:40 2024
    On 8/16/24 8:06 PM, Lawrence D'Oliveiro wrote:
    On Fri, 16 Aug 2024 12:11:16 -0400, Stephen Hoffman wrote:

    Yes, that means dragging some apps forward. And dragging systen APIs
    forward.

    Reinventing POSIX?

    POSIX is just an API. If you have to worry about whether it's a
    "system" API or not, then you're in an environment that doesn't conform
    to the POSIX standard.

    And on VMS dragging system APIs forward just means that calls like
    SYS$FILESCAN have 64-bit as well as 32-bit versions, as many other
    system calls already do.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Craig A. Berry on Sat Aug 17 02:44:32 2024
    On Fri, 16 Aug 2024 20:29:40 -0500, Craig A. Berry wrote:

    On 8/16/24 8:06 PM, Lawrence D'Oliveiro wrote:

    On Fri, 16 Aug 2024 12:11:16 -0400, Stephen Hoffman wrote:

    Yes, that means dragging some apps forward. And dragging systen APIs
    forward.

    Reinventing POSIX?

    POSIX is just an API.

    It was an API that was careful to define higher-level types like “time_t” and “uintptr_t” and “size_t”, precisely because the *nix systems were at
    the forefront of the 64-bit transition and they had to be prepared.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Sat Aug 17 20:12:09 2024
    On 8/16/2024 10:44 PM, Lawrence D'Oliveiro wrote:
    On Fri, 16 Aug 2024 20:29:40 -0500, Craig A. Berry wrote:
    On 8/16/24 8:06 PM, Lawrence D'Oliveiro wrote:
    On Fri, 16 Aug 2024 12:11:16 -0400, Stephen Hoffman wrote:
    Yes, that means dragging some apps forward. And dragging systen APIs
    forward.

    Reinventing POSIX?

    POSIX is just an API.

    It was an API that was careful to define higher-level types like “time_t” and “uintptr_t” and “size_t”, precisely because the *nix systems were at
    the forefront of the 64-bit transition and they had to be prepared.

    Those implementation specific types was sort of best try back
    in the 90's.

    The approach has been mostly abandoned in newer languages. Today
    standard defined types are usually preferred. And does an API need
    a new type, then it means a new function/method/property.

    Too many problems with those implementation specific types. They
    often work great for small/medium size but run into problems with
    big/huge stuff. The combination of:
    - a need to convert between those implementation specific types
    and something of well defined type (persistence, network, mix
    other languages or something else)
    - the fact that C typedefs are not real types but just type aliases
    can end up in serious headache.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Sun Aug 18 00:34:29 2024
    On Sat, 17 Aug 2024 20:12:09 -0400, Arne Vajhøj wrote:

    On 8/16/2024 10:44 PM, Lawrence D'Oliveiro wrote:

    [POSIX] was an API that was careful to define higher-level types like
    “time_t” and “uintptr_t” and “size_t”, precisely because the *nix
    systems were at the forefront of the 64-bit transition and they had to
    be prepared.

    Those implementation specific types was sort of best try back in the
    90's.

    The approach has been mostly abandoned in newer languages.

    We still use them. POSIX is still the dominant OS paradigm, the basis for essentially all open-source software. Proprietary platforms like Windows
    and VMS are measured by how POSIX-conformant they are. Which you can see
    by the complexity of the special cases in the build scripts in that open- source software, when trying to bring it up on those proprietary
    platforms.

    Actually, it’s more proper to say “Linux” rather than “POSIX”. POSIX itself has become just a small part of what’s needed.

    Today standard defined types are usually preferred.

    We still have both 32-bit and 64-bit platforms. Such generic types ease
    the job of porting software between both.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to bill on Sat Aug 17 21:59:26 2024
    On 8/17/2024 5:09 PM, bill wrote:
    On 8/16/2024 2:56 PM, Arne Vajhøj wrote:
    On 8/16/2024 2:52 PM, bill wrote:
    On 8/16/2024 1:16 PM, Dave Froble wrote:
    On 8/16/2024 8:07 AM, Simon Clubley wrote:
    On 2024-08-15, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Wed, 14 Aug 2024 14:07:31 -0400, Arne Vajhøj wrote:

    However, since you ask, I prefer a writeup rather than a 40 minute >>>>>>>> video for this kind of update ...

    I 100% agree.

    Have you tried playing the video at a higher speed, to get through it >>>>>> quicker?

    That's a hack, not a solution (and there are severe limits to how much >>>>> incremental time you can save with this approach).

    Written material is a far better solution in this situation.

    People can process written material at their own chosen speed ...

    More importantly, how are all you people accessing YouTube under VMS?

    I doubt that any of the very old browsers available for VMS support
    the required JavaScript and video format.

    But the common PC with Windows/Linux/macOS should be able to do it.


    But that's not VMS.... :-)

    bill



    Well, one could argue that paper and ink are also "not VMS" ...

    VMS is the OS ...
    Documentation is, well, whatever it is ...

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael Kraemer@21:1/5 to Dave Froble on Sun Aug 18 12:05:56 2024
    On 18.08.2024 03:59, Dave Froble wrote:


    Well, one could argue that paper and ink are also "not VMS" ...

    VMS is the OS ...
    Documentation is, well, whatever it is ...


    well, one could argue that a real OS should not depend on another one to
    be fully functional.
    At least it should be able to present its own documentation.
    In this context, paper and ink are agnostic.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Michael Kraemer on Sun Aug 18 09:03:37 2024
    On 8/18/2024 6:05 AM, Michael Kraemer wrote:
    On 18.08.2024 03:59, Dave Froble wrote:
    Well, one could argue that paper and ink are also "not VMS" ...

    VMS is the OS ...
    Documentation is, well, whatever it is ...

    well, one could argue that a real OS should not depend on another one to
    be fully functional.
    At least it should be able to present its own documentation.
    In this context, paper and ink are agnostic.

    Maybe the concept "OS" is too general here.

    I would expect a "client OS" to be able to display
    HTML, PDF, video etc..

    I would expect a "server OS" to be able to serve
    that content to clients.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Sun Aug 18 21:35:03 2024
    On Sun, 18 Aug 2024 09:03:37 -0400, Arne Vajhøj wrote:

    I would expect a "client OS" to be able to display HTML, PDF, video
    etc..

    I would expect a "server OS" to be able to serve that content to
    clients.

    What kind of OS is it that has both “client” and “server” capabilities in
    one?

    We call that a “workstation”.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Mon Aug 19 00:46:30 2024
    On Sun, 18 Aug 2024 20:30:59 -0400, Arne Vajhøj wrote:

    On 8/18/2024 5:35 PM, Lawrence D'Oliveiro wrote:

    On Sun, 18 Aug 2024 09:03:37 -0400, Arne Vajhøj wrote:

    I would expect a "client OS" to be able to display HTML, PDF, video
    etc..

    I would expect a "server OS" to be able to serve that content to
    clients.

    What kind of OS is it that has both “client” and “server” capabilities
    in one?

    We call that a “workstation”.

    I think it would be more accurate to say "We called that a ...".

    25-40 years ago there were workstations running VMS, SunOS, Solaris,
    HP-UX, AIX, Ultrix, Tru64 etc..

    Today a workstations is just a marketing term for a high-end PC running Windows or Linux.

    Linux is the one that still offers the full “workstation” capabilities. Microsoft called their desktop version of NT “Workstation”, but all its server-like capabilities were carefully crippled to avoid cannibalizing
    sales of its actual servers.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Sun Aug 18 20:30:59 2024
    On 8/18/2024 5:35 PM, Lawrence D'Oliveiro wrote:
    On Sun, 18 Aug 2024 09:03:37 -0400, Arne Vajhøj wrote:
    I would expect a "client OS" to be able to display HTML, PDF, video
    etc..

    I would expect a "server OS" to be able to serve that content to
    clients.

    What kind of OS is it that has both “client” and “server” capabilities in
    one?

    We call that a “workstation”.

    I think it would be more accurate to say "We called that a ...".

    25-40 years ago there were workstations running VMS, SunOS, Solaris,
    HP-UX, AIX, Ultrix, Tru64 etc..

    Today a workstations is just a marketing term for a high-end
    PC running Windows or Linux.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Sun Aug 18 21:17:00 2024
    On 8/18/2024 8:46 PM, Lawrence D'Oliveiro wrote:
    On Sun, 18 Aug 2024 20:30:59 -0400, Arne Vajhøj wrote:
    25-40 years ago there were workstations running VMS, SunOS, Solaris,
    HP-UX, AIX, Ultrix, Tru64 etc..

    Today a workstations is just a marketing term for a high-end PC running
    Windows or Linux.

    Linux is the one that still offers the full “workstation” capabilities. Microsoft called their desktop version of NT “Workstation”, but all its server-like capabilities were carefully crippled to avoid cannibalizing
    sales of its actual servers.

    Most (commercial) Linux distros comes with a "server" version and a
    "desktop" version.

    Redhat has a "workstation" version, but it is really a desktop version.

    I don't think there is much difference in how Linux vendors and
    Microsoft position server and desktop products.

    There probably is a difference in how server applications
    act. Some Windows server application will actually require a
    Windows server edition. I don't think many Linux server
    applications will actually check if it is running on
    a server edition or desktop edition of RHEL/SUSE/Ubuntu/whatever.
    For many reasons (it would be very non-Linux'ish, it would
    be lot of work to maintain a list of all Linux distro editions,
    a lot of it is open source so it would be easy to remove a check
    and rebuild).

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Mon Aug 19 01:50:24 2024
    On Sun, 18 Aug 2024 21:17:00 -0400, Arne Vajhøj wrote:

    On 8/18/2024 8:46 PM, Lawrence D'Oliveiro wrote:

    On Sun, 18 Aug 2024 20:30:59 -0400, Arne Vajhøj wrote:

    25-40 years ago there were workstations running VMS, SunOS, Solaris,
    HP-UX, AIX, Ultrix, Tru64 etc..

    Today a workstations is just a marketing term for a high-end PC
    running Windows or Linux.

    Linux is the one that still offers the full “workstation” capabilities. >> Microsoft called their desktop version of NT “Workstation”, but all its >> server-like capabilities were carefully crippled to avoid cannibalizing
    sales of its actual servers.

    Most (commercial) Linux distros comes with a "server" version and a
    "desktop" version.

    Same software, just choose different packages to install. And you can
    change your mind later and just install/remove different packages, without
    a reinstall. (Unlike Windows -- see below.)

    I don't think there is much difference in how Linux vendors and
    Microsoft position server and desktop products.

    Like I said, Microsoft carefully cripples its NT “Workstation” line to avoid encroaching on “Server” territory. That way it gets to charge a
    whole lot more for the latter.

    Around the time of NT 3.51, I think it was, somebody discovered that you
    could turn the “Workstation” version into the “Server” version just by editing a Registry key or two. Microsoft plugged that hole in the next
    release.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to John Dallman on Mon Aug 19 12:38:58 2024
    On 2024-08-16, John Dallman <jgd@cix.co.uk> wrote:
    In article <v9j1o8$fql6$3@dont-email.me>, FIRST.LAST@vmssoftware.com
    (Robert A. Brooks) wrote:

    There is a lot of VMS-developed C++ code that expects a pointer
    size of 32, so in the case I cited, that compilation qualifer
    will remain forever, because the code will not change.

    Presumably, most of the open source ported to VMS uses 32-bit pointers?


    One of the nice things about higher-level languages such as C (when
    compared to Macro-32/BLISS and their associated OS APIs) is that the
    pointer types are abstracted so the programmer doesn't need to worry
    about pointer size differences in many cases unless they start using VMS-specific APIs.

    Of course, that all changes if you are porting crappy software that
    tries to stuff addresses into integers or if you are doing device driver/hardware work where things like bounce buffers may come into play.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to Michael Kraemer on Mon Aug 19 12:40:01 2024
    On 2024-08-18, Michael Kraemer <m.kraemer@gsi.de> wrote:
    On 18.08.2024 03:59, Dave Froble wrote:


    Well, one could argue that paper and ink are also "not VMS" ...

    VMS is the OS ...
    Documentation is, well, whatever it is ...


    well, one could argue that a real OS should not depend on another one to
    be fully functional.

    That has not been true for VMS since physical terminals were replaced
    with terminal emulators.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to bill on Mon Aug 19 12:31:57 2024
    On 2024-08-16, bill <bill.gunshannon@gmail.com> wrote:
    On 8/16/2024 1:16 PM, Dave Froble wrote:
    On 8/16/2024 8:07 AM, Simon Clubley wrote:

    That's a hack, not a solution (and there are severe limits to how much
    incremental time you can save with this approach).

    Written material is a far better solution in this situation.


    People can process written material at their own chosen speed ...


    More importantly, how are all you people accessing YouTube under VMS?


    If the Python 3.x on VMS is sufficiently functional, you should be able
    to download YouTube videos to VMS just fine. Playing them however is
    left as an exercise for the reader. :-)

    As for downloading them, if anyone is interested enough to give it a go
    and see if VMS Python is functional enough:

    https://github.com/yt-dlp/yt-dlp

    It is a YouTube downloader written in Python. You could always see if
    you can actually download one of the VSI videos to a VMS system.

    I recommend you start with YouTube format 18 which contains a low-resolution video and a audio stream combined together inside a MP4 container.
    This you should be able to do without any other software if VMS Python
    is sufficiently functional.

    If you want to get a bit more creative :-), download the slightly higher resolution video format 135 and then the m4a 140 audio format, port ffmpeg
    to VMS, and then combine the streams into a MP4 container. You only need
    to copy the streams into the container as-is, you do not need to transcode
    the downloaded streams.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Mon Aug 19 09:55:05 2024
    On 8/19/2024 8:38 AM, Simon Clubley wrote:
    On 2024-08-16, John Dallman <jgd@cix.co.uk> wrote:
    In article <v9j1o8$fql6$3@dont-email.me>, FIRST.LAST@vmssoftware.com
    (Robert A. Brooks) wrote:

    There is a lot of VMS-developed C++ code that expects a pointer
    size of 32, so in the case I cited, that compilation qualifer
    will remain forever, because the code will not change.

    Presumably, most of the open source ported to VMS uses 32-bit pointers?


    One of the nice things about higher-level languages such as C (when
    compared to Macro-32/BLISS and their associated OS APIs) is that the
    pointer types are abstracted so the programmer doesn't need to worry
    about pointer size differences in many cases unless they start using VMS-specific APIs.

    Of course, that all changes if you are porting crappy software that
    tries to stuff addresses into integers or if you are doing device driver/hardware work where things like bounce buffers may come into play.

    Or if the application is passing pointers between code compiled
    with different languages/compilers/compiler settings.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From home" @21:1/5 to Simon Clubley on Mon Aug 19 18:19:59 2024
    Simon Clubley wrote:
    On 2024-08-18, Michael Kraemer <m.kraemer@gsi.de> wrote:

    On 18.08.2024 03:59, Dave Froble wrote:


    Well, one could argue that paper and ink are also "not VMS" ...

    VMS is the OS ...
    Documentation is, well, whatever it is ...


    well, one could argue that a real OS should not depend on another one to
    be fully functional.


    That has not been true for VMS since physical terminals were replaced
    with terminal emulators.

    Simon.


    mmh, no.
    VMS was most popular when "everybody" had a VMS workstation on the desktop, connected to a few VMS servers somewhere in a basement.
    No need for a stinking PC anywhere.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From chrisq@21:1/5 to Simon Clubley on Mon Aug 19 19:56:53 2024
    On 8/15/24 13:34, Simon Clubley wrote:
    On 2024-08-14, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 8/14/2024 2:33 PM, Arne Vajhøj wrote:
    And it has different size of long and pointers. Causing problems
    for two cases:
    * code that make implicit assumptions that those are 32 bit
    * mixing C and C++

    I am getting more and more convinced that C and C++
    code should completely switch to the explicit length
    model.

    So:

    #include <stdint.h>

    or:

    #include <cstdint>

    and use:

    int8_t
    int16_t
    int32_t
    int64_t
    uint8_t
    uint16_t
    uint32_t
    uint64_t

    and consider putting:

    #define int ">>>> DO NOT USE INT <<<<"
    #define short ">>>> DO NOT USE SHORT <<<<"
    #define long ">>>> DO NOT USE LONG <<<<"

    in as well to enforce.

    Where did I put that asbestos suit to protect me
    from the C/C++ crowd?


    That works great until you need to interface to the OS unfortunately.

    BTW, I've been writing my own code with explicit sizing for many years.

    To extend this, I also know the difference between signed and unsigned variables and I have a default-unsigned approach unless I absolutely
    _need_ a signed variable.

    Unfortunately, a lot of the material out there doesn't seem to understand that designing a program is about modelling a real-world problem and that
    it isn't OK to just use a signed integer to store an unsigned value.

    Simon.


    Absolutely, must have come from an assembler background, where the use
    of signed branches and arithmetic, can get you into serious trouble.
    The standard C library, of course, tends to use signed variables for everything, a gross error that has never been fixed...

    Chris

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to chrisq on Mon Aug 19 15:07:36 2024
    On 8/19/2024 2:56 PM, chrisq wrote:
    On 8/15/24 13:34, Simon Clubley wrote:
    To extend this, I also know the difference between signed and unsigned
    variables and I have a default-unsigned approach unless I absolutely
    _need_ a signed variable.

    Unfortunately, a lot of the material out there doesn't seem to understand
    that designing a program is about modelling a real-world problem and that
    it isn't OK to just use a signed integer to store an unsigned value.

     Absolutely, must have come from an assembler background, where the use
    of signed branches and arithmetic, can get you into serious trouble.
    The standard C library, of course, tends to use signed variables for everything, a gross error that has never been fixed...

    At least the C people can define an unsigned variable.

    Java does not have unsigned data types at all. OK - higher level
    language and all that. But still a PITA.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From chrisq@21:1/5 to All on Mon Aug 19 19:51:07 2024
    On 8/14/24 19:48, Arne Vajhøj wrote:
    On 8/14/2024 2:33 PM, Arne Vajhøj wrote:
    And it has different size of long and pointers. Causing problems
    for two cases:
    * code that make implicit assumptions that those are 32 bit
    * mixing C and C++

    I am getting more and more convinced that C and C++
    code should completely switch to the explicit length
    model.

    So:

    #include <stdint.h>

    or:

    #include <cstdint>

    and use:

    int8_t
    int16_t
    int32_t
    int64_t
    uint8_t
    uint16_t
    uint32_t
    uint64_t

    and consider putting:

    #define int ">>>> DO NOT USE INT <<<<"
    #define short ">>>> DO NOT USE SHORT <<<<"
    #define long ">>>> DO NOT USE LONG <<<<"

    in as well to enforce.

    Where did I put that asbestos suit to protect me
    from the C/C++ crowd?

    :-)

    Arne


    For years in embedded work here, there is always a header file,
    wordsize.h which aliases such as U8, U16, U32 etc, to the bit
    sizes of the types related to the cpu variant and tools in
    use. Pretty foolproof, and important for embedded work, where
    you often need to know the width of hardware registers, and
    the variables and pointers that interact with them...





    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Hoffman@21:1/5 to chrisq on Mon Aug 19 16:05:59 2024
    On 2024-08-19 18:56:53 +0000, chrisq said:

    On 8/15/24 13:34, Simon Clubley wrote:

    That works great until you need to interface to the OS unfortunately.

    BTW, I've been writing my own code with explicit sizing for many years.

    To extend this, I also know the difference between signed and unsigned
    variables and I have a default-unsigned approach unless I absolutely
    _need_ a signed variable.

    Unfortunately, a lot of the material out there doesn't seem to
    understand that designing a program is about modelling a real-world
    problem and that it isn't OK to just use a signed integer to store an
    unsigned value.

    Unfortunately a lot of apps are implemented in C or C++ when they
    probably shouldn't, too.

    Package management is another area where C, C++, and OpenVMS itself all
    get into trouble.

    Same for concurrency, strings, and various other topics.

    Absolutely, must have come from an assembler background, where the use
    of signed branches and arithmetic, can get you into serious trouble.
    The standard C library, of course, tends to use signed variables for everything, a gross error that has never been fixed...

    The C compiler promotes unsigned to signed, as well. And this promotion
    "fun" includes uint*_t variables quite possibly getting promoted to
    signed.

    q.v.: C11 6.3.1.1: "If an int can represent all values of the original
    type (as restricted by the width, for a bit-field), the value is
    converted to an int; otherwise, it is converted to an unsigned int.
    These are called the integer promotions."
    Also q.v.: C11 6.3.18: "Usual arithmetic conversions"

    strings and character encoding are more "fun": https://thephd.dev/the-c-c++-rust-string-text-encoding-api-landscape

    apropos of nothing, OpenVMS has a whole pile of tooling to avoid
    changing constants: https://devblogs.microsoft.com/cppblog/how-we-used-cpp20-to-eliminate-an-entire-class-of-runtime-bugs/


    Porting is hard: https://github.com/ziglang/zig/pull/13560 (And
    sometimes creative.)

    And if you're coexisting with C and C++ (incrementally or otherwise): https://kristoff.it/blog/maintain-it-with-zig/

    And if you're deep into C++, the following might interest (Apache 2.0): https://github.com/abseil/abseil-cpp

    Swift as a replacement for issues with C and C++ (and deterministic
    testing, and cross-language optimization): https://www.youtube.com/watch?v=ZQc9-seU-5k

    This won't be happening anytime soon if ever of course, as VSI has
    beyond more than enough work in their pending queue.

    --
    Pure Personal Opinion | HoffmanLabs LLC

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Mon Aug 19 23:08:31 2024
    On Mon, 19 Aug 2024 15:07:36 -0400, Arne Vajhøj wrote:

    At least the C people can define an unsigned variable.

    Java does not have unsigned data types at all. OK - higher level
    language and all that. But still a PITA.

    Beat me to it. Java’s lack of unsigned integer types is indeed a downright pain. Along with its omission of typedefs. I think they were trying to
    come up with a simpler language than C++, but that was a) (at least a
    partial) failure, and b) at the cost of leaving out too many useful
    things.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Stephen Hoffman on Mon Aug 19 23:33:46 2024
    On Mon, 19 Aug 2024 16:05:59 -0400, Stephen Hoffman wrote:

    strings and character encoding are more "fun":

    If a system/library call is going to return a dynamic amount of data, it
    is good if it can give some indication of how much data it is going to
    return first.

    The best calls are the ones that, if you pass NULL for the buffer, they
    will return the number of bytes they would have put in the buffer. So you allocate that size of buffer and do a second call, and get back the actual buffer data.

    I did a Python wrapper for Fribidi, and unfortunately its text-encoding conversion calls didn’t work that way. But then, they probably
    couldn’t ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to chrisq on Tue Aug 20 12:13:56 2024
    On 2024-08-19, chrisq <devzero@nospam.com> wrote:
    On 8/15/24 13:34, Simon Clubley wrote:

    To extend this, I also know the difference between signed and unsigned
    variables and I have a default-unsigned approach unless I absolutely
    _need_ a signed variable.

    Unfortunately, a lot of the material out there doesn't seem to understand
    that designing a program is about modelling a real-world problem and that
    it isn't OK to just use a signed integer to store an unsigned value.


    Absolutely, must have come from an assembler background, where the use
    of signed branches and arithmetic, can get you into serious trouble.
    The standard C library, of course, tends to use signed variables for everything, a gross error that has never been fixed...


    From both ends of the scale actually. :-)

    In my early days, I had a _lot_ of assembly language experience.

    That was then followed by Wirth language and then Ada experience.

    The Wirth languages and then Ada was where my experience to date turned
    into a preference for strict data types and the importance of modelling
    as accurately as possible the real-world problem you are implementing.

    BTW, I still consider classic ARM to be the most elegant assembly language
    I have encountered (although those with M68K and similar experience tend
    say they are somewhat better).

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to arne@vajhoej.dk on Tue Aug 20 12:04:13 2024
    On 2024-08-19, Arne Vajhj <arne@vajhoej.dk> wrote:
    On 8/19/2024 8:38 AM, Simon Clubley wrote:

    One of the nice things about higher-level languages such as C (when
    compared to Macro-32/BLISS and their associated OS APIs) is that the
    pointer types are abstracted so the programmer doesn't need to worry
    about pointer size differences in many cases unless they start using
    VMS-specific APIs.

    Of course, that all changes if you are porting crappy software that
    tries to stuff addresses into integers or if you are doing device
    driver/hardware work where things like bounce buffers may come into play.

    Or if the application is passing pointers between code compiled
    with different languages/compilers/compiler settings.


    Of course, that is what ABIs are _supposed_ to be for...

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to arne@vajhoej.dk on Tue Aug 20 12:29:52 2024
    On 2024-08-19, Arne Vajhj <arne@vajhoej.dk> wrote:
    On 8/19/2024 2:56 PM, chrisq wrote:
    On 8/15/24 13:34, Simon Clubley wrote:
    To extend this, I also know the difference between signed and unsigned
    variables and I have a default-unsigned approach unless I absolutely
    _need_ a signed variable.

    Unfortunately, a lot of the material out there doesn't seem to understand >>> that designing a program is about modelling a real-world problem and that >>> it isn't OK to just use a signed integer to store an unsigned value.

    Absolutely, must have come from an assembler background, where the use
    of signed branches and arithmetic, can get you into serious trouble.
    The standard C library, of course, tends to use signed variables for
    everything, a gross error that has never been fixed...

    At least the C people can define an unsigned variable.

    Java does not have unsigned data types at all. OK - higher level
    language and all that. But still a PITA.


    Don't get me bloody started on that. :-) Currently doing some Java
    development as part of a personal non-work project on Android.

    On the plus side, I do like the ease of been able to send messages in
    a message queue between threads however and the clean integration of
    threads into the language. See:

    https://developer.android.com/reference/android/os/Handler

    On the negative side, some things can be so bureaucratic in the Android
    and Java world. For example, the Android documentation keeps trying to force you into using Fragments (and the associated Activity) when simple Views
    are a lot easier to handle.

    At times, Java itself seems to "feel" like it has been designed by theorists with little real-world experience. All the classes-upon-classes when doing
    I/O come to mind here.

    And BTW, Java, is it .size() or .length() ??? Pick one and stick with it
    when you design your classes. :-(

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to chrisq on Tue Aug 20 12:36:51 2024
    On 2024-08-20, chrisq <devzero@nospam.com> wrote:

    I guess another complication is that some functions return
    -1, which implies a signed variable. To fix all that would require a
    complete rewrite of the library and probably most of the os and
    applications as well, so it will never happen. Just have to write
    unsigned equivalents, or slip functions with casts, but it's a lot
    of additional work.


    One thing I wish was available in all languages is the ability to return multiple values from a function call so you can return both a status and
    the value(s) in one assignment. Ie: "a, b, c = demo_function(param1, param2);".

    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From chrisq@21:1/5 to All on Tue Aug 20 13:29:18 2024
    On 8/19/24 20:07, Arne Vajhøj wrote:
    On 8/19/2024 2:56 PM, chrisq wrote:
    On 8/15/24 13:34, Simon Clubley wrote:
    To extend this, I also know the difference between signed and unsigned
    variables and I have a default-unsigned approach unless I absolutely
    _need_ a signed variable.

    Unfortunately, a lot of the material out there doesn't seem to
    understand
    that designing a program is about modelling a real-world problem and
    that
    it isn't OK to just use a signed integer to store an unsigned value.

      Absolutely, must have come from an assembler background, where the
    use of signed branches and arithmetic, can get you into serious trouble.
    The standard C library, of course, tends to use signed variables for
    everything, a gross error that has never been fixed...

    At least the C people can define an unsigned variable.

    Java does not have unsigned data types at all. OK - higher level
    language and all that. But still a PITA.

    Arne


    I guess another complication is that some functions return
    -1, which implies a signed variable. To fix all that would require a
    complete rewrite of the library and probably most of the os and
    applications as well, so it will never happen. Just have to write
    unsigned equivalents, or slip functions with casts, but it's a lot
    of additional work.

    Chris

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From chrisq@21:1/5 to Lawrence D'Oliveiro on Tue Aug 20 13:36:43 2024
    On 8/20/24 00:33, Lawrence D'Oliveiro wrote:
    On Mon, 19 Aug 2024 16:05:59 -0400, Stephen Hoffman wrote:

    strings and character encoding are more "fun":

    If a system/library call is going to return a dynamic amount of data, it
    is good if it can give some indication of how much data it is going to
    return first.

    The best calls are the ones that, if you pass NULL for the buffer, they
    will return the number of bytes they would have put in the buffer. So you allocate that size of buffer and do a second call, and get back the actual buffer data.

    I did a Python wrapper for Fribidi, and unfortunately its text-encoding conversion calls didn’t work that way. But then, they probably
    couldn’t ...

    For work here, all functions that return data have a parameter that
    limits the byte count. Usually pass a pointer to a buffer, with the size parameter equal to or less than the buffer size. Some C library
    functions are just not safe to use in that respect.

    Local spun string copy and other functions use the same sort of size
    limiting.

    Chris

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From chrisq@21:1/5 to Simon Clubley on Tue Aug 20 14:11:04 2024
    On 8/20/24 13:36, Simon Clubley wrote:
    On 2024-08-20, chrisq <devzero@nospam.com> wrote:

    I guess another complication is that some functions return
    -1, which implies a signed variable. To fix all that would require a
    complete rewrite of the library and probably most of the os and
    applications as well, so it will never happen. Just have to write
    unsigned equivalents, or slip functions with casts, but it's a lot
    of additional work.


    One thing I wish was available in all languages is the ability to return multiple values from a function call so you can return both a status and
    the value(s) in one assignment. Ie: "a, b, c = demo_function(param1, param2);".

    The way to get round that here, for many functions
    with multiple parameters, is to declare a structure,
    with the args, status and even status qualifier.
    Can include buffer pointers and lengths as well.
    Fill in the args, then pass a pointer to that
    for the call. Not only is it efficient, as it
    can be passed using single register, but it's
    also easy to add structure elements without affecting
    other code that calls it. It can help to
    make code fully rentrant and is a way to get some
    abstraction for little effort. Also seems like good
    practice, as one of the key design tasks should
    be to accurately define and encapsulate the
    interfaces to the code.

    Quite a bit of unix code that uses such techniques,
    as does vms with descriptors, if that'a the
    right name for it.

    Chris


    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.

    Simon.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Tue Aug 20 09:47:36 2024
    On 8/20/2024 8:36 AM, Simon Clubley wrote:
    On 2024-08-20, chrisq <devzero@nospam.com> wrote:
    I guess another complication is that some functions return
    -1, which implies a signed variable. To fix all that would require a
    complete rewrite of the library and probably most of the os and
    applications as well, so it will never happen. Just have to write
    unsigned equivalents, or slip functions with casts, but it's a lot
    of additional work.

    One thing I wish was available in all languages is the ability to return multiple values from a function call so you can return both a status and
    the value(s) in one assignment. Ie: "a, b, c = demo_function(param1, param2);".

    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.

    Few languages support multiple return values.

    And a few other languages support tuples with named fields
    or anonymous classes with named properties, which is almost as good.

    And almost all newer high level languages support
    map/dictionary/associative array.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Tue Aug 20 09:19:39 2024
    On 8/20/2024 8:04 AM, Simon Clubley wrote:
    On 2024-08-19, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 8/19/2024 8:38 AM, Simon Clubley wrote:
    One of the nice things about higher-level languages such as C (when
    compared to Macro-32/BLISS and their associated OS APIs) is that the
    pointer types are abstracted so the programmer doesn't need to worry
    about pointer size differences in many cases unless they start using
    VMS-specific APIs.

    Of course, that all changes if you are porting crappy software that
    tries to stuff addresses into integers or if you are doing device
    driver/hardware work where things like bounce buffers may come into play. >>
    Or if the application is passing pointers between code compiled
    with different languages/compilers/compiler settings.

    Of course, that is what ABIs are _supposed_ to be for...

    Yes.

    But that is the point.

    The ABI is right by definition. The compilers pointer size is
    just usually right.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Tue Aug 20 10:15:03 2024
    On 8/20/2024 8:29 AM, Simon Clubley wrote:
    At times, Java itself seems to "feel" like it has been designed by theorists with little real-world experience. All the classes-upon-classes when doing I/O come to mind here.

    JCP is just like ANSI, ISO and ECMA.

    Java is literally designed by committee.

    And there are some horror decisions. The compiler API comes
    to my mind - it takes 200 lines to do what you can do in 5 lines
    in C#.

    The java.io package may seem a bit complex, but it makes perfect
    sense when you learn the structure.

    The basics is:

    InputStream - read bytes from anything
    FileInputStream - read bytes from file
    ByteArrayInputStream - read bytes from byte array
    ...
    OutputStream - write bytes to anything
    FileOutputStream - write bytes to file
    ByteArrayOutputStream - write bytes to byte array
    ...
    Reader - read chars according to encoding from anything
    FileReader - read chars according to encoding from file
    CharArrayReader - read chars according to encoding from char array
    ...
    Writer - write chars according to encoding to anything
    FileWriter - write chars according to encoding to file
    CharArrayWriter - write chars according to encoding to char array
    ...

    All very systematic.

    On top of that there are two convenience classes to work with text
    files:
    * BufferedReader that wraps any Reader and provides a readLine method
    * PrintWriter that wraps any Writer and provides print, println and
    printf methods

    Remember that and you can handle 98% of cases.

    For the last 2% reading the docs will be needed.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Single Stage to Orbit@21:1/5 to Simon Clubley on Tue Aug 20 15:47:00 2024
    On Tue, 2024-08-20 at 12:36 +0000, Simon Clubley wrote:
    One thing I wish was available in all languages is the ability to
    return multiple values from a function call so you can return both a
    status and the value(s) in one assignment. Ie: "a, b, c = demo_function(param1, param2);".

    In languages with dynamic associative arrays (such as PHP), I
    simulate this by returning an associative array from a function call
    with both status and value fields. Makes coding _so_ much cleaner and
    robust.

    Rust does this very well:

    pub fn swap(a: u32, b: u32) -> (u32, u32)
    {
    (b, a)
    }

    --
    Tactical Nuclear Kittens

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to arne@vajhoej.dk on Tue Aug 20 17:38:44 2024
    On 2024-08-20, Arne Vajhj <arne@vajhoej.dk> wrote:
    On 8/20/2024 8:29 AM, Simon Clubley wrote:
    At times, Java itself seems to "feel" like it has been designed by theorists >> with little real-world experience. All the classes-upon-classes when doing >> I/O come to mind here.

    JCP is just like ANSI, ISO and ECMA.

    Java is literally designed by committee.


    It shows. :-)

    And there are some horror decisions. The compiler API comes
    to my mind - it takes 200 lines to do what you can do in 5 lines
    in C#.


    Also, no dynamic arrays built into the language itself. You need ArrayList()
    to implement them or things like ByteArrayOutputStream().

    The java.io package may seem a bit complex, but it makes perfect
    sense when you learn the structure.

    The basics is:

    InputStream - read bytes from anything
    FileInputStream - read bytes from file
    ByteArrayInputStream - read bytes from byte array
    ...
    OutputStream - write bytes to anything
    FileOutputStream - write bytes to file
    ByteArrayOutputStream - write bytes to byte array
    ...
    Reader - read chars according to encoding from anything
    FileReader - read chars according to encoding from file
    CharArrayReader - read chars according to encoding from char array
    ...
    Writer - write chars according to encoding to anything
    FileWriter - write chars according to encoding to file
    CharArrayWriter - write chars according to encoding to char array
    ...

    All very systematic.

    On top of that there are two convenience classes to work with text
    files:
    * BufferedReader that wraps any Reader and provides a readLine method
    * PrintWriter that wraps any Writer and provides print, println and
    printf methods

    Remember that and you can handle 98% of cases.

    For the last 2% reading the docs will be needed.


    You forgot about InputStreamReader() to turn an InputStream into a Reader. :-) After all, why miss the opportunity to have two parallel sets of APIs
    (byte versus character) instead of just the one API ? :-)

    Goodness knows why they didn't just add something like String's getBytes() method to the character APIs or add character support to the byte APIs...

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to bill on Tue Aug 20 17:47:56 2024
    On 2024-08-20, bill <bill.gunshannon@gmail.com> wrote:
    On 8/20/2024 8:36 AM, Simon Clubley wrote:
    On 2024-08-20, chrisq <devzero@nospam.com> wrote:

    I guess another complication is that some functions return
    -1, which implies a signed variable. To fix all that would require a
    complete rewrite of the library and probably most of the os and
    applications as well, so it will never happen. Just have to write
    unsigned equivalents, or slip functions with casts, but it's a lot
    of additional work.


    One thing I wish was available in all languages is the ability to return
    multiple values from a function call so you can return both a status and
    the value(s) in one assignment. Ie: "a, b, c = demo_function(param1, param2);".

    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.


    And probably much harder to understand in anything but the most
    trivial usage.


    Huh ? Well that shows you haven't done this kind of thing. :-)

    If you are talking about PHP, you construct an associative array
    in the return statement of the function and then access the keys
    in the caller. Very clean.

    If you are talking about some future thing based on C, you simply
    extend the function prototype to include a list of return types
    instead of the single type it is at the moment and you just return
    the list in the function's return statement.

    $ set response/mode=good_natured

    Or are associative arrays and other higher-level data structures an alien concept to you ? :-)

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to bill on Tue Aug 20 18:23:29 2024
    On 2024-08-20, bill <bill.gunshannon@gmail.com> wrote:
    On 8/20/2024 8:29 AM, Simon Clubley wrote:


    I stopped working with Java almost a decade ago. (it coincided with
    my retirement when I no longer had to do work for others!)
    But, here goes....


    At times, Java itself seems to "feel" like it has been designed by theorists >> with little real-world experience.

    What makes you think it wasn't? Kinda like Ada. The USAF came up
    with an idea because they needed it for their jets. Others got
    involved resulting in a product that no longer met their needs.
    DOD mandated Ada usage. The USAF said no thank you and went back
    to Jovial. :-)


    Huh ? Ada has seen a _lot_ of use in safety-critical applications,
    including in areas where there is no government mandate.

    I can't speak to going back to Jovial (assuming you have not got
    the details wrong), but the other choices such as C++ seemed to be
    more political in nature once the mandate was dropped.

    All the classes-upon-classes when doing >> I/O come to mind here.

    And BTW, Java, is it .size() or .length() ??? Pick one and stick with it
    when you design your classes. :-(


    To me size and length are not the same thing. Strings have length.
    Data types, pointers and the like have size. Anything trying to
    make the two interchangeable is just wrong. :-)


    And to confuse this further, in Java an array has a .length variable
    (not method), while ArrayList has a .size() method. :-)

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Tue Aug 20 14:45:41 2024
    On 8/20/2024 2:37 PM, Arne Vajhøj wrote:
    The second transfer between an in memory sequence of
    sequence of chars aka Unicode code points (0..65536 values)
    usually in the form of String objects

    Correction.

    That was how it was when it was designed.

    Today it is:

    ... UTF-16 code units (0..65536 values) ...

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to bill on Tue Aug 20 14:16:39 2024
    On 8/20/2024 1:34 PM, bill wrote:
    On 8/20/2024 8:36 AM, Simon Clubley wrote:
    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.

    And probably much harder to understand in anything but the most
    trivial usage.

    It is easy to understand if reasonable descriptive key names are chosen.

    Example:

    $ type mr.php
    <?php

    function four_ops($a, $b) {
    return array('plus' => $a + $b, 'minus' => $a - $b, 'multiply' =>
    $a * $b, 'divide' => $a / $b);
    }

    $a = 3.0;
    $b = 2.0;
    $res = four_ops($a, $b);
    echo sprintf("%f + %f = %f\r\n", $a, $b, $res['plus']);
    echo sprintf("%f - %f = %f\r\n", $a, $b, $res['minus']);
    echo sprintf("%f * %f = %f\r\n", $a, $b, $res['multiply']);
    echo sprintf("%f / %f = %f\r\n", $a, $b, $res['divide']);


    $ php mr.php
    3.000000 + 2.000000 = 5.000000
    3.000000 - 2.000000 = 1.000000
    3.000000 * 2.000000 = 6.000000
    3.000000 / 2.000000 = 1.500000

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Tue Aug 20 14:37:26 2024
    On 8/20/2024 1:38 PM, Simon Clubley wrote:
    Also, no dynamic arrays built into the language itself. You need ArrayList() to implement them or things like ByteArrayOutputStream().

    At the level of Java then I think that is to be expected. A
    dynamic data structure requires a collection type. In C#
    List<T> and T[] are different. In C++ vector<T> and T[] are
    different.

    But Java developers should consider ArrayList<T> to be their
    default choice instead of T[].

    The java.io package may seem a bit complex, but it makes perfect
    sense when you learn the structure.

    The basics is:

    InputStream - read bytes from anything
    FileInputStream - read bytes from file
    ByteArrayInputStream - read bytes from byte array
    ...
    OutputStream - write bytes to anything
    FileOutputStream - write bytes to file
    ByteArrayOutputStream - write bytes to byte array
    ...
    Reader - read chars according to encoding from anything
    FileReader - read chars according to encoding from file
    CharArrayReader - read chars according to encoding from char array
    ...
    Writer - write chars according to encoding to anything
    FileWriter - write chars according to encoding to file
    CharArrayWriter - write chars according to encoding to char array
    ...

    All very systematic.

    On top of that there are two convenience classes to work with text
    files:
    * BufferedReader that wraps any Reader and provides a readLine method
    * PrintWriter that wraps any Writer and provides print, println and
    printf methods

    Remember that and you can handle 98% of cases.

    For the last 2% reading the docs will be needed.

    You forgot about InputStreamReader() to turn an InputStream into a Reader. :-)

    There are InputStreamReader to convert from InputStream to Reader and OutputStreamWriter to convert from OutputStream to Writer.

    And they are actually used, because some API's has classes that only has getInputStream()/getOutputStream() methods and not
    getReader()/getWriter() methods.

    All follow the model.

    After all, why miss the opportunity to have two parallel sets of APIs
    (byte versus character) instead of just the one API ? :-)

    Goodness knows why they didn't just add something like String's getBytes() method to the character APIs or add character support to the byte APIs...

    Because InputStream/OutputStream and Reader/Writer are fundamentally
    different.

    The first transfer between an in memory sequence of bytes
    (-128..127 values) to an external form of same sequence of
    bytes (-128..127 values).

    The second transfer between an in memory sequence of
    sequence of chars aka Unicode code points (0..65536 values)
    usually in the form of String objects to an external form
    of sequence of bytes (-128..127) values often of a different
    length according to some encoding (UTF-8 is most common but
    there are hundreds of possibilities: UTF-16, UTF-32, ISO-8859-x,
    ASCII, EBCDIC, various non-latin).

    In C then wprintf/wscanf are not the same as printf/scanf either.

    The difference is that very few use wide in C while everybody is
    more or less forced to use wide in Java.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Tue Aug 20 15:10:51 2024
    On 8/20/2024 2:37 PM, Arne Vajhøj wrote:
    Because InputStream/OutputStream and Reader/Writer are fundamentally different.

    The first transfer between an in memory sequence of bytes
    (-128..127 values) to an external form of same sequence of
    bytes (-128..127 values).

    The second transfer between an in memory sequence of
    sequence of chars aka Unicode code points (0..65536 values)
    usually in the form of String objects to an external form
    of sequence of bytes (-128..127) values often of a different
    length according to some encoding (UTF-8 is most common but
    there are hundreds of possibilities: UTF-16, UTF-32, ISO-8859-x,
    ASCII, EBCDIC, various non-latin).

    Demo:

    $ type OSDemo.java
    import java.io.*;

    public class OSDemo {
    public static void main(String[] args) throws Exception {
    try(OutputStream os = new FileOutputStream("os.dat")) {
    os.write(1);
    os.write(2);
    os.write(3);
    }
    }
    }
    $ javac OSDemo.java
    $ java OSDemo
    $ dump os.dat

    Dump of file DKA0:[arne]os.dat;2 on 20-AUG-2024 15:05:50.22
    File ID (52122,13,0) End of file block 1 / Allocated 16

    Virtual block number 1 (00000001), 512 (0200) bytes

    00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00030201 ................................ 000000

    $ type WrtDemo.java
    import java.io.*;

    public class WrtDemo {
    public static void main(String[] args) throws Exception {
    try(PrintWriter pw = new PrintWriter("pw_" +
    args[0].toLowerCase() + ".txt", args[0])) {
    pw.printf("%d %d %d\n", 1, 2, 3);
    }
    }
    }
    $ javac WrtDemo.java
    $ java WrtDemo "UTF-8"
    $ dump pw_utf-8.txt

    Dump of file DKA0:[arne]pw_utf-8.txt;2 on 20-AUG-2024 15:06:00.26
    File ID (52124,20,0) End of file block 1 / Allocated 16

    Virtual block number 1 (00000001), 512 (0200) bytes

    00000000 00000000 00000000 00000000 00000000 00000000 00000A33
    20322031 1 2 3........................... 000000

    $ java WrtDemo "UTF-16"
    $ dump pw_utf-16.txt

    Dump of file DKA0:[arne]pw_utf-16.txt;2 on 20-AUG-2024 15:06:02.38
    File ID (52126,11,0) End of file block 1 / Allocated 16

    Virtual block number 1 (00000001), 512 (0200) bytes

    00000000 00000000 00000000 00000000 00000A00 33002000 32002000
    3100FFFE þ..1. .2. .3.................... 000000

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From babydr DBA James W. Laferriere@21:1/5 to Simon Clubley via Info-vax on Tue Aug 20 12:07:16 2024
    Copy: clubley@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)

    Hello All ,

    On Mon, 19 Aug 2024, Simon Clubley via Info-vax wrote:
    On 2024-08-18, Michael Kraemer <m.kraemer@gsi.de> wrote:
    On 18.08.2024 03:59, Dave Froble wrote:


    Well, one could argue that paper and ink are also "not VMS" ...

    VMS is the OS ...
    Documentation is, well, whatever it is ...


    well, one could argue that a real OS should not depend on another one to
    be fully functional.

    That has not been true for VMS since physical terminals were replaced
    with terminal emulators.

    Simon.
    Heck , Even then , the terminals were software driven .
    eeproms on some of them & even some of those not promed had ariable fonts ...

    Twyl , JimL

    --
    +---------------------------------------------------------------------+
    | James W. Laferriere | System Techniques | Give me VMS |
    | Network & System Engineer | 3237 Holden Road | Give me Linux |
    | jiml@system-techniques.com | Fairbanks, AK. 99709 | only on AXP | +---------------------------------------------------------------------+

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Craig A. Berry@21:1/5 to All on Tue Aug 20 16:12:56 2024
    On 8/20/24 1:45 PM, Arne Vajhøj wrote:
    On 8/20/2024 2:37 PM, Arne Vajhøj wrote:
    The second transfer between an in memory sequence of
    sequence of chars aka Unicode code points (0..65536 values)
    usually in the form of String objects

    Correction.

    That was how it was when it was designed.

    Today it is:

    ... UTF-16 code units (0..65536 values) ...

    That was UCS-2, which was fixed width. UTF-16 can encode all the code
    points in Unicode because it is varying width.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From chrisq@21:1/5 to All on Tue Aug 20 22:56:45 2024
    On 8/18/24 14:03, Arne Vajhøj wrote:
    On 8/18/2024 6:05 AM, Michael Kraemer wrote:
    On 18.08.2024 03:59, Dave Froble wrote:
    Well, one could argue that paper and ink are also "not VMS" ...

    VMS is the OS ...
    Documentation is, well, whatever it is ...

    well, one could argue that a real OS should not depend on another one
    to be fully functional.
    At least it should be able to present its own documentation.
    In this context, paper and ink are agnostic.

    Maybe the concept "OS" is too general here.

    I would expect a "client OS" to be able to display
    HTML, PDF, video etc..

    I would expect a "server OS" to be able to serve
    that content to clients.

    Arne


    A properly sorted os should be able to do any of those things,
    with the appropriate packages. The os is merely there to provide
    services to applications...

    Chris

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to chrisq on Tue Aug 20 18:33:01 2024
    On 8/20/2024 5:56 PM, chrisq wrote:
    On 8/18/24 14:03, Arne Vajhøj wrote:
    On 8/18/2024 6:05 AM, Michael Kraemer wrote:
    On 18.08.2024 03:59, Dave Froble wrote:
    Well, one could argue that paper and ink are also "not VMS" ...

    VMS is the OS ...
    Documentation is, well, whatever it is ...

    well, one could argue that a real OS should not depend on another one
    to be fully functional.
    At least it should be able to present its own documentation.
    In this context, paper and ink are agnostic.

    Maybe the concept "OS" is too general here.

    I would expect a "client OS" to be able to display
    HTML, PDF, video etc..

    I would expect a "server OS" to be able to serve
    that content to clients.

    A properly sorted os should be able to do any of those things,
    with the appropriate packages. The os is merely there to provide
    services to applications...

    True.

    But packages does not get ported to an OS by magic - someone
    needs to do the work.

    VSI see VMS as a server OS and spend money on server stuff
    not client stuff.

    Given that a large part of the client stuff is open source,
    then VMS users could in theory add the client stuff. But
    we all know that is not going to happen.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Craig A. Berry on Tue Aug 20 18:39:17 2024
    On 8/20/2024 5:12 PM, Craig A. Berry wrote:
    On 8/20/24 1:45 PM, Arne Vajhøj wrote:
    On 8/20/2024 2:37 PM, Arne Vajhøj wrote:
    The second transfer between an in memory sequence of
    sequence of chars aka Unicode code points (0..65536 values)
    usually in the form of String objects

    Correction.

    That was how it was when it was designed.

    Today it is:

    ... UTF-16 code units (0..65536 values) ...

    That was UCS-2, which was fixed width.  UTF-16 can encode all the code points in Unicode because it is varying width.

    The distinction I was trying to make is between
    (Unicode) code points and (UTF-16) code units.

    A code point can be encoded in a variable number of code units.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to chrisq on Wed Aug 21 01:19:45 2024
    On Tue, 20 Aug 2024 14:11:04 +0100, chrisq wrote:

    Quite a bit of unix code that uses such techniques, as does vms with descriptors, if that'a the right name for it.

    Umm, you might be thinking of item lists?

    Wonderful things ... you could tell the terminal driver was getting
    complex in VMS V4, I think it was, when they introduced QIO calls done
    with item lists ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Wed Aug 21 01:18:07 2024
    On Tue, 20 Aug 2024 10:15:03 -0400, Arne Vajhøj wrote:

    And there are some horror decisions. The compiler API comes to my mind -
    it takes 200 lines to do what you can do in 5 lines in C#.

    Java is full of stuff like that.

    The java.io package may seem a bit complex, but it makes perfect sense
    when you learn the structure.

    Until you try to include niceties like select/poll. Then you get into a
    whole mess of extra classes/methods.

    I suppose, given its origin in the 1990s, the Java designers thought all nonblocking I/O should be handled through threads ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Tue Aug 20 21:29:13 2024
    On 8/20/2024 9:18 PM, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 10:15:03 -0400, Arne Vajhøj wrote:
    The java.io package may seem a bit complex, but it makes perfect sense
    when you learn the structure.

    Until you try to include niceties like select/poll. Then you get into a
    whole mess of extra classes/methods.

    I suppose, given its origin in the 1990s, the Java designers thought all nonblocking I/O should be handled through threads ...

    That stuff is not in java.io but in java.nio and added
    in Java 1.4 (2002).

    Not that many classes, but a totally different set of classes.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Tue Aug 20 21:35:44 2024
    On 8/20/2024 9:25 PM, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 09:47:36 -0400, Arne Vajhøj wrote:
    Few languages support multiple return values.

    Even in C and Fortran, a function can return a struct.

    Yes. But that is returning a single value - just a composite value.

    It works fine, but it requires a custom type.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Tue Aug 20 21:31:33 2024
    On 8/20/2024 9:19 PM, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 14:11:04 +0100, chrisq wrote:
    Quite a bit of unix code that uses such techniques, as does vms with
    descriptors, if that'a the right name for it.

    Umm, you might be thinking of item lists?

    Wonderful things ... you could tell the terminal driver was getting
    complex in VMS V4, I think it was, when they introduced QIO calls done
    with item lists ...

    Where are SYS$QIO(W) using item lists?

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Wed Aug 21 01:48:32 2024
    On Tue, 20 Aug 2024 21:31:33 -0400, Arne Vajhøj wrote:

    On 8/20/2024 9:19 PM, Lawrence D'Oliveiro wrote:

    On Tue, 20 Aug 2024 14:11:04 +0100, chrisq wrote:

    Quite a bit of unix code that uses such techniques, as does vms with
    descriptors, if that'a the right name for it.

    Umm, you might be thinking of item lists?

    Wonderful things ... you could tell the terminal driver was getting
    complex in VMS V4, I think it was, when they introduced QIO calls done
    with item lists ...

    Where are SYS$QIO(W) using item lists?

    OpenVMS v8.4 I/O User’s Reference, section 5.3.1.3, “Itemlist Read Operations”.

    <https://support.hpe.com/hpsc/doc/public/display?docId=emr_na-c04622349>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Wed Aug 21 01:52:29 2024
    On Tue, 20 Aug 2024 21:29:13 -0400, Arne Vajhøj wrote:

    On 8/20/2024 9:18 PM, Lawrence D'Oliveiro wrote:

    On Tue, 20 Aug 2024 10:15:03 -0400, Arne Vajhøj wrote:

    The java.io package may seem a bit complex, but it makes perfect sense
    when you learn the structure.

    Until you try to include niceties like select/poll. Then you get into a
    whole mess of extra classes/methods.

    I suppose, given its origin in the 1990s, the Java designers thought
    all nonblocking I/O should be handled through threads ...

    That stuff is not in java.io but in java.nio and added in Java 1.4
    (2002).

    Not that many classes, but a totally different set of classes.

    Even worse.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Wed Aug 21 01:51:46 2024
    On Tue, 20 Aug 2024 21:35:44 -0400, Arne Vajhøj wrote:

    On 8/20/2024 9:25 PM, Lawrence D'Oliveiro wrote:

    On Tue, 20 Aug 2024 09:47:36 -0400, Arne Vajhøj wrote:

    Few languages support multiple return values.

    Even in C and Fortran, a function can return a struct.

    Yes. But that is returning a single value - just a composite value.

    The distinction between “multiple value” versus “single composite value”
    is an artificial one specific to languages like Lisp. Python, for example,
    is quite happy with constructs like

    a, b = struct.unpack("hh", b"\x00\x00\xff\xff")

    And I think also JavaScript works that way.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Tue Aug 20 22:14:31 2024
    On 8/20/2024 9:51 PM, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 21:35:44 -0400, Arne Vajhøj wrote:
    On 8/20/2024 9:25 PM, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 09:47:36 -0400, Arne Vajhøj wrote:
    Few languages support multiple return values.

    Even in C and Fortran, a function can return a struct.

    Yes. But that is returning a single value - just a composite value.

    The distinction between “multiple value” versus “single composite value”
    is an artificial one specific to languages like Lisp. Python, for example,
    is quite happy with constructs like

    a, b = struct.unpack("hh", b"\x00\x00\xff\xff")

    If the language supports tuples or has a generic tuple class
    or an other way to avoid creating a type for each
    type combo of return values, then it is pretty much the same.

    But with languages like C and Fortran there is a big difference.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Wed Aug 21 01:25:20 2024
    On Tue, 20 Aug 2024 09:47:36 -0400, Arne Vajhøj wrote:

    Few languages support multiple return values.

    Even in C and Fortran, a function can return a struct.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Reagan@21:1/5 to All on Wed Aug 21 10:21:17 2024
    On 8/15/2024 1:58 AM, Arne Vajhøj wrote:
    On 8/14/2024 7:47 PM, Lawrence D'Oliveiro wrote:
    On Wed, 14 Aug 2024 14:33:27 -0400, Arne Vajhøj wrote:
    And it has different size of long and pointers.

    If you wanted an integer type that is compatible with pointers, that was
    always intptr_t and uintptr_t, surely


    I am not being particular clear.

    I am not saying that:

    default sizeof long C++ x64 <> default sizeof pointer C++ x64

    I am saying that:

    default sizeof long C++ x64 <> default sizeof long C++ Itanium & Alpha default sizeof pointer C++ x64 <> default sizeof pointer C++ Itanium &
    Alpha

    and later:

    default sizeof long C++ x64 <> default sizeof long C x64
    default sizeof pointer C++ x64 <> default sizeof pointer C x64

    Arne



    Yes, all good points. The size_t and offset_t = 32-bits and ptrdiff_t = 32-bits on Alpha/Itanium started the mess years ago.

    Personally, I would have kept all the defaults the same as Itanium but
    got "convinced" to go wider. The first attempt was ONLY 64-bit pointers
    on x86 with C++ but things like those pesky descriptors and itemlists
    got in the way.

    I did suggest an LP64, ILP32, etc qualifier but mostly got blank stares
    from other engineers as "too nerdy"

    long == 64-bits has caused us to make changes as prior header writers
    assumed that long was 32-bits. They should have all followed Arne's
    advice and used int32_t and int64_t when specifying their ABIs.

    I'll can take some ownership on the changes, but I suffered with years
    of "John, why is size_t 32-bits? Why does subtracting two 64-bit
    pointers only give me a 32-bit result?"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to John Reagan on Wed Aug 21 07:08:07 2024
    On 8/21/2024 4:21 AM, John Reagan wrote:
    Yes, all good points.  The size_t and offset_t = 32-bits and ptrdiff_t = 32-bits on Alpha/Itanium started the mess years ago.

    Personally, I would have kept all the defaults the same as Itanium but
    got "convinced" to go wider.  The first attempt was ONLY 64-bit pointers
    on x86 with C++ but things like those pesky descriptors and itemlists
    got in the way.

    I did suggest an LP64, ILP32, etc qualifier but mostly got blank stares
    from other engineers as "too nerdy"

    long == 64-bits has caused us to make changes as prior header writers
    assumed that long was 32-bits.  They should have all followed Arne's
    advice and used int32_t and int64_t when specifying their ABIs.

    I'll can take some ownership on the changes, but I suffered with years
    of "John, why is size_t 32-bits?  Why does subtracting two 64-bit
    pointers only give me a 32-bit result?"

    Hindsight is always easy.

    :-)

    Knowing what we know now then I think that:
    * an option to change size of long
    * having CXX command default to 32 bit pointers and 32 bit long
    with two options to go 64 bit (pointer do already have it)
    * having clang command go more pure 64 bit
    may have been the right path.

    But too late.

    Well - not too late for /LONG=32 and /LONG=64 !

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to arne@vajhoej.dk on Wed Aug 21 12:18:46 2024
    On 2024-08-20, Arne Vajhj <arne@vajhoej.dk> wrote:
    On 8/20/2024 1:38 PM, Simon Clubley wrote:

    You forgot about InputStreamReader() to turn an InputStream into a Reader. :-)

    There are InputStreamReader to convert from InputStream to Reader and OutputStreamWriter to convert from OutputStream to Writer.

    And they are actually used, because some API's has classes that only has getInputStream()/getOutputStream() methods and not
    getReader()/getWriter() methods.

    All follow the model.

    After all, why miss the opportunity to have two parallel sets of APIs
    (byte versus character) instead of just the one API ? :-)

    Goodness knows why they didn't just add something like String's getBytes() >> method to the character APIs or add character support to the byte APIs...

    Because InputStream/OutputStream and Reader/Writer are fundamentally different.


    I may not have stated that clearly enough.

    The character model is built in top of a byte model, with character-specific knowledge in the character classes.

    The traditional Java way to add this additional functionality is to extend
    a class in a subclass and implement the additional functionality in the subclass.

    I am having a hard time seeing why they didn't just extend the byte I/O
    classes in this way to implement additional character functionality so
    that both character and byte I/O directly uses an InputStream (and likewise
    for an OutputStream). There should be no need for a character-specific
    Reader concept or an InputStreamReader() converter.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From chrisq@21:1/5 to Lawrence D'Oliveiro on Wed Aug 21 13:26:12 2024
    On 8/21/24 02:25, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 09:47:36 -0400, Arne Vajhøj wrote:

    Few languages support multiple return values.

    Even in C and Fortran, a function can return a struct.

    Better to declare the struct externally, then pass a pointer
    to it. Much tidier.

    Chris

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Wed Aug 21 08:37:56 2024
    On 8/21/2024 8:18 AM, Simon Clubley wrote:
    On 2024-08-20, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 8/20/2024 1:38 PM, Simon Clubley wrote:
    After all, why miss the opportunity to have two parallel sets of APIs
    (byte versus character) instead of just the one API ? :-)

    Goodness knows why they didn't just add something like String's getBytes() >>> method to the character APIs or add character support to the byte APIs... >>
    Because InputStream/OutputStream and Reader/Writer are fundamentally
    different.


    I may not have stated that clearly enough.

    The character model is built in top of a byte model, with character-specific knowledge in the character classes.

    The traditional Java way to add this additional functionality is to extend
    a class in a subclass and implement the additional functionality in the subclass.

    Reader/Writer does not extend InputStream/OutputStream. They do not
    add functionality - they provide different functionality.

    They may use/encapsulate an InputStream/OutputStream, but that is implementation and invisible to the public API.

    I am having a hard time seeing why they didn't just extend the byte I/O classes in this way to implement additional character functionality so
    that both character and byte I/O directly uses an InputStream (and likewise for an OutputStream). There should be no need for a character-specific
    Reader concept or an InputStreamReader() converter.

    Mixing byte IO and character IO can be very dangerous (at least
    for encodings where characters can be multiple bytes).

    Having such a mixed API would create lots of problems for users
    actually mixing.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to chrisq on Wed Aug 21 14:13:24 2024
    On 8/21/2024 8:26 AM, chrisq wrote:
    On 8/21/24 02:25, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 09:47:36 -0400, Arne Vajhøj wrote:
    Few languages support multiple return values.

    Even in C and Fortran, a function can return a struct.

    Better to declare the struct externally, then pass a pointer
    to it. Much tidier.

    In C one should definitely return a pointer to struct and not
    a struct.

    It looks like VSI Fortran cannot return a structure as function
    result, but VSI Pascal can return a record as function result.

    And it is returned as a pointer argument under the hood.

    $ type s.pas
    module s;

    type
    iiituple = record
    a : integer;
    b : integer;
    c : integer;
    end;

    [global]
    function get : iiituple;

    var
    res : iiituple;

    begin
    res.a := 123;
    res.b := 456;
    res.c := 789;
    get := res;
    end;

    end.
    $ pas s
    $ type m.c
    #include <stdio.h>

    struct iiituple
    {
    int a;
    int b;
    int c;
    };

    void get(struct iiituple *res);

    int main()
    {
    struct iiituple res;
    get(&res);
    printf("%d %d %d\n", res.a, res.b, res.c);
    return 0;
    }
    $ cc m
    $ link m + s
    $ run m
    123 456 789

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Wed Aug 21 14:19:52 2024
    On 8/21/2024 2:13 PM, Arne Vajhøj wrote:
    On 8/21/2024 8:26 AM, chrisq wrote:
    On 8/21/24 02:25, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 09:47:36 -0400, Arne Vajhøj wrote:
    Few languages support multiple return values.

    Even in C and Fortran, a function can return a struct.

    Better to declare the struct externally, then pass a pointer
    to it. Much tidier.

    In C one should definitely return a pointer to struct and not
    a struct.

    It looks like VSI Fortran cannot return a structure as function
    result, but VSI Pascal can return a record as function result.

    And it is returned as a pointer argument under the hood.

    Unless it fits in a register, then it is returned
    as a true function result:

    $ type s2.pas
    module s2;

    type
    iituple = record
    a : integer;
    b : integer;
    end;

    [global]
    function get : iituple;

    var
    res : iituple;

    begin
    res.a := 123;
    res.b := 456;
    get := res;
    end;

    end.
    $ pas s2
    $ type m2.c
    #include <stdio.h>

    struct iituple
    {
    int a;
    int b;
    };

    struct iituple get();

    int main()
    {
    struct iituple res = get();
    printf("%d %d\n", res.a, res.b);
    return 0;
    }
    $ cc m2
    $ link m2 + s2
    $ run m2
    123 456

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to chrisq on Wed Aug 21 23:47:26 2024
    On Wed, 21 Aug 2024 13:26:12 +0100, chrisq wrote:

    On 8/21/24 02:25, Lawrence D'Oliveiro wrote:

    On Tue, 20 Aug 2024 09:47:36 -0400, Arne Vajhøj wrote:

    Few languages support multiple return values.

    Even in C and Fortran, a function can return a struct.

    Better to declare the struct externally, then pass a pointer to it. Much tidier.

    But not so convenient for functional programming style.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Wed Aug 21 20:12:13 2024
    On 8/21/2024 2:13 PM, Arne Vajhøj wrote:
    On 8/21/2024 8:26 AM, chrisq wrote:
    On 8/21/24 02:25, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 09:47:36 -0400, Arne Vajhøj wrote:
    Few languages support multiple return values.

    Even in C and Fortran, a function can return a struct.

    Better to declare the struct externally, then pass a pointer
    to it. Much tidier.

    In C one should definitely return a pointer to struct and not
    a struct.

    It looks like VSI Fortran cannot return a structure as function
    result, but VSI Pascal can return a record as function result.

    And it is returned as a pointer argument under the hood.

    $ type s.pas
    module s;

    type
       iiituple = record
                     a : integer;
                     b : integer;
                     c : integer;
                 end;

    [global]
    function get : iiituple;

    void get(struct iiituple *res);

    int main()
    {
        struct iiituple res;
        get(&res);

    Note that C follow the same convention, so:

    struct iiituple get();

    int main()
    {
    struct iiituple res = get();

    works just as well.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to Simon Clubley on Wed Aug 21 22:12:40 2024
    On 8/20/2024 8:36 AM, Simon Clubley wrote:
    On 2024-08-20, chrisq <devzero@nospam.com> wrote:

    I guess another complication is that some functions return
    -1, which implies a signed variable. To fix all that would require a
    complete rewrite of the library and probably most of the os and
    applications as well, so it will never happen. Just have to write
    unsigned equivalents, or slip functions with casts, but it's a lot
    of additional work.


    One thing I wish was available in all languages is the ability to return multiple values from a function call so you can return both a status and
    the value(s) in one assignment. Ie: "a, b, c = demo_function(param1, param2);".

    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.

    Simon.


    Is there any real difference between your practice, and including a completion status parameter in the function call?

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to All on Wed Aug 21 22:16:33 2024
    On 8/20/2024 9:35 PM, Arne Vajhøj wrote:
    On 8/20/2024 9:25 PM, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 09:47:36 -0400, Arne Vajhøj wrote:
    Few languages support multiple return values.

    Even in C and Fortran, a function can return a struct.

    Yes. But that is returning a single value - just a composite value.

    It works fine, but it requires a custom type.

    Arne


    Hmmm ... what is wrong with a "custom type", or what I'd call a structure?

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to Lawrence D'Oliveiro on Wed Aug 21 22:17:41 2024
    On 8/20/2024 9:51 PM, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 21:35:44 -0400, Arne Vajhøj wrote:

    On 8/20/2024 9:25 PM, Lawrence D'Oliveiro wrote:

    On Tue, 20 Aug 2024 09:47:36 -0400, Arne Vajhøj wrote:

    Few languages support multiple return values.

    Even in C and Fortran, a function can return a struct.

    Yes. But that is returning a single value - just a composite value.

    The distinction between “multiple value” versus “single composite value”
    is an artificial one specific to languages like Lisp. Python, for example,
    is quite happy with constructs like

    a, b = struct.unpack("hh", b"\x00\x00\xff\xff")

    That's kind of ugly, isn't it?


    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to bill on Wed Aug 21 22:20:57 2024
    On 8/20/2024 1:34 PM, bill wrote:
    On 8/20/2024 8:36 AM, Simon Clubley wrote:
    On 2024-08-20, chrisq <devzero@nospam.com> wrote:

    I guess another complication is that some functions return
    -1, which implies a signed variable. To fix all that would require a
    complete rewrite of the library and probably most of the os and
    applications as well, so it will never happen. Just have to write
    unsigned equivalents, or slip functions with casts, but it's a lot
    of additional work.


    One thing I wish was available in all languages is the ability to return
    multiple values from a function call so you can return both a status and
    the value(s) in one assignment. Ie: "a, b, c = demo_function(param1, param2);".

    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.


    And probably much harder to understand in anything but the most
    trivial usage.

    bill



    Would that not be rather clear with adequate comments about what is being done?

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Dave Froble on Wed Aug 21 22:21:24 2024
    On 8/21/2024 10:16 PM, Dave Froble wrote:
    On 8/20/2024 9:35 PM, Arne Vajhøj wrote:
    On 8/20/2024 9:25 PM, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 09:47:36 -0400, Arne Vajhøj wrote:
    Few languages support multiple return values.

    Even in C and Fortran, a function can return a struct.

    Yes. But that is returning a single value - just a composite value.

    It works fine, but it requires a custom type.

    Hmmm ...  what is wrong with a "custom type", or what I'd call a structure?

    It adds code. Unnecessary code.

    It is a types added not because they exist in the business domain, but
    because there is a need to return a bundle of values.

    And the number of possible bundle types is huge.

    Multiple return values, generic tuple classes, real tuple etc. avoid
    all that.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to Simon Clubley on Wed Aug 21 22:22:10 2024
    On 8/20/2024 1:47 PM, Simon Clubley wrote:
    On 2024-08-20, bill <bill.gunshannon@gmail.com> wrote:
    On 8/20/2024 8:36 AM, Simon Clubley wrote:
    On 2024-08-20, chrisq <devzero@nospam.com> wrote:

    I guess another complication is that some functions return
    -1, which implies a signed variable. To fix all that would require a
    complete rewrite of the library and probably most of the os and
    applications as well, so it will never happen. Just have to write
    unsigned equivalents, or slip functions with casts, but it's a lot
    of additional work.


    One thing I wish was available in all languages is the ability to return >>> multiple values from a function call so you can return both a status and >>> the value(s) in one assignment. Ie: "a, b, c = demo_function(param1, param2);".

    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.


    And probably much harder to understand in anything but the most
    trivial usage.


    Huh ? Well that shows you haven't done this kind of thing. :-)

    If you are talking about PHP, you construct an associative array
    in the return statement of the function and then access the keys
    in the caller. Very clean.

    If you are talking about some future thing based on C, you simply
    extend the function prototype to include a list of return types
    instead of the single type it is at the moment and you just return
    the list in the function's return statement.

    $ set response/mode=good_natured

    Or are associative arrays and other higher-level data structures an alien concept to you ? :-)

    Uh ... sometimes ...

    :-)


    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Dave Froble on Wed Aug 21 22:24:18 2024
    On 8/21/2024 10:22 PM, Dave Froble wrote:
    On 8/20/2024 1:47 PM, Simon Clubley wrote:
    $ set response/mode=good_natured

    Or are associative arrays and other higher-level data structures an alien
    concept to you ? :-)

    Uh ... sometimes ...

    :-)

    You did do a little VB6/VB.NET many years ago?

    PHP associative arrays = VB6/VB.NET dictionaries

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to Dave Froble on Thu Aug 22 17:39:32 2024
    On 2024-08-21, Dave Froble <davef@tsoft-inc.com> wrote:
    On 8/20/2024 1:34 PM, bill wrote:
    On 8/20/2024 8:36 AM, Simon Clubley wrote:
    On 2024-08-20, chrisq <devzero@nospam.com> wrote:

    I guess another complication is that some functions return
    -1, which implies a signed variable. To fix all that would require a
    complete rewrite of the library and probably most of the os and
    applications as well, so it will never happen. Just have to write
    unsigned equivalents, or slip functions with casts, but it's a lot
    of additional work.


    One thing I wish was available in all languages is the ability to return >>> multiple values from a function call so you can return both a status and >>> the value(s) in one assignment. Ie: "a, b, c = demo_function(param1, param2);".

    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.


    And probably much harder to understand in anything but the most
    trivial usage.


    Would that not be rather clear with adequate comments about what is being done?


    Look at the example Arne posted. Very clean and very easy to understand
    without having to use comments (and I am actually a fan of the liberal
    use of comments. :-) ).

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to Dave Froble on Thu Aug 22 17:36:39 2024
    On 2024-08-21, Dave Froble <davef@tsoft-inc.com> wrote:
    On 8/20/2024 8:36 AM, Simon Clubley wrote:

    One thing I wish was available in all languages is the ability to return
    multiple values from a function call so you can return both a status and
    the value(s) in one assignment. Ie: "a, b, c = demo_function(param1, param2);".

    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.


    Is there any real difference between your practice, and including a completion
    status parameter in the function call?


    Yes. It's conceptually not a parameter. It's a result status that determines
    if the result returned is valid. Returning multiple values is also a lot cleaner and much more generic than having to add a parameter for each out
    value to be returned.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Thu Aug 22 16:25:21 2024
    On 8/22/2024 1:39 PM, Simon Clubley wrote:
    On 2024-08-21, Dave Froble <davef@tsoft-inc.com> wrote:
    On 8/20/2024 1:34 PM, bill wrote:
    On 8/20/2024 8:36 AM, Simon Clubley wrote:
    In languages with dynamic associative arrays (such as PHP), I simulate >>>> this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.

    And probably much harder to understand in anything but the most
    trivial usage.

    Would that not be rather clear with adequate comments about what is being done?

    Look at the example Arne posted. Very clean and very easy to understand without having to use comments (and I am actually a fan of the liberal
    use of comments. :-) ).

    The same example in older VB.NET:

    Imports System
    Imports System.Collections.Generic

    Namespace MR
    Public Class Program
    Public Shared Function FourOps(a As Double, b As Double) As IDictionary(Of String, Double)
    Dim res As New Dictionary(Of String, Double)()
    res("plus") = a + b
    res("minus") = a - b
    res("multiply") = a * b
    res("divide") = a / b
    Return res
    End Function
    Public Shared Sub Main(args As String())
    Dim a As Double = 3.0
    Dim b As Double = 2.0
    Dim res As IDictionary(Of String, Double) = FourOps(a, b)
    Console.WriteLine("{0} + {1} = {2}", a, b, res("plus"))
    Console.WriteLine("{0} - {1} = {2}", a, b, res("minus"))
    Console.WriteLine("{0} * {1} = {2}", a, b, res("multiply"))
    Console.WriteLine("{0} / {1} = {2}", a, b, res("divide"))
    Console.ReadKey()
    End Sub
    End Class
    End Namespace

    In newer VB.NET it looks like:

    Imports System
    Imports System.Collections.Generic

    Namespace MR
    Public Class Program
    Public Shared Function FourOps(a As Double, b As Double) As IDictionary(Of String, Double)
    Return New Dictionary(Of String, Double)() From { _
    {"plus", a + b}, _
    {"minus", a - b}, _
    {"multiply", a * b}, _
    {"divide", a / b} _
    }
    End Function
    Public Shared Sub Main(args As String())
    Dim a As Double = 3.0
    Dim b As Double = 2.0
    Dim res As IDictionary(Of String, Double) = FourOps(a, b)
    Console.WriteLine("{0} + {1} = {2}", a, b, res("plus"))
    Console.WriteLine("{0} - {1} = {2}", a, b, res("minus"))
    Console.WriteLine("{0} * {1} = {2}", a, b, res("multiply"))
    Console.WriteLine("{0} / {1} = {2}", a, b, res("divide"))
    Console.ReadKey()
    End Sub
    End Class
    End Namespace

    But I suspect that David as a Basic connoisseur consider that dictionary initializer syntax copied directly from C# an abomination - curly
    brackets is not real Basic.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From chrisq@21:1/5 to All on Fri Aug 23 00:12:18 2024
    On 8/21/24 19:13, Arne Vajhøj wrote:
    On 8/21/2024 8:26 AM, chrisq wrote:
    On 8/21/24 02:25, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 09:47:36 -0400, Arne Vajhøj wrote:
    Few languages support multiple return values.

    Even in C and Fortran, a function can return a struct.

    Better to declare the struct externally, then pass a pointer
    to it. Much tidier.

    In C one should definitely return a pointer to struct and not

    Problem is that of you return a pointer, that suggests that the
    struct has been declared static inside the called function. That
    would be a fail for reentant code that might be called from
    elsewhere, say, from an interrupt handler, or another thread.
    The struct would typically be on the stack or heap, and would
    disappear on return from the call, making the return value
    invalid. Ideally, in a multitasking os, all code should be
    designed to be fully reentrant, to make it safe in all
    situations.

    Chris

    a struct.

    It looks like VSI Fortran cannot return a structure as function
    result, but VSI Pascal can return a record as function result.

    And it is returned as a pointer argument under the hood.

    $ type s.pas
    module s;

    type
       iiituple = record
                     a : integer;
                     b : integer;
                     c : integer;
                 end;

    [global]
    function get : iiituple;

    var
       res : iiituple;

    begin
       res.a := 123;
       res.b := 456;
       res.c := 789;
       get := res;
    end;

    end.
    $ pas s
    $ type m.c
    #include <stdio.h>

    struct iiituple
    {
        int a;
        int b;
        int c;
    };

    void get(struct iiituple *res);

    int main()
    {
        struct iiituple res;
        get(&res);
        printf("%d %d %d\n", res.a, res.b, res.c);
        return 0;
    }
    $ cc m
    $ link m + s
    $ run m
    123 456 789

    Arne


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to chrisq on Thu Aug 22 19:21:07 2024
    On 8/22/2024 7:12 PM, chrisq wrote:
    On 8/21/24 19:13, Arne Vajhøj wrote:
    On 8/21/2024 8:26 AM, chrisq wrote:
    On 8/21/24 02:25, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 09:47:36 -0400, Arne Vajhøj wrote:
    Few languages support multiple return values.

    Even in C and Fortran, a function can return a struct.

    Better to declare the struct externally, then pass a pointer
    to it. Much tidier.

    In C one should definitely return a pointer to struct and not

    Problem is that of you return a pointer, that suggests that the
    struct has been declared static inside the called function. That
    would be a fail for reentant code that might be called from
    elsewhere, say, from an interrupt handler, or another thread.
    The struct would  typically be on the stack or heap, and would
    disappear on return from the call, making the return value
    invalid. Ideally, in a multitasking os, all code should be
    designed to be fully reentrant, to make it safe in all
    situations.

    My assumption would be that the struct was malloc'ed in
    the function.

    That obvious also has its problem. One can write in
    72 point bold red blinking font that it is the callers
    responsibility to call free and it will still be
    forgotten in some cases.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to chrisq on Fri Aug 23 00:45:06 2024
    On Fri, 23 Aug 2024 00:12:18 +0100, chrisq wrote:

    Problem is that of you return a pointer, that suggests that the struct
    has been declared static inside the called function. That would be a
    fail for reentant code that might be called from elsewhere, say, from an interrupt handler, or another thread. The struct would typically be on
    the stack or heap, and would disappear on return from the call, making
    the return value invalid. Ideally, in a multitasking os, all code should
    be designed to be fully reentrant, to make it safe in all situations.

    One notorious POSIX-related example is the crypt(3) function <https://manpages.debian.org/3/crypt.3.en.html>.

    I was helping a client reinstall some old proprietary app that had
    been running on an ancient machine that had crashed. For the new
    setup, we thought we’d try a slightly less ancient version of Debian
    (I think the original machine had been running Debian 4). But logins
    wouldn’t work. Even worse, the errors didn’t make sense: instead of
    saying that the username or password was invalid, it was reporting
    something crazy like errors to do with SELinux or something (we
    weren’t using SELinux).

    Finally, I made a wild, desperate guess: the code was copying the
    result from the crypt call into a fixed-size buffer, which wasn’t big
    enough to hold the hash for newer password algorithms. This was
    leading to a buffer overflow when hashing perfectly valid passwords,
    which in turn was corrupting some data elsewhere and triggering the
    spurious errors.

    So I had to try and find an older algorithm that the system still
    supported, which would bring the hash size within range, and use that
    hash for the relevant passwords.

    And that worked.

    You’ll see from the above man page that POSIX has no official solution
    to this problem: there are calls available in Linux (courtesy of the
    Openwall project) that will use dynamically-allocated buffers; but of
    course they will likely not be available on other systems that claim
    to be POSIX-compatible.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to Simon Clubley on Thu Aug 22 23:06:35 2024
    On 8/22/2024 1:39 PM, Simon Clubley wrote:
    On 2024-08-21, Dave Froble <davef@tsoft-inc.com> wrote:
    On 8/20/2024 1:34 PM, bill wrote:
    On 8/20/2024 8:36 AM, Simon Clubley wrote:
    On 2024-08-20, chrisq <devzero@nospam.com> wrote:

    I guess another complication is that some functions return
    -1, which implies a signed variable. To fix all that would require a >>>>> complete rewrite of the library and probably most of the os and
    applications as well, so it will never happen. Just have to write
    unsigned equivalents, or slip functions with casts, but it's a lot
    of additional work.


    One thing I wish was available in all languages is the ability to return >>>> multiple values from a function call so you can return both a status and >>>> the value(s) in one assignment. Ie: "a, b, c = demo_function(param1, param2);".

    In languages with dynamic associative arrays (such as PHP), I simulate >>>> this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.


    And probably much harder to understand in anything but the most
    trivial usage.


    Would that not be rather clear with adequate comments about what is being done?


    Look at the example Arne posted. Very clean and very easy to understand without having to use comments (and I am actually a fan of the liberal
    use of comments. :-) ).

    Simon.


    I find it rather difficult to determine WHY something is being done, just from the code.

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to arne@vajhoej.dk on Fri Aug 23 11:14:04 2024
    On Thu, 22 Aug 2024 19:21:07 -0400
    Arne Vajhj <arne@vajhoej.dk> wrote:

    On 8/22/2024 7:12 PM, chrisq wrote:
    On 8/21/24 19:13, Arne Vajhj wrote:
    On 8/21/2024 8:26 AM, chrisq wrote:
    On 8/21/24 02:25, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 09:47:36 -0400, Arne Vajhj wrote:
    Few languages support multiple return values.

    Even in C and Fortran, a function can return a struct.

    Better to declare the struct externally, then pass a pointer
    to it. Much tidier.

    In C one should definitely return a pointer to struct and not

    Problem is that of you return a pointer, that suggests that the
    struct has been declared static inside the called function. That
    would be a fail for reentant code that might be called from
    elsewhere, say, from an interrupt handler, or another thread.
    The struct would typically be on the stack or heap, and would
    disappear on return from the call, making the return value
    invalid. Ideally, in a multitasking os, all code should be
    designed to be fully reentrant, to make it safe in all
    situations.

    My assumption would be that the struct was malloc'ed in
    the function.

    That obvious also has its problem. One can write in
    72 point bold red blinking font that it is the callers
    responsibility to call free and it will still be
    forgotten in some cases.

    Arne


    Just admit that you was wrong and that the best option in C is the same
    as in many other languages - return the structure itself.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Michael S on Fri Aug 23 09:02:36 2024
    On 8/23/2024 4:14 AM, Michael S wrote:
    On Thu, 22 Aug 2024 19:21:07 -0400
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 8/22/2024 7:12 PM, chrisq wrote:
    On 8/21/24 19:13, Arne Vajhøj wrote:
    On 8/21/2024 8:26 AM, chrisq wrote:
    On 8/21/24 02:25, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 09:47:36 -0400, Arne Vajhøj wrote:
    Few languages support multiple return values.

    Even in C and Fortran, a function can return a struct.

    Better to declare the struct externally, then pass a pointer
    to it. Much tidier.

    In C one should definitely return a pointer to struct and not

    Problem is that of you return a pointer, that suggests that the
    struct has been declared static inside the called function. That
    would be a fail for reentant code that might be called from
    elsewhere, say, from an interrupt handler, or another thread.
    The struct would  typically be on the stack or heap, and would
    disappear on return from the call, making the return value
    invalid. Ideally, in a multitasking os, all code should be
    designed to be fully reentrant, to make it safe in all
    situations.

    My assumption would be that the struct was malloc'ed in
    the function.

    That obvious also has its problem. One can write in
    72 point bold red blinking font that it is the callers
    responsibility to call free and it will still be
    forgotten in some cases.

    Just admit that you was wrong

    I am often wrong so that is no big deal.

    and that the best option in C is the same
    as in many other languages - return the structure itself.

    Returning the struct itself result in a copy of the struct. The
    time to do the copy is probably insignificant though.

    Languages like (VMS) Pascal and (VMS) Basic do indeed return
    the record and make the copy.

    But newer languages (on VMS that would mostly be Java and other
    JVM languages but other platforms have more languages in this
    category) would dynamic allocate, return a reference/pointer
    and not worry about free because they use GC.

    I am not quite convinced yet.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Hoffman@21:1/5 to Simon Clubley on Fri Aug 23 11:33:41 2024
    On 2024-08-20 12:04:13 +0000, Simon Clubley said:

    On 2024-08-19, Arne Vajhj <arne@vajhoej.dk> wrote:

    Or if the application is passing pointers between code compiled with
    different languages/compilers/compiler settings.


    Of course, that is what ABIs are _supposed_ to be for...

    Or Swift and C/C++, or Zig and C/C++, which are intended to interoperate.


    --
    Pure Personal Opinion | HoffmanLabs LLC

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Hoffman@21:1/5 to chrisq on Fri Aug 23 11:32:03 2024
    On 2024-08-20 12:36:43 +0000, chrisq said:

    For work here, all functions that return data have a parameter that
    limits the byte count. Usually pass a pointer to a buffer, with the
    size parameter equal to or less than the buffer size. Some C library functions are just not safe to use in that respect.

    Local spun string copy and other functions use the same sort of size limiting.

    That, or preferably not transferring the data at all.

    Whether that happens with page table modifications, or shared buffers.

    Parts of OpenVMS are just chock full of buffer copies. (q.v. previous discussions of the buffer overhead incurred with faster network
    connections. From discussions here most of a decade ago: https://lwn.net/Articles/629155/ )

    And OpenVMS and apps have not-particularly-reentrant and not-particularly-performant code that calls some system service to
    first size the data and then allocate the buffer and then calls again
    to return the data. (Which is more glue code, as compared with
    returning an object containing the data, too. OpenVMS itself doesn't particularly have that concept, however.)

    OpenVMS has ~no concept of languages, either. Yeah, the C abd C++ I18N
    giblets, Java and its own little world, maybe using the existing and
    older ICU or maybe you ported a newer ICU, and the deprecated Terminal
    Fallback Facility (TFF) and National (Replacement) Character Set (NCS) giblets, sure. All of which make things more interesting for apps that
    want or need to deal with the UTF-8 and post-ASCII world.




    --
    Pure Personal Opinion | HoffmanLabs LLC

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Fri Aug 23 13:03:44 2024
    On 8/23/2024 9:02 AM, Arne Vajhøj wrote:
    On 8/23/2024 4:14 AM, Michael S wrote:
                        and that the best option in C is the same
    as in many other languages - return the structure itself.

    Returning the struct itself result in a copy of the struct. The
    time to do the copy is probably insignificant though.

    I am not quite convinced yet.

    It seems like one frequently provided reason for using pointer
    is ABI compatibility.

    I don't know about that. It is not that easy to create the
    problem.

    But it is possible:

    $ type i.h
    struct data
    {
    int a;
    int b;
    #ifdef NEWVERSION
    int c;
    #endif
    };

    $ type s1.c
    #include "i.h"

    struct data get()
    {
    struct data res;
    res.a = 123;
    res.b = 456;
    #ifdef NEWVERSION
    res.c = 0x7FFFFFFF;
    #endif
    return res;
    }

    $ type m1.c
    #include <stdio.h>

    #include "i.h"

    struct data get();

    int main()
    {
    struct data res = get();
    printf("%d %d\n", res.a, res.b);
    return 0;
    }
    $ type s2.c
    #include <stdlib.h>

    #include "i.h"

    struct data *get()
    {
    struct data *res = malloc(sizeof(struct data));
    res->a = 123;
    res->b = 456;
    #ifdef NEWVERSION
    res->c = 0x7FFFFFFF;
    #endif
    return res;
    }

    $ type m2.c
    #include <stdio.h>
    #include <stdlib.h>

    #include "i.h"

    struct data *get();

    int main()
    {
    struct data *res = get();
    printf("%d %d\n", res->a, res->b);
    free(res);
    return 0;
    }
    $ cc s1
    $ cc m1
    $ link m1 + s1
    $ run m1
    123 456
    $ cc/define="NEWVERSION" s1
    $ link m1 + s1
    $ run m1
    99108 0
    $ cc s2
    $ cc m2
    $ link m2 + s2
    $ run m2
    123 456
    $ cc/define="NEWVERSION" s2
    $ link m2 + s2
    $ run m2
    123 456

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Stephen Hoffman on Fri Aug 23 22:56:39 2024
    On Fri, 23 Aug 2024 11:33:41 -0400, Stephen Hoffman wrote:

    On 2024-08-20 12:04:13 +0000, Simon Clubley said:

    On 2024-08-19, Arne Vajhøj <arne@vajhoej.dk> wrote:

    Or if the application is passing pointers between code compiled with
    different languages/compilers/compiler settings.

    Of course, that is what ABIs are _supposed_ to be for...

    Or Swift and C/C++, or Zig and C/C++, which are intended to
    interoperate.

    There is a generic library called libffi to support this sort of thing for
    any language. For example, Python’s ctypes module is built on this.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Stephen Hoffman on Fri Aug 23 22:55:41 2024
    On Fri, 23 Aug 2024 11:32:03 -0400, Stephen Hoffman wrote:

    And OpenVMS and apps have not-particularly-reentrant and not-particularly-performant code that calls some system service to first
    size the data and then allocate the buffer and then calls again to
    return the data.

    I can mention examples from the Linux world, too. How else would you do
    it?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Stephen Hoffman on Fri Aug 23 19:34:18 2024
    On 8/23/2024 11:32 AM, Stephen Hoffman wrote:
    OpenVMS has ~no concept of languages, either. Yeah, the C abd C++ I18N giblets, Java and its own little world, maybe using the existing and
    older ICU or maybe you ported a newer ICU, and the deprecated Terminal Fallback Facility (TFF) and National (Replacement)  Character Set (NCS) giblets, sure. All of which make things more interesting for apps that
    want or need to deal with the UTF-8 and post-ASCII world.

    Regarding UTF-8 support, then my take is that:

    UTF-8 in file names, in usernames, in logicals, in identifiers and in programs/scripts: not really needed.

    UTF-8 in file content and in databases: very much needed.

    And support for the latter fall in 3 groups:
    * JVM languages (Java, Groovy etc.) and I believe Python - does
    support unicode and can read/write using any encoding including UTF-8
    * C, C++, PHP - developer keeps track of what encoding a byte
    sequence is in but possible to explicit convert encodings
    (C/C++ has wchar_t but it is neither much used nor UTF-8 friendly
    AFAIK)
    * the traditional native languages - very little support except what
    can be done by calling C functions

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Fri Aug 23 23:41:39 2024
    On Fri, 23 Aug 2024 19:34:18 -0400, Arne Vajhøj wrote:

    UTF-8 in file names, in usernames, in logicals, in identifiers and in programs/scripts: not really needed.

    I would say these are needed.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Fri Aug 23 19:59:26 2024
    On 8/23/2024 7:41 PM, Lawrence D'Oliveiro wrote:
    On Fri, 23 Aug 2024 19:34:18 -0400, Arne Vajhøj wrote:
    UTF-8 in file names, in usernames, in logicals, in identifiers and in
    programs/scripts: not really needed.

    I would say these are needed.

    I can live without the ability to create:

    blåbærsyltetøj.txt

    :-)

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Craig A. Berry@21:1/5 to All on Fri Aug 23 20:10:44 2024
    On 8/23/24 6:34 PM, Arne Vajhøj wrote:
    On 8/23/2024 11:32 AM, Stephen Hoffman wrote:
    OpenVMS has ~no concept of languages, either. Yeah, the C abd C++ I18N
    giblets, Java and its own little world, maybe using the existing and
    older ICU or maybe you ported a newer ICU, and the deprecated Terminal
    Fallback Facility (TFF) and National (Replacement)  Character Set
    (NCS) giblets, sure. All of which make things more interesting for
    apps that want or need to deal with the UTF-8 and post-ASCII world.

    Regarding UTF-8 support, then  my take is that:

    UTF-8 in file names, in usernames, in logicals, in identifiers and in programs/scripts: not really needed.

    UTF-8 in file content and in databases: very much needed.

    And support for the latter fall in 3 groups:
    * JVM languages (Java, Groovy etc.) and I believe Python - does
      support unicode and can read/write using any encoding including UTF-8

    Perl has excellent Unicode support. It even comes with piconv, an iconv application implemented in Perl that can do conversions.

    I'm told Unicode support in Python 2.x was pretty shaky but Python 3 is
    a lot better.

    * C, C++, PHP - developer keeps track of what encoding a byte
      sequence is in but possible to explicit convert encodings
      (C/C++ has wchar_t but it is neither much used nor UTF-8 friendly
      AFAIK)
    * the traditional native languages - very little support except what
      can be done by calling C functions

    and what can be done calling C functions is limited by the data in SYS$I18N_ICONV, which is about 20 years out of date. There have been a
    dozen major releases of the Unicode standard in that time.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Townley@21:1/5 to All on Sat Aug 24 01:52:02 2024
    On 24/08/2024 00:59, Arne Vajhøj wrote:
    On 8/23/2024 7:41 PM, Lawrence D'Oliveiro wrote:
    On Fri, 23 Aug 2024 19:34:18 -0400, Arne Vajhøj wrote:
    UTF-8 in file names, in usernames, in logicals, in identifiers and in
    programs/scripts: not really needed.

    I would say these are needed.

    I can live without the ability to create:

    blåbærsyltetøj.txt

    :-)

    Arne


    Is that Norwegian, or Swedish?
    :-)

    --
    Chris

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Chris Townley on Fri Aug 23 22:09:43 2024
    On 8/23/2024 8:52 PM, Chris Townley wrote:
    On 24/08/2024 00:59, Arne Vajhøj wrote:
    On 8/23/2024 7:41 PM, Lawrence D'Oliveiro wrote:
    On Fri, 23 Aug 2024 19:34:18 -0400, Arne Vajhøj wrote:
    UTF-8 in file names, in usernames, in logicals, in identifiers and in
    programs/scripts: not really needed.

    I would say these are needed.

    I can live without the ability to create:

    blåbærsyltetøj.txt

    :-)

    Is that Norwegian, or Swedish?
    :-)

    Danish.

    :-)

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Sat Aug 24 02:21:54 2024
    On Fri, 23 Aug 2024 19:59:26 -0400, Arne Vajhøj wrote:

    On 8/23/2024 7:41 PM, Lawrence D'Oliveiro wrote:

    On Fri, 23 Aug 2024 19:34:18 -0400, Arne Vajhøj wrote:

    UTF-8 in file names, in usernames, in logicals, in identifiers and in
    programs/scripts: not really needed.

    I would say these are needed.

    I can live without the ability to create:

    blåbærsyltetøj.txt

    Even restricting oneself to English, I would say this betrays a certain naïveté ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Fri Aug 23 22:23:18 2024
    On 8/23/2024 10:20 PM, Lawrence D'Oliveiro wrote:
    On Fri, 23 Aug 2024 20:10:44 -0500, Craig A. Berry wrote:
    I'm told Unicode support in Python 2.x was pretty shaky but Python 3 is
    a lot better.

    That was the primary motivation behind the Python 2→3 transition.

    Unicode was also the primary motivation behind PHP 5->6. But it
    got cancelled and PHP did 5->7 without going unicode.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Sat Aug 24 03:07:45 2024
    On Fri, 23 Aug 2024 22:23:18 -0400, Arne Vajhøj wrote:

    Unicode was also the primary motivation behind PHP 5->6. But it got
    cancelled and PHP did 5->7 without going unicode.

    To be fair, that little peccadillo does get lost in the avalanche of other reasons why PHP is bloody awful ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Craig A. Berry on Sat Aug 24 02:20:05 2024
    On Fri, 23 Aug 2024 20:10:44 -0500, Craig A. Berry wrote:

    I'm told Unicode support in Python 2.x was pretty shaky but Python 3 is
    a lot better.

    That was the primary motivation behind the Python 2→3 transition.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Single Stage to Orbit@21:1/5 to All on Sat Aug 24 11:55:13 2024
    On Fri, 2024-08-23 at 19:34 -0400, Arne Vajhøj wrote:
    UTF-8 in file names, in usernames, in logicals, in identifiers and in programs/scripts: not really needed.

    Everything needs to be utf8 aware. Not just text files. A good start
    would be to add utf8 aware functionality to VMS.
    --
    Tactical Nuclear Kittens

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Single Stage to Orbit@21:1/5 to Lawrence D'Oliveiro on Sat Aug 24 11:56:14 2024
    On Sat, 2024-08-24 at 03:07 +0000, Lawrence D'Oliveiro wrote:
    On Fri, 23 Aug 2024 22:23:18 -0400, Arne Vajhøj wrote:

    Unicode was also the primary motivation behind PHP 5->6. But it got cancelled and PHP did 5->7 without going unicode.

    To be fair, that little peccadillo does get lost in the avalanche of
    other reasons why PHP is bloody awful ...

    I'll drink to that.
    --
    Tactical Nuclear Kittens

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lars Poulsen@21:1/5 to All on Sat Aug 24 14:50:51 2024
    On 8/20/2024 8:36 AM, Simon Clubley wrote:
    One thing I wish was available in all languages is the ability to return
    multiple values from a function call so you can return both a status and
    the value(s) in one assignment. Ie: "a, b, c = demo_function(param1,
    param2);".

    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.

    On 8/20/2024 6:47 AM, Arne Vajhøj wrote:
    Few languages support multiple return values.

    And a few other languages support tuples with named fields
    or anonymous classes with named properties, which is almost as good.

    And almost all newer high level languages support
    map/dictionary/associative array.

    This is one of the many reasons I like PERL.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Lars Poulsen on Sat Aug 24 22:38:55 2024
    On Sat, 24 Aug 2024 14:50:51 -0700, Lars Poulsen wrote:

    This is one of the many reasons I like PERL.

    Perl completely changed the game with its combination of good regular expressions, good string handling, and good data structures as well. I
    credit Perl with popularizing the whole concept of regular expressions:
    before that, they were considered something esoteric.

    For example, BASIC was considered to have good string-handling facilities.
    But it never had good regular expressions or hash tables; and the coming
    of Perl made BASIC look quite old-fashioned indeed.

    On the other hand, Perl has a lot of subtleties to it that I never quite understood. When I started learning Python, I found that was just as
    powerful, but so much easier to understand.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Craig A. Berry@21:1/5 to Lars Poulsen on Sat Aug 24 17:54:17 2024
    On 8/24/24 4:50 PM, Lars Poulsen wrote:
    On 8/20/2024 8:36 AM, Simon Clubley wrote:
    One thing I wish was available in all languages is the ability to return >>> multiple values from a function call so you can return both a status and >>> the value(s) in one assignment. Ie: "a, b, c = demo_function(param1,
    param2);".

    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.

    On 8/20/2024 6:47 AM, Arne Vajhøj wrote:
    Few languages support multiple return values.

    And a few other languages support tuples with named fields
    or anonymous classes with named properties, which is almost as good.

    And almost all newer high level languages support
    map/dictionary/associative array.

    This is one of the many reasons I like PERL.

    And it can also return multiple values from a function, which was the
    start of this branch of the discussion:

    $ perl -e 'sub a {return (1,2);} my @x=a(); for my $x (@x) {print
    qq/$x\n/;}'
    1
    2

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Sat Aug 24 20:58:56 2024
    On 8/24/2024 8:37 PM, Lawrence D'Oliveiro wrote:
    On Sat, 24 Aug 2024 20:21:12 -0400, Arne Vajhøj wrote:
    On 8/24/2024 6:38 PM, Lawrence D'Oliveiro wrote:
    On Sat, 24 Aug 2024 14:50:51 -0700, Lars Poulsen wrote:
    This is one of the many reasons I like PERL.

    Perl completely changed the game with its combination of good regular
    expressions, good string handling, and good data structures as well. I
    credit Perl with popularizing the whole concept of regular expressions:
    before that, they were considered something esoteric.

    For example, BASIC was considered to have good string-handling
    facilities. But it never had good regular expressions or hash tables;
    and the coming of Perl made BASIC look quite old-fashioned indeed.

    80's and early 90's Basic flavors (and that include VMS Basic)
    did not have those.

    But later MS Basic flavors did have them:
    * VB/VBS/VBA has RegExp class and Scripting.Dictionary
    COM class
    * VB.NET has System.Text.RegularExpressions.Regex and
    System.Collections.Hashtable (later replaced by
    System.Collections.Generic.Dictionary)

    Did you really have to type those longwinded names that just to access
    them?

    In Python, it’s just “import re”.

    VB.NET like most modern languages use hierarchical
    packages/namespaces. That tend to make the names longer.

    But else it is pretty similar.

    Somewhere at the top:

    Import System.Collections.Generic
    Import System.Text.RegularExpressions

    and then:

    Dim d As New Dictionary(Of X,Y)()
    Dim r As New Regex(someregexexpr)

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Craig A. Berry on Sun Aug 25 00:21:47 2024
    On Sat, 24 Aug 2024 17:54:17 -0500, Craig A. Berry wrote:

    And it can also return multiple values from a function ...

    Why is that better than destructuring assignment?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Sun Aug 25 00:37:40 2024
    On Sat, 24 Aug 2024 20:21:12 -0400, Arne Vajhøj wrote:

    On 8/24/2024 6:38 PM, Lawrence D'Oliveiro wrote:

    On Sat, 24 Aug 2024 14:50:51 -0700, Lars Poulsen wrote:

    This is one of the many reasons I like PERL.

    Perl completely changed the game with its combination of good regular
    expressions, good string handling, and good data structures as well. I
    credit Perl with popularizing the whole concept of regular expressions:
    before that, they were considered something esoteric.

    For example, BASIC was considered to have good string-handling
    facilities. But it never had good regular expressions or hash tables;
    and the coming of Perl made BASIC look quite old-fashioned indeed.

    80's and early 90's Basic flavors (and that include VMS Basic)
    did not have those.

    But later MS Basic flavors did have them:
    * VB/VBS/VBA has RegExp class and Scripting.Dictionary
    COM class
    * VB.NET has System.Text.RegularExpressions.Regex and
    System.Collections.Hashtable (later replaced by
    System.Collections.Generic.Dictionary)

    Did you really have to type those longwinded names that just to access
    them?

    In Python, it’s just “import re”.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Sat Aug 24 20:21:12 2024
    On 8/24/2024 6:38 PM, Lawrence D'Oliveiro wrote:
    On Sat, 24 Aug 2024 14:50:51 -0700, Lars Poulsen wrote:
    This is one of the many reasons I like PERL.

    Perl completely changed the game with its combination of good regular expressions, good string handling, and good data structures as well. I
    credit Perl with popularizing the whole concept of regular expressions: before that, they were considered something esoteric.

    For example, BASIC was considered to have good string-handling facilities. But it never had good regular expressions or hash tables; and the coming
    of Perl made BASIC look quite old-fashioned indeed.

    80's and early 90's Basic flavors (and that include VMS Basic)
    did not have those.

    But later MS Basic flavors did have them:
    * VB/VBS/VBA has RegExp class and Scripting.Dictionary
    COM class
    * VB.NET has System.Text.RegularExpressions.Regex and
    System.Collections.Hashtable (later replaced by
    System.Collections.Generic.Dictionary)

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Hoffman@21:1/5 to Simon Clubley on Sat Aug 24 21:33:39 2024
    On 2024-08-20 12:36:51 +0000, Simon Clubley said:

    One thing I wish was available in all languages is the ability to
    return multiple values from a function call so you can return both a
    status and the value(s) in one assignment. Ie: "a, b, c = demo_function(param1, param2);".

    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.

    For those following along at home, C supports returning a struct.

    Languages including Swift allow returning an "optional", where you
    either get a value such as an object, or an indication or its absence.
    Swift uses the concept of "unwrapping" a result marked optional, which
    means you have to check before access.

    Returning objects is more widely available, and hides a lot of this
    mess, as well as hiding dealing with potentially-larger data buffers.
    Objects and message-passing is akin to itemlist-based APIs, dragged
    forward a few decades.

    In other languages, support for an optional requires explicit code,
    whether that might return a struct, or might return a value and a
    sentinel, or ilk.


    --
    Pure Personal Opinion | HoffmanLabs LLC

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Hoffman@21:1/5 to All on Sat Aug 24 22:12:55 2024
    On 2024-08-23 23:34:18 +0000, Arne Vajhøj said:

    On 8/23/2024 11:32 AM, Stephen Hoffman wrote:
    OpenVMS has ~no concept of languages, either. Yeah, the C abd C++ I18N
    giblets, Java and its own little world, maybe using the existing and
    older ICU or maybe you ported a newer ICU, and the deprecated Terminal
    Fallback Facility (TFF) and National (Replacement)  Character Set (NCS)
    giblets, sure. All of which make things more interesting for apps that
    want or need to deal with the UTF-8 and post-ASCII world.

    Regarding UTF-8 support, then my take is that:

    UTF-8 in file names, in usernames, in logicals, in identifiers and in programs/scripts: not really needed.

    UTF-8 filenames — poorly documented — already exists and was necessary
    for a key app or two, though the rendering is ugly.

    Working on a system that supports UTF-8 ~everywhere including within
    the shell and within various languages and apps makes things easier.

    Systems that don't provide that support mean more work. It's feasible,
    but it's work. Or it gets ignored, or implemented elsewhere.

    With the state of TFF, NCS, ICU, and the rest (on OpenVMS), I'd expect
    that all gets workarounds or hack-arounds, or gets ignored and ANSI /
    ISO Latin-1 used. That at least until the app gets ported off OpenVMS,
    or the app gets replaced.

    UTF-8 in file content and in databases: very much needed.

    And support for the latter fall in 3 groups:
    * JVM languages (Java, Groovy etc.) and I believe Python - does support unicode and can read/write using any encoding including UTF-8
    * C, C++, PHP - developer keeps track of what encoding a byte sequence
    is in but possible to explicit convert encodings
    (C/C++ has wchar_t but it is neither much used nor UTF-8 friendly AFAIK)

    Quoth the standard: "The width of wchar_t is compiler-specific and can
    be as small as 8 bits. Consequently, programs that need to be portable
    across any C or C++ compiler should not use wchar_t for storing Unicode
    text."

    * the traditional native languages - very little support except what
    can be done by calling C functions


    --
    Pure Personal Opinion | HoffmanLabs LLC

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Stephen Hoffman on Sat Aug 24 22:04:30 2024
    On 8/24/2024 9:33 PM, Stephen Hoffman wrote:
    On 2024-08-20 12:36:51 +0000, Simon Clubley said:
    One thing I wish was available in all languages is the ability to
    return multiple values from a function call so you can return both a
    status and the value(s) in one assignment. Ie: "a, b, c =
    demo_function(param1, param2);".

    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.

    For those following along at home, C supports returning a struct.

    Languages including Swift allow returning an "optional", where you
    either get a value such as an object, or an indication or its absence.
    Swift uses the concept of "unwrapping" a result marked optional, which
    means you have to check before access.

    Returning objects is more widely available, and hides a lot of this
    mess, as well as hiding dealing with potentially-larger data buffers.
    Objects and message-passing is akin to itemlist-based APIs, dragged
    forward a few decades.

    In other languages, support for an optional requires explicit code,
    whether that might return a struct, or might return a value and a
    sentinel, or ilk.

    I don't know Swift but I will assume Swift optional is similar to
    optional in other languages.

    It solves the return both status and value problem. But it is
    not a general multiple return value solution. And it is really
    just a small evolution of the traditional "return null
    indicate an error".

    $ type OptionalDemo.java
    import java.util.Optional;

    public class OptionalDemo {
    public static String oldStyleAPI(int v) {
    if(v > 0) {
    return Integer.toString(v);
    } else {
    return null;
    }
    }
    public static Optional<String> newStyleAPI(int v) {
    if(v > 0) {
    return Optional.of(Integer.toString(v));
    } else {
    return Optional.empty();
    }
    }
    public static void testOldStyleAPI(int v) {
    String s = oldStyleAPI(v);
    if(s != null) {
    System.out.println(s);
    } else {
    System.out.println("No result");
    }
    }
    public static void testNewStyleAPI(int v) {
    Optional<String> s = newStyleAPI(v);
    if(s.isPresent()) {
    System.out.println(s.get());
    } else {
    System.out.println("No result");
    }
    }
    public static void testNewStyleAPISmarter(int v) {
    Optional<String> s = newStyleAPI(v);
    System.out.println(s.orElse("No result"));
    }
    public static void main(String[] args) {
    testOldStyleAPI(123);
    testOldStyleAPI(0);
    testNewStyleAPI(123);
    testNewStyleAPI(0);
    testNewStyleAPISmarter(123);
    testNewStyleAPISmarter(0);
    }
    }
    $ javac OptionalDemo.java
    $ java "OptionalDemo"
    123
    No result
    123
    No result
    123
    No result

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Hoffman@21:1/5 to All on Sat Aug 24 22:32:42 2024
    On 2024-08-25 02:04:30 +0000, Arne Vajhj said:

    On 8/24/2024 9:33 PM, Stephen Hoffman wrote:
    On 2024-08-20 12:36:51 +0000, Simon Clubley said:
    One thing I wish was available in all languages is the ability to
    return multiple values from a function call so you can return both a
    status and the value(s) in one assignment. Ie: "a, b, c =
    demo_function(param1, param2);".

    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.

    For those following along at home, C supports returning a struct.

    Languages including Swift allow returning an "optional", where you
    either get a value such as an object, or an indication or its absence.
    Swift uses the concept of "unwrapping" a result marked optional, which
    means you have to check before access.

    Returning objects is more widely available, and hides a lot of this
    mess, as well as hiding dealing with potentially-larger data buffers.
    Objects and message-passing is akin to itemlist-based APIs, dragged
    forward a few decades.

    In other languages, support for an optional requires explicit code,
    whether that might return a struct, or might return a value and a
    sentinel, or ilk.

    I don't know Swift but I will assume Swift optional is similar to
    optional in other languages.

    It solves the return both status and value problem. But it is not a
    general multiple return value solution. And it is really just a small evolution of the traditional "return null indicate an error".

    That would be a Swift function that returns an object whether optional
    or not, or a function that returns multiple values whether optional or
    not.

    https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/


    The optional makes the developer's intent clear, and makes for less glue code.

    There are things I don't like about Swift, not the least of which is
    being a moving target.

    ObjC can return a null object, which is a somewhat different approach
    to this particular mess. Being built on C, ObjC can also return a
    struct.

    Objects and message passing and the CLR and NET, etc., are all
    different approaches toward the decoupling that itemlists and related
    baggage were intended to provide.



    --
    Pure Personal Opinion | HoffmanLabs LLC

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Sun Aug 25 02:36:29 2024
    On Sat, 24 Aug 2024 20:58:56 -0400, Arne Vajhøj wrote:

    On 8/24/2024 8:37 PM, Lawrence D'Oliveiro wrote:

    On Sat, 24 Aug 2024 20:21:12 -0400, Arne Vajhøj wrote:

    But later MS Basic flavors did have them:
    * VB/VBS/VBA has RegExp class and Scripting.Dictionary
    COM class
    * VB.NET has System.Text.RegularExpressions.Regex and
    System.Collections.Hashtable (later replaced by
    System.Collections.Generic.Dictionary)

    Did you really have to type those longwinded names that just to access
    them?

    In Python, it’s just “import re”.

    VB.NET like most modern languages use hierarchical
    packages/namespaces. That tend to make the names longer.

    Python does hierarchies, too. But it had the sense to use a short name for
    such a commonly-used package as “re”.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Stephen Hoffman on Sat Aug 24 22:43:40 2024
    On 8/24/2024 10:12 PM, Stephen Hoffman wrote:
    On 2024-08-23 23:34:18 +0000, Arne Vajhøj said:
    And support for the latter fall in 3 groups:
    * JVM languages (Java, Groovy etc.) and I believe Python - does
    support unicode and can read/write using any encoding including UTF-8
    * C, C++, PHP - developer keeps track of what encoding a byte sequence
    is in but possible to explicit convert encodings
       (C/C++ has wchar_t but it is neither much used nor UTF-8 friendly
    AFAIK)

    Quoth the standard: "The width of wchar_t is compiler-specific and can
    be as small as 8 bits. Consequently, programs that need to be portable
    across any C or C++ compiler should not use wchar_t for storing Unicode text."

    As usual the C standard is very vague in its definitions.

    wchar_t may not be generally portable. But it is 16 or 32
    bits on a few common platforms: Windows, Linux, various Unix,
    VMS etc.. Most irritating is that it is 16 bit on Windows and
    32 bit on the rest.

    To get more well defined types then one could use char16_t/char32_t,
    but I think library support sucks for those.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Stephen Hoffman on Sat Aug 24 22:39:44 2024
    On 8/24/2024 10:12 PM, Stephen Hoffman wrote:
    On 2024-08-23 23:34:18 +0000, Arne Vajhøj said:
    On 8/23/2024 11:32 AM, Stephen Hoffman wrote:
    OpenVMS has ~no concept of languages, either. Yeah, the C abd C++
    I18N giblets, Java and its own little world, maybe using the existing
    and older ICU or maybe you ported a newer ICU, and the deprecated
    Terminal Fallback Facility (TFF) and National (Replacement)
    Character Set (NCS) giblets, sure. All of which make things more
    interesting for apps that want or need to deal with the UTF-8 and
    post-ASCII world.

    Regarding UTF-8 support, then  my take is that:

    UTF-8 in file names, in usernames, in logicals, in identifiers and in
    programs/scripts: not really needed.

    UTF-8 filenames — poorly documented — already exists and was necessary for a key app or two, though the rendering is ugly.

    Working on a system that supports UTF-8 ~everywhere including within the shell and within various languages and apps makes things easier.

    Systems that don't provide that support mean more work. It's feasible,
    but it's work.  Or it gets ignored, or implemented elsewhere.

    I fully get the need for UTF-8 support in anything data related.
    For console/HTML/XML/JSON/YAML input/output then there is a functional
    need for UTF-8 support.

    But for all the implementation then I believe in keeping things
    English and ASCII.

    Filenames, database tablenames and fieldnames, program/script
    identifiers, VMS logicals etc.. Even comments should be
    in English (even though they may to use a little UTF-8 to
    reference various things).

    That is the safe choice for it being displayed correctly
    everywhere and being understandable by all future maintenance
    programmers.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Sat Aug 24 22:49:24 2024
    On 8/24/2024 10:47 PM, Lawrence D'Oliveiro wrote:
    On Sat, 24 Aug 2024 22:39:44 -0400, Arne Vajhøj wrote:
    I fully get the need for UTF-8 support in anything data related.

    I wonder what you would consider to *not* be “data related” ...

    Why wonder when I provided plenty of examples of what was
    in and what was out?

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Sun Aug 25 02:47:52 2024
    On Sat, 24 Aug 2024 22:39:44 -0400, Arne Vajhøj wrote:

    I fully get the need for UTF-8 support in anything data related.

    I wonder what you would consider to *not* be “data related” ...

    That is the safe choice for it being displayed correctly
    everywhere and being understandable by all future maintenance
    programmers.

    We can be sure that the future will, if anything, be even more Unicode- intensive than the present.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Sun Aug 25 02:37:38 2024
    On Sat, 24 Aug 2024 22:04:30 -0400, Arne Vajhøj wrote:

    But it is not a general multiple return value solution.

    Multiple return value does not seem as “general” as destructuring assignment.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Sun Aug 25 04:27:17 2024
    On Sat, 24 Aug 2024 22:49:24 -0400, Arne Vajhøj wrote:

    On 8/24/2024 10:47 PM, Lawrence D'Oliveiro wrote:

    On Sat, 24 Aug 2024 22:39:44 -0400, Arne Vajhøj wrote:
    .
    I fully get the need for UTF-8 support in anything data related.

    I wonder what you would consider to *not* be “data related” ...

    Why wonder when I provided plenty of examples of what was
    in and what was out?

    I didn’t see the connection. You don’t count “file names, in usernames, in
    logicals, in identifiers” as “data”?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Cross@21:1/5 to arne@vajhoej.dk on Sun Aug 25 11:07:15 2024
    In article <va26po$3d9f0$1@dont-email.me>,
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 8/20/2024 8:36 AM, Simon Clubley wrote:
    On 2024-08-20, chrisq <devzero@nospam.com> wrote:
    I guess another complication is that some functions return
    -1, which implies a signed variable. To fix all that would require a
    complete rewrite of the library and probably most of the os and
    applications as well, so it will never happen. Just have to write
    unsigned equivalents, or slip functions with casts, but it's a lot
    of additional work.

    One thing I wish was available in all languages is the ability to return
    multiple values from a function call so you can return both a status and
    the value(s) in one assignment. Ie: "a, b, c = demo_function(param1, param2);".

    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.

    Few languages support multiple return values.

    Nonsense. _Many_ languages do; just not ones that you are
    familiar with.

    And a few other languages support tuples with named fields
    or anonymous classes with named properties, which is almost as good.

    See above.

    And almost all newer high level languages support
    map/dictionary/associative array.

    What does this even mean? Many of these things have been
    supported by high(er)-level languages for decades. Perhaps
    you mean as a first-class object in the language, and not
    simply via a library?

    - Dan C.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Cross@21:1/5 to arne@vajhoej.dk on Sun Aug 25 11:10:19 2024
    In article <vae3fe$1j523$1@dont-email.me>,
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 8/24/2024 9:33 PM, Stephen Hoffman wrote:
    On 2024-08-20 12:36:51 +0000, Simon Clubley said:
    One thing I wish was available in all languages is the ability to
    return multiple values from a function call so you can return both a
    status and the value(s) in one assignment. Ie: "a, b, c =
    demo_function(param1, param2);".

    In languages with dynamic associative arrays (such as PHP), I simulate
    this by returning an associative array from a function call with both
    status and value fields. Makes coding _so_ much cleaner and robust.

    For those following along at home, C supports returning a struct.

    Languages including Swift allow returning an "optional", where you
    either get a value such as an object, or an indication or its absence.
    Swift uses the concept of "unwrapping" a result marked optional, which
    means you have to check before access.

    Returning objects is more widely available, and hides a lot of this
    mess, as well as hiding dealing with potentially-larger data buffers.
    Objects and message-passing is akin to itemlist-based APIs, dragged
    forward a few decades.

    In other languages, support for an optional requires explicit code,
    whether that might return a struct, or might return a value and a
    sentinel, or ilk.

    I don't know Swift but I will assume Swift optional is similar to
    optional in other languages.

    It solves the return both status and value problem. But it is
    not a general multiple return value solution. And it is really
    just a small evolution of the traditional "return null
    indicate an error".

    [snip overly long Java sequence]

    What a failure of imagination. When you have the Maybe monad,
    it actually opens up a lot of ground for abstraction. https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/

    - Dan C.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Sun Aug 25 09:51:29 2024
    On 8/25/2024 12:27 AM, Lawrence D'Oliveiro wrote:
    On Sat, 24 Aug 2024 22:49:24 -0400, Arne Vajhøj wrote:
    On 8/24/2024 10:47 PM, Lawrence D'Oliveiro wrote:
    On Sat, 24 Aug 2024 22:39:44 -0400, Arne Vajhøj wrote:
    I fully get the need for UTF-8 support in anything data related.

    I wonder what you would consider to *not* be “data related” ...

    Why wonder when I provided plenty of examples of what was
    in and what was out?

    I didn’t see the connection. You don’t count “file names, in usernames, in
    logicals, in identifiers” as “data”?

    No. Or at least not in the business relevant sense.

    The users care that the XML file get delivered in an encoding that
    the recipient system can parse correctly. They do not care what
    identifiers are used in the program creating it and they probably
    prefer the filename to be something not causing problems anywhere
    (all ASCII, no spaces etc.).

    Seen from their perspective what is in that XML file is data - all
    the surrounding stuff is not. Obviously the source code and
    file system are data from the compiler and OS perspective. But
    the OS and compiler got purchased to deliver that XML file to
    the users.

    It may likely be a requirement to sell the system that it can produce
    a file with <data>Blåbærsyltetøj</data>.

    It is highly unlikely to impact the sale whether the file can
    be named Blåbærsyltetøj.txt and whether the file handle in the
    program can be called Blåbærsyltetøjfile.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Sun Aug 25 10:22:27 2024
    On 8/24/2024 10:36 PM, Lawrence D'Oliveiro wrote:
    On Sat, 24 Aug 2024 20:58:56 -0400, Arne Vajhøj wrote:
    On 8/24/2024 8:37 PM, Lawrence D'Oliveiro wrote:
    On Sat, 24 Aug 2024 20:21:12 -0400, Arne Vajhøj wrote:
    But later MS Basic flavors did have them:
    * VB/VBS/VBA has RegExp class and Scripting.Dictionary
    COM class
    * VB.NET has System.Text.RegularExpressions.Regex and
    System.Collections.Hashtable (later replaced by
    System.Collections.Generic.Dictionary)

    Did you really have to type those longwinded names that just to access
    them?

    In Python, it’s just “import re”.

    VB.NET like most modern languages use hierarchical
    packages/namespaces. That tend to make the names longer.

    Python does hierarchies, too.

    Python modules are not exactly like packages/namespaces, but
    OK close.

    But it had the sense to use a short name for such a commonly-used package as “re”.

    I guess there are two approaches to naming:

    shorter is better -> less typing and smaller files

    more explanatory is better -> easier maintenance

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to Lawrence D'Oliveiro on Sun Aug 25 11:36:58 2024
    On 8/23/2024 7:41 PM, Lawrence D'Oliveiro wrote:
    On Fri, 23 Aug 2024 19:34:18 -0400, Arne Vajhøj wrote:

    UTF-8 in file names, in usernames, in logicals, in identifiers and in
    programs/scripts: not really needed.

    I would say these are needed.


    I have to ask, why?

    All the objects mentioned by Arne are in simple terms 'tokens' to represent some
    object. I see no reason for the elements in such tokens to be more complex than
    required. Perhaps a bit more complex than the "A", "B", "C", etc of WEENDOZE disk names. But needing everything every user might dream up? I don't see the benefit. Other than perhaps stubbornness and ego of some particular user. It just defies the KISS principal, which I find to be useful.

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to Chris Townley on Sun Aug 25 11:38:19 2024
    On 8/23/2024 8:52 PM, Chris Townley wrote:
    On 24/08/2024 00:59, Arne Vajhøj wrote:
    On 8/23/2024 7:41 PM, Lawrence D'Oliveiro wrote:
    On Fri, 23 Aug 2024 19:34:18 -0400, Arne Vajhøj wrote:
    UTF-8 in file names, in usernames, in logicals, in identifiers and in
    programs/scripts: not really needed.

    I would say these are needed.

    I can live without the ability to create:

    blåbærsyltetøj.txt

    :-)

    Arne


    Is that Norwegian, or Swedish?
    :-)


    If you have to ask, then it most likely is more complex than needed.

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to Single Stage to Orbit on Sun Aug 25 11:42:24 2024
    On 8/24/2024 6:55 AM, Single Stage to Orbit wrote:
    On Fri, 2024-08-23 at 19:34 -0400, Arne Vajhøj wrote:
    UTF-8 in file names, in usernames, in logicals, in identifiers and in
    programs/scripts: not really needed.

    Everything needs to be utf8 aware. Not just text files. A good start
    would be to add utf8 aware functionality to VMS.


    I have to ask, why? What benefit comes from the OS, services, other OS specific
    objects, might there be in having the OS itself and it's parts supporting such? Forget desires, concentrate on benefits.

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to All on Sun Aug 25 11:45:13 2024
    On 8/24/2024 10:39 PM, Arne Vajhøj wrote:
    On 8/24/2024 10:12 PM, Stephen Hoffman wrote:
    On 2024-08-23 23:34:18 +0000, Arne Vajhøj said:
    On 8/23/2024 11:32 AM, Stephen Hoffman wrote:
    OpenVMS has ~no concept of languages, either. Yeah, the C abd C++ I18N >>>> giblets, Java and its own little world, maybe using the existing and older >>>> ICU or maybe you ported a newer ICU, and the deprecated Terminal Fallback >>>> Facility (TFF) and National (Replacement) Character Set (NCS) giblets, >>>> sure. All of which make things more interesting for apps that want or need >>>> to deal with the UTF-8 and post-ASCII world.

    Regarding UTF-8 support, then my take is that:

    UTF-8 in file names, in usernames, in logicals, in identifiers and in
    programs/scripts: not really needed.

    UTF-8 filenames — poorly documented — already exists and was necessary for a
    key app or two, though the rendering is ugly.

    Working on a system that supports UTF-8 ~everywhere including within the shell
    and within various languages and apps makes things easier.

    Systems that don't provide that support mean more work. It's feasible, but >> it's work. Or it gets ignored, or implemented elsewhere.

    I fully get the need for UTF-8 support in anything data related.
    For console/HTML/XML/JSON/YAML input/output then there is a functional
    need for UTF-8 support.

    But for all the implementation then I believe in keeping things
    English and ASCII.

    Filenames, database tablenames and fieldnames, program/script
    identifiers, VMS logicals etc.. Even comments should be
    in English (even though they may to use a little UTF-8 to
    reference various things).

    That is the safe choice for it being displayed correctly
    everywhere and being understandable by all future maintenance
    programmers.

    Arne


    +1

    Why buy more trouble, when you already have more than enough?

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to Lawrence D'Oliveiro on Sun Aug 25 11:46:32 2024
    On 8/25/2024 12:27 AM, Lawrence D'Oliveiro wrote:
    On Sat, 24 Aug 2024 22:49:24 -0400, Arne Vajhøj wrote:

    On 8/24/2024 10:47 PM, Lawrence D'Oliveiro wrote:

    On Sat, 24 Aug 2024 22:39:44 -0400, Arne Vajhøj wrote:
    .
    I fully get the need for UTF-8 support in anything data related.

    I wonder what you would consider to *not* be “data related” ...

    Why wonder when I provided plenty of examples of what was
    in and what was out?

    I didn’t see the connection. You don’t count “file names, in usernames, in
    logicals, in identifiers” as “data”?


    Nope!

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Sun Aug 25 13:51:11 2024
    On 8/24/2024 10:04 PM, Arne Vajhøj wrote:
    $ type OptionalDemo.java
    import java.util.Optional;

    public class OptionalDemo {
    ...
        public static void main(String[] args) {
            testOldStyleAPI(123);
            testOldStyleAPI(0);
            testNewStyleAPI(123);
            testNewStyleAPI(0);
            testNewStyleAPISmarter(123);
            testNewStyleAPISmarter(0);
        }
    }
    $ javac OptionalDemo.java
    $ java "OptionalDemo"
    123
    No result
    123
    No result
    123
    No result

    The code becomes a little shorter in Kotlin.

    $ type OptionalDemo.kt
    import java.util.*

    fun oldStyleAPI(v: Int): String? {
    return if(v > 0) v.toString() else null;
    }

    fun newStyleAPI(v: Int): Optional<String> {
    return if(v > 0) Optional.of(v.toString()) else Optional.empty();
    }

    fun testOldStyleAPI(v: Int) {
    println(oldStyleAPI(v) ?: "No Result")
    }

    fun testNewStyleAPI(v: Int) {
    println(newStyleAPI(v).orElse("No Result"))
    }

    fun main() {
    testOldStyleAPI(123)
    testOldStyleAPI(0)
    testNewStyleAPI(123)
    testNewStyleAPI(0)
    }

    $ kotlinc "OptionalDemo.kt"
    $ kotlin "OptionalDemoKt"
    123
    No Result
    123
    No Result

    Kotlin 1.9.10 on VMS x86-64. Works fine - just make sure
    the source files are in stmlf format!

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Sun Aug 25 23:37:49 2024
    On Sun, 25 Aug 2024 10:22:27 -0400, Arne Vajhøj wrote:

    Python modules are not exactly like packages/namespaces, but OK close.

    Python does have package namespaces. You can do longwinded Java-style hierarchies, if you want. It’s just not common.

    I guess there are two approaches to naming:

    shorter is better -> less typing and smaller files

    There is another useful approach, and that is

    import «long-winded-name» as «short-name»

    Python supports this, too.

    Java, which needs it more, doesn’t.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Sun Aug 25 20:40:48 2024
    On 8/25/2024 7:37 PM, Lawrence D'Oliveiro wrote:
    On Sun, 25 Aug 2024 10:22:27 -0400, Arne Vajhøj wrote:
    Python modules are not exactly like packages/namespaces, but OK close.

    Python does have package namespaces. You can do longwinded Java-style hierarchies, if you want. It’s just not common.

    Python modules does way more than C++/C#/VB.NET namespaces and Java
    packages.

    The latter are a pure name thing. And the using/imports/import
    is a name abbreviation only thing.

    VB.NET:

    Imports x

    is not the equivalent of Python:

    import x

    It is (mostly) the equivalent to the difference between:

    import x

    and:

    from x import *

    .NET assemblies and Java jars/Java 9 modules/OSGI modules provide
    some of the extra functionality that Python modules has over
    pure namespaces.

    I guess there are two approaches to naming:

    shorter is better -> less typing and smaller files

    There is another useful approach, and that is

    import «long-winded-name» as «short-name»

    Python supports this, too.

    Java, which needs it more, doesn’t.

    Lot of languages support that feature.

    C++, C#, VB.NET, Kotlin, Groovy, Scala etc..

    But Java does not.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Hoffman@21:1/5 to All on Sun Aug 25 22:41:37 2024
    On 2024-08-25 02:39:44 +0000, Arne Vajhøj said:

    On 8/24/2024 10:12 PM, Stephen Hoffman wrote:
    On 2024-08-23 23:34:18 +0000, Arne Vajhøj said:
    On 8/23/2024 11:32 AM, Stephen Hoffman wrote:
    OpenVMS has ~no concept of languages, either. Yeah, the C abd C++ I18N >>>> giblets, Java and its own little world, maybe using the existing and
    older ICU or maybe you ported a newer ICU, and the deprecated Terminal >>>> Fallback Facility (TFF) and National (Replacement) Character Set (NCS) >>>> giblets, sure. All of which make things more interesting for apps that >>>> want or need to deal with the UTF-8 and post-ASCII world.

    Regarding UTF-8 support, then  my take is that:

    UTF-8 in file names, in usernames, in logicals, in identifiers and in
    programs/scripts: not really needed.

    UTF-8 filenames — poorly documented — already exists and was necessary >> for a key app or two, though the rendering is ugly.

    Working on a system that supports UTF-8 ~everywhere including within
    the shell and within various languages and apps makes things easier.

    Systems that don't provide that support mean more work. It's feasible,
    but it's work.  Or it gets ignored, or implemented elsewhere.

    I fully get the need for UTF-8 support in anything data related.
    For console/HTML/XML/JSON/YAML input/output then there is a functional
    need for UTF-8 support.

    But for all the implementation then I believe in keeping things English
    and ASCII.

    Filenames, database tablenames and fieldnames, program/script
    identifiers, VMS logicals etc.. Even comments should bein English (even though they may to use a little UTF-8 to reference various things).

    That is the safe choice for it being displayed correctly everywhere and
    being understandable by all future maintenance programmers.

    If by "safe" you mean another in a series of easy but inevitably bad
    choices, and those choices that will confuse and frustrate future
    maintenance programmers, sure.

    But again, UTF-8 support is already implemented in the OpenVMS file
    system, already in use, and with the usual pile of compatibility hacks.



    --
    Pure Personal Opinion | HoffmanLabs LLC

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Hoffman@21:1/5 to Dave Froble on Sun Aug 25 23:05:40 2024
    On 2024-08-25 15:36:58 +0000, Dave Froble said:

    All the objects mentioned by Arne are in simple terms 'tokens' to
    represent some object. I see no reason for the elements in such tokens
    to be more complex than required. Perhaps a bit more complex than the
    "A", "B", "C", etc of WEENDOZE disk names. But needing everything
    every user might dream up? I don't see the benefit. Other than
    perhaps stubbornness and ego of some particular user. It just defies
    the KISS principal, which I find to be useful.

    That ship sailed. Those ships. The KISS ship. The compatibility ship.
    And the Unicode filename ship.

    Common platforms including OpenVMS already support Unicode filenames,
    and some OpenVMS configurations already use those Unicode names.

    The only difference is that OpenVMS display "keeps it simple", by
    avoiding using the native Unicode name displays to showing those using
    encoded DEC MCS (^UP^) displays.

    If y'all have an app design that stores its files using UUIDs as names
    or whatever, then by all means, continue with that design.

    Pragmatically, UUIDs may be better than what MAIL chose to use. But I digress.

    Depending on how (where) you look at things, the OpenVMS file names can
    be UTF-8 or UCS-2 or VTF-7, too. Various of which'll be "fun" for
    sort-ordering filenames, too. And sorting is language-specific, too.
    But I digress.

    That the filenames are stored using laser-etched cuneiform is an
    implementation detail. But between the ^ escaping and the ^UP^ and the pseudonames — and of course those wonderful DECC logical names misused
    as a configuration mechanism that can control or destabilize various
    apps entirely out-of-band — more than a few OpenVMS command
    procedures, as well as other interpreters and compiled apps have to be
    aware of the rules. There's unfortunately not even a conversion or
    fallback API or related around either, AFAIK.

    Yes, KISS is a laudable goal. So too is compatibility.

    I don't expect any of this to get overhauled or fixed or updated, of
    course. Certainly not before the existing two terabyte ODS file system
    gets overhauled.


    --
    Pure Personal Opinion | HoffmanLabs LLC

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Mon Aug 26 05:43:59 2024
    On Sun, 25 Aug 2024 20:40:48 -0400, Arne Vajhøj wrote:

    Python modules does way more than C++/C#/VB.NET namespaces and Java
    packages.

    In Python, modules are first-class objects.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to Stephen Hoffman on Mon Aug 26 11:11:25 2024
    On 8/25/2024 11:05 PM, Stephen Hoffman wrote:
    On 2024-08-25 15:36:58 +0000, Dave Froble said:

    All the objects mentioned by Arne are in simple terms 'tokens' to represent >> some object. I see no reason for the elements in such tokens to be more
    complex than required. Perhaps a bit more complex than the "A", "B", "C", etc
    of WEENDOZE disk names. But needing everything every user might dream up? I
    don't see the benefit. Other than perhaps stubbornness and ego of some
    particular user. It just defies the KISS principal, which I find to be useful.

    That ship sailed. Those ships. The KISS ship. The compatibility ship. And the Unicode filename ship.

    Just because something is possible doesn't mean it should be used. DDT is possible, and look at all the problems that came from that.

    Common platforms including OpenVMS already support Unicode filenames, and some
    OpenVMS configurations already use those Unicode names.

    The only difference is that OpenVMS display "keeps it simple", by avoiding using
    the native Unicode name displays to showing those using encoded DEC MCS (^UP^)
    displays.

    If y'all have an app design that stores its files using UUIDs as names or whatever, then by all means, continue with that design.

    Pragmatically, UUIDs may be better than what MAIL chose to use. But I digress.

    Depending on how (where) you look at things, the OpenVMS file names can be UTF-8
    or UCS-2 or VTF-7, too. Various of which'll be "fun" for sort-ordering filenames, too. And sorting is language-specific, too. But I digress.

    See the problems you just mentioned? KISS !!

    That the filenames are stored using laser-etched cuneiform is an implementation
    detail. But between the ^ escaping and the ^UP^ and the pseudonames — and of
    course those wonderful DECC logical names misused as a configuration mechanism
    that can control or destabilize various apps entirely out-of-band — more than a
    few OpenVMS command procedures, as well as other interpreters and compiled apps
    have to be aware of the rules. There's unfortunately not even a conversion or fallback API or related around either, AFAIK.

    Yes, KISS is a laudable goal. So too is compatibility.

    When appropriate.

    I don't expect any of this to get overhauled or fixed or updated, of course. Certainly not before the existing two terabyte ODS file system gets overhauled.

    Now there is something that would have real benefits.


    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to Lawrence D'Oliveiro on Tue Aug 27 12:14:42 2024
    On 2024-08-24, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:

    On the other hand, Perl has a lot of subtleties to it that I never quite understood. When I started learning Python, I found that was just as powerful, but so much easier to understand.

    Perl is what you lean when you don't find TECO to be challenging enough. :-)

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to arne@vajhoej.dk on Tue Aug 27 12:26:32 2024
    On 2024-08-23, Arne Vajhj <arne@vajhoej.dk> wrote:
    On 8/23/2024 11:32 AM, Stephen Hoffman wrote:
    OpenVMS has ~no concept of languages, either. Yeah, the C abd C++ I18N
    giblets, Java and its own little world, maybe using the existing and
    older ICU or maybe you ported a newer ICU, and the deprecated Terminal
    Fallback Facility (TFF) and National (Replacement) Character Set (NCS)
    giblets, sure. All of which make things more interesting for apps that
    want or need to deal with the UTF-8 and post-ASCII world.

    Regarding UTF-8 support, then my take is that:

    UTF-8 in file names, in usernames, in logicals, in identifiers and in programs/scripts: not really needed.


    Some possible examples:

    Train_Timetable_Flm_to_Hnefoss.pdf

    or (in a filesystem):

    /data/sites/Flm/
    /data/sites/Hnefoss/
    /data/sites/Bod/

    How do you think these should be handled ?

    Not every location on the planet is restricted to using US-ASCII naming.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Dallman@21:1/5 to D'Oliveiro on Tue Aug 27 13:40:00 2024
    In article <vadndu$1igfq$1@dont-email.me>, ldo@nz.invalid (Lawrence
    D'Oliveiro) wrote:

    On the other hand, Perl has a lot of subtleties to it that I never
    quite understood. When I started learning Python, I found that was
    just as powerful, but so much easier to understand.

    The two languages are fine examples of different kinds of "simplicity".

    Perl has a smaller vocabulary of keywords, but they can be used in a vast
    range of combinations.

    Python has a huge vocabulary, but the keywords do pretty specific things,
    and until you learn the keywords for an idiom or pattern, you can't use
    that pattern.

    I find Python frustrating, because the documentation is so determined to
    tell you about the way in which keywords differ in various versions of
    the language that I have trouble finding the keywords I need for a task.
    The language has so many keywords that I'm not really interested in
    learning all of them at my advanced age.

    Perl feels like C to me; Python feels like Basic or COBOL.

    John

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to Single Stage to Orbit on Tue Aug 27 12:35:28 2024
    On 2024-08-24, Single Stage to Orbit <alex.buell@munted.eu> wrote:
    On Sat, 2024-08-24 at 03:07 +0000, Lawrence D'Oliveiro wrote:
    On Fri, 23 Aug 2024 22:23:18 -0400, Arne Vajhj wrote:

    Unicode was also the primary motivation behind PHP 5->6. But it got
    cancelled and PHP did 5->7 without going unicode.

    To be fair, that little peccadillo does get lost in the avalanche of
    other reasons why PHP is bloody awful ...

    I'll drink to that.

    When doing PHP work, I have created a monitor library that runs at the
    start of every PHP script I create and monitors the script for errors
    that the PHP language lets through by default (and bloody well should not).

    It routinely catches stupid mistakes that PHP would otherwise let through
    and that would have caused additional debugging effort.

    No, I am not allowed to share it unfortunately.

    I do NOT like PHP, but I am forced to use it for some of my work because
    of its established ecosystem.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Tue Aug 27 08:44:09 2024
    On 8/27/2024 8:26 AM, Simon Clubley wrote:
    On 2024-08-23, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 8/23/2024 11:32 AM, Stephen Hoffman wrote:
    OpenVMS has ~no concept of languages, either. Yeah, the C abd C++ I18N
    giblets, Java and its own little world, maybe using the existing and
    older ICU or maybe you ported a newer ICU, and the deprecated Terminal
    Fallback Facility (TFF) and National (Replacement)  Character Set (NCS) >>> giblets, sure. All of which make things more interesting for apps that
    want or need to deal with the UTF-8 and post-ASCII world.

    Regarding UTF-8 support, then my take is that:

    UTF-8 in file names, in usernames, in logicals, in identifiers and in
    programs/scripts: not really needed.


    Some possible examples:

    Train_Timetable_Flåm_to_Hønefoss.pdf

    or (in a filesystem):

    /data/sites/Flåm/
    /data/sites/Hønefoss/
    /data/sites/Bodø/

    How do you think these should be handled ?

    Not every location on the planet is restricted to using US-ASCII naming.

    You transscribe them per common rules.

    å -> aa
    ø -> oe

    The IT people should not have any problems with that.

    And the non-IT people should not be exposed to this.

    More like:

    <a href="Train_Timetable_Flaam_to_Hoenefoss.pdf">Train Timetable Flåm to Hønefoss (in PDF format)</a>

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to Dave Froble on Tue Aug 27 12:54:12 2024
    On 2024-08-25, Dave Froble <davef@tsoft-inc.com> wrote:
    On 8/23/2024 7:41 PM, Lawrence D'Oliveiro wrote:
    On Fri, 23 Aug 2024 19:34:18 -0400, Arne Vajhj wrote:

    UTF-8 in file names, in usernames, in logicals, in identifiers and in
    programs/scripts: not really needed.

    I would say these are needed.


    I have to ask, why?

    All the objects mentioned by Arne are in simple terms 'tokens' to represent some
    object. I see no reason for the elements in such tokens to be more complex than
    required. Perhaps a bit more complex than the "A", "B", "C", etc of WEENDOZE disk names. But needing everything every user might dream up? I don't see the
    benefit. Other than perhaps stubbornness and ego of some particular user. It
    just defies the KISS principal, which I find to be useful.


    If I had said "that there was no need for UTF-8 because we will just have people use British English from now on", then how do you think that would
    have come across ?

    Yet you have just done the same David. You have just said that if it is
    not used in US English then it is not important and the rest of the world should just learn to restrict itself to US ASCII characters in their use
    of filenames, etc.

    Contrary to what you Americans believe, the world is MUCH more than just
    a single country called the United States. A country that, due to its
    own failings and short sightedness, is no longer master of its own destiny.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to Dave Froble on Tue Aug 27 13:01:48 2024
    On 2024-08-25, Dave Froble <davef@tsoft-inc.com> wrote:
    On 8/23/2024 8:52 PM, Chris Townley wrote:
    On 24/08/2024 00:59, Arne Vajhj wrote:
    On 8/23/2024 7:41 PM, Lawrence D'Oliveiro wrote:
    On Fri, 23 Aug 2024 19:34:18 -0400, Arne Vajhj wrote:
    UTF-8 in file names, in usernames, in logicals, in identifiers and in >>>>> programs/scripts: not really needed.

    I would say these are needed.

    I can live without the ability to create:

    blbrsyltetj.txt

    :-)

    Arne


    Is that Norwegian, or Swedish?
    :-)


    If you have to ask, then it most likely is more complex than needed.


    No, it just means you live in a small part of the planet that you wrongly
    think is the whole world.

    IOW, only an American could have made that comment. :-)

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to Dave Froble on Tue Aug 27 13:04:29 2024
    On 2024-08-25, Dave Froble <davef@tsoft-inc.com> wrote:
    On 8/24/2024 6:55 AM, Single Stage to Orbit wrote:
    On Fri, 2024-08-23 at 19:34 -0400, Arne Vajhj wrote:
    UTF-8 in file names, in usernames, in logicals, in identifiers and in
    programs/scripts: not really needed.

    Everything needs to be utf8 aware. Not just text files. A good start
    would be to add utf8 aware functionality to VMS.


    I have to ask, why? What benefit comes from the OS, services, other OS specific
    objects, might there be in having the OS itself and it's parts supporting such?
    Forget desires, concentrate on benefits.


    I have posted some examples of places with non-US characters in them
    in response to Arne.

    What do _you_ think filenames based on these places should be called ?

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Tue Aug 27 09:15:54 2024
    On 8/27/2024 8:54 AM, Simon Clubley wrote:
    On 2024-08-25, Dave Froble <davef@tsoft-inc.com> wrote:
    On 8/23/2024 7:41 PM, Lawrence D'Oliveiro wrote:
    On Fri, 23 Aug 2024 19:34:18 -0400, Arne Vajhøj wrote:
    UTF-8 in file names, in usernames, in logicals, in identifiers and in
    programs/scripts: not really needed.

    I would say these are needed.

    I have to ask, why?

    All the objects mentioned by Arne are in simple terms 'tokens' to represent some
    object. I see no reason for the elements in such tokens to be more complex than
    required. Perhaps a bit more complex than the "A", "B", "C", etc of WEENDOZE
    disk names. But needing everything every user might dream up? I don't see the
    benefit. Other than perhaps stubbornness and ego of some particular user. It
    just defies the KISS principal, which I find to be useful.

    If I had said "that there was no need for UTF-8 because we will just have people use British English from now on", then how do you think that would have come across ?

    Yet you have just done the same David. You have just said that if it is
    not used in US English then it is not important and the rest of the world should just learn to restrict itself to US ASCII characters in their use
    of filenames, etc.

    There is a difference between what end users see and the underlying infrastructure that enables them to see it.

    The end users should be able to see all sort of languages.

    But end users are not doing $ SET DEF and $ TYPE anymore.

    They should not care about directory and file names.

    Hoff has stated a few times that VMS actually has implemented
    UTF-8 support in filenames. Probably more than 20 years ago.

    Anyone been using tat feature in the last 20 years?

    I don't think so. Which hints about the value.

    VMS is in dire need for something that makes conversions
    between DECMCS/ISO-8859-1 and UTF-8 easy for the traditional
    native languages.

    But UTF-8 support in file names, usernames, logicals, program
    identifiers is mostly a gimmick.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Tue Aug 27 09:17:15 2024
    On 8/27/2024 9:04 AM, Simon Clubley wrote:
    On 2024-08-25, Dave Froble <davef@tsoft-inc.com> wrote:
    On 8/24/2024 6:55 AM, Single Stage to Orbit wrote:
    On Fri, 2024-08-23 at 19:34 -0400, Arne Vajhøj wrote:
    UTF-8 in file names, in usernames, in logicals, in identifiers and in
    programs/scripts: not really needed.

    Everything needs to be utf8 aware. Not just text files. A good start
    would be to add utf8 aware functionality to VMS.

    I have to ask, why? What benefit comes from the OS, services, other OS specific
    objects, might there be in having the OS itself and it's parts supporting such?
    Forget desires, concentrate on benefits.


    I have posted some examples of places with non-US characters in them
    in response to Arne.

    What do _you_ think filenames based on these places should be called ?

    That is a problem with a a solution that is well tested.

    How do you think a passport with a name with one of those letters
    get treated today?

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to Simon Clubley on Tue Aug 27 09:52:41 2024
    On 8/27/2024 9:01 AM, Simon Clubley wrote:
    On 2024-08-25, Dave Froble <davef@tsoft-inc.com> wrote:
    On 8/23/2024 8:52 PM, Chris Townley wrote:
    On 24/08/2024 00:59, Arne Vajhøj wrote:
    On 8/23/2024 7:41 PM, Lawrence D'Oliveiro wrote:
    On Fri, 23 Aug 2024 19:34:18 -0400, Arne Vajhøj wrote:
    UTF-8 in file names, in usernames, in logicals, in identifiers and in >>>>>> programs/scripts: not really needed.

    I would say these are needed.

    I can live without the ability to create:

    blåbærsyltetøj.txt

    :-)

    Arne


    Is that Norwegian, or Swedish?
    :-)


    If you have to ask, then it most likely is more complex than needed.


    No, it just means you live in a small part of the planet that you wrongly think is the whole world.

    IOW, only an American could have made that comment. :-)

    Simon.


    So what are you saying? We're special?

    :-)

    Some may feel that complexity, just for the sake of complexity, just isn't such a good idea.

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Tue Aug 27 09:59:24 2024
    On 8/27/2024 9:15 AM, Arne Vajhøj wrote:
    On 8/27/2024 8:54 AM, Simon Clubley wrote:
    On 2024-08-25, Dave Froble <davef@tsoft-inc.com> wrote:
    If I had said "that there was no need for UTF-8 because we will just have
    people use British English from now on", then how do you think that would
    have come across ?

    Yet you have just done the same David. You have just said that if it is
    not used in US English then it is not important and the rest of the world
    should just learn to restrict itself to US ASCII characters in their use
    of filenames, etc.

    There is a difference between what end users see and the underlying infrastructure that enables them to see it.

    The end users should be able to see all sort of languages.

    But end users are not doing $ SET DEF and $ TYPE anymore.

    They should not care about directory and file names.

    Hoff has stated a few times that VMS actually has implemented
    UTF-8 support in filenames. Probably more than 20 years ago.

    Anyone been using tat feature in the last 20 years?

    I don't think so. Which hints about the value.

    I never create filenames with æøå. I never deliberately
    create filenames with spaces.

    I try to stay out of trouble. :-)

    VMS is in dire need for something that makes conversions
    between DECMCS/ISO-8859-1 and UTF-8 easy for the traditional
    native languages.

    But UTF-8 support in file names, usernames, logicals, program
    identifiers is mostly a gimmick.

    Java has supported unicode in identifier since forever.

    public class UniMess {
    public static void main(String[] args) {
    int abc = 123;
    int æøå = 456;
    int \u1234\u4321 = 789;
    System.out.printf("%d %d %d\n", abc, æøå, \u1234\u4321);
    }
    }

    is valid code.

    I never use that feature either. ASCII is good enough for my
    identifiers.

    I use ÆØÅ in String literals sometimes.

    I use ÆØÅ in comments sometimes (like in my name!).

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to Simon Clubley on Tue Aug 27 10:05:35 2024
    On 8/27/2024 8:54 AM, Simon Clubley wrote:
    On 2024-08-25, Dave Froble <davef@tsoft-inc.com> wrote:
    On 8/23/2024 7:41 PM, Lawrence D'Oliveiro wrote:
    On Fri, 23 Aug 2024 19:34:18 -0400, Arne Vajhøj wrote:

    UTF-8 in file names, in usernames, in logicals, in identifiers and in
    programs/scripts: not really needed.

    I would say these are needed.


    I have to ask, why?

    All the objects mentioned by Arne are in simple terms 'tokens' to represent some
    object. I see no reason for the elements in such tokens to be more complex than
    required. Perhaps a bit more complex than the "A", "B", "C", etc of WEENDOZE
    disk names. But needing everything every user might dream up? I don't see the
    benefit. Other than perhaps stubbornness and ego of some particular user. It
    just defies the KISS principal, which I find to be useful.


    If I had said "that there was no need for UTF-8 because we will just have people use British English from now on", then how do you think that would have come across ?

    Well, there are precedents ...

    In the world of aviation, and that isn't such a small world, the standard is English. If there is a pilot in the area that requests all communications are in English, then that is the rule, at least as I remember it. That way everyone
    knows what everyone else is saying, and doing.

    Yet you have just done the same David. You have just said that if it is
    not used in US English then it is not important and the rest of the world should just learn to restrict itself to US ASCII characters in their use
    of filenames, etc.

    The issue is not importance, the issues are reasonable benefits, and ease of usage.

    For the data, sure, it can be very important to have whatever is required. But for the tag/token representing the data, not at all. Can you describe any situation where Ascii is not sufficient for a filename? And then there is the issue of sorting.

    Contrary to what you Americans believe, the world is MUCH more than just
    a single country called the United States. A country that, due to its
    own failings and short sightedness, is no longer master of its own destiny.

    Well, yeah, we came up with Trump, and that is a big mistake. We also are claiming support of Isreal is "iron clad", and all that does is encourage them to take actions that they would not without that guarantee, and that is sooner or later going to get some US servicemen killed. Possibly it is fear of the Jewish voters, who are US citizens and should be thinking about the US, not some
    other country, just because of religion, the worst thing that has happened to the human race.

    We avoided Hitle, Nevill Chamberlain, and that list could be long.

    Whoo, you really threw me on that soapbox, huh?

    :-)

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Dave Froble on Tue Aug 27 10:09:13 2024
    On 8/27/2024 9:52 AM, Dave Froble wrote:
    On 8/27/2024 9:01 AM, Simon Clubley wrote:
    On 2024-08-25, Dave Froble <davef@tsoft-inc.com> wrote:
    On 8/23/2024 8:52 PM, Chris Townley wrote:
    On 24/08/2024 00:59, Arne Vajhøj wrote:
    I can live without the ability to create:

    blåbærsyltetøj.txt

    :-)

    Is that Norwegian, or Swedish?
    :-)

    If you have to ask, then it most likely is more complex than needed.

    No, it just means you live in a small part of the planet that you wrongly
    think is the whole world.

    IOW, only an American could have made that comment. :-)

    So what are you saying?  We're special?

    :-)

    US English has a special role in IT.

    For historic reasons it is the most likely to be
    understood by IT people and not to be messed up by
    software.

    If most computers, OS and programming languages had
    been invented in Israel or China, then it may have been
    different. But they just happened to be invented in the
    US. And therefore US English is "it" and not Hebrew or
    Mandarin.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Chris Townley on Tue Aug 27 10:21:55 2024
    On 8/27/2024 10:18 AM, Chris Townley wrote:
    On 27/08/2024 15:09, Arne Vajhøj wrote:
    US English has a special role in IT.

    For historic reasons it is the most likely to be
    understood by IT people and not to be messed up by
    software.

    If most computers, OS and programming languages had
    been invented in Israel or China, then it may have been
    different. But they just happened to be invented in the
    US. And therefore US English is "it" and not Hebrew or
    Mandarin.

    I find they work better with British English!

    Classic:

    https://aloneonahill.com/blog/if-php-were-british

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Townley@21:1/5 to All on Tue Aug 27 15:31:00 2024
    On 27/08/2024 15:21, Arne Vajhøj wrote:
    On 8/27/2024 10:18 AM, Chris Townley wrote:
    On 27/08/2024 15:09, Arne Vajhøj wrote:
    US English has a special role in IT.

    For historic reasons it is the most likely to be
    understood by IT people and not to be messed up by
    software.

    If most computers, OS and programming languages had
    been invented in Israel or China, then it may have been
    different. But they just happened to be invented in the
    US. And therefore US English is "it" and not Hebrew or
    Mandarin.

    I find they work better with British English!

    Classic:

    https://aloneonahill.com/blog/if-php-were-british

    Arne


    Brilliant!

    --
    Chris

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Tue Aug 27 10:43:44 2024
    On 8/27/2024 8:35 AM, Simon Clubley wrote:
    On 2024-08-24, Single Stage to Orbit <alex.buell@munted.eu> wrote:
    On Sat, 2024-08-24 at 03:07 +0000, Lawrence D'Oliveiro wrote:
    On Fri, 23 Aug 2024 22:23:18 -0400, Arne Vajhøj wrote:

    Unicode was also the primary motivation behind PHP 5->6. But it got
    cancelled and PHP did 5->7 without going unicode.

    To be fair, that little peccadillo does get lost in the avalanche of
    other reasons why PHP is bloody awful ...

    I'll drink to that.

    When doing PHP work, I have created a monitor library that runs at the
    start of every PHP script I create and monitors the script for errors
    that the PHP language lets through by default (and bloody well should not).

    It routinely catches stupid mistakes that PHP would otherwise let through
    and that would have caused additional debugging effort.

    No, I am not allowed to share it unfortunately.

    I do NOT like PHP, but I am forced to use it for some of my work because
    of its established ecosystem.

    Some languages has a bad rep despite in certain circles
    despite being widely used: Cobol, Visual Basic, PHP etc..

    The fact that they are widely used indicate that they
    somehow got something right.

    Regarding PHP then there is some things one need
    to realize:
    * that type of language is intended to make coding
    easy, not to make it difficult to make errors, or in
    other words PHP was never intended to compete with
    Modula-2, Ada, Rust etc.
    * PHP has a lot of historic baggage, stuff was added
    back in late 90's and early 00's, which for web technology
    was very different from today, and as we all know then
    getting rid of old stuff can be tricky
    * PHP especially in the early days were definitely Bazaar not
    Cathedral, if someone wanted to add something then it was
    considered fine, and the result is that PHP is not very
    consistent
    * PHP is a very easy language for beginners to start with,
    so guess what a lot of the most hopeless wannabee software
    developers use PHP and produce huge piles of crap code, and
    that dominate many PHP forums

    But:
    - use new version (8.x)
    - error_reporting = E_ALL
    - write 20's PHP not 00's PHP
    - use the optional typing
    - etc.
    help a bit.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Townley@21:1/5 to All on Tue Aug 27 15:18:14 2024
    On 27/08/2024 15:09, Arne Vajhøj wrote:
    On 8/27/2024 9:52 AM, Dave Froble wrote:
    On 8/27/2024 9:01 AM, Simon Clubley wrote:
    On 2024-08-25, Dave Froble <davef@tsoft-inc.com> wrote:
    On 8/23/2024 8:52 PM, Chris Townley wrote:
    On 24/08/2024 00:59, Arne Vajhøj wrote:
    I can live without the ability to create:

    blåbærsyltetøj.txt

    :-)

    Is that Norwegian, or Swedish?
    :-)

    If you have to ask, then it most likely is more complex than needed.

    No, it just means you live in a small part of the planet that you
    wrongly
    think is the whole world.

    IOW, only an American could have made that comment. :-)

    So what are you saying?  We're special?

    :-)

    US English has a special role in IT.

    For historic reasons it is the most likely to be
    understood by IT people and not to be messed up by
    software.

    If most computers, OS and programming languages had
    been invented in Israel or China, then it may have been
    different. But they just happened to be invented in the
    US. And therefore US English is "it" and not Hebrew or
    Mandarin.

    Arne


    I find they work better with British English!

    --
    Chris

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Tue Aug 27 14:51:09 2024
    On 8/27/2024 2:30 PM, Arne Vajhøj wrote:
    And in case somebody wonder what I am trying to explain.

    Python (on VMS):

    VB.NET (not on VMS):

    Or if one is to the more obscure:
    C:\Work\vb>type StuffZ.vb
    NameSpace X.Y.Z
    Public Class A
    Public Overrides Function ToString() As String
    Return "I am an A"
    End Function
    End Class
    NameSpace W.V
    Public Class B
    Public Overrides Function ToString() As String
    Return "I am a B"
    End Function
    End Class
    End NameSpace
    End NameSpace

    C:\Work\vb>vbc /t:library StuffZ.vb
    C:\Work\vb>type Tst1Z.vb
    Imports System

    Module Tst1Z
    Sub Main()
    Dim oa = New X.Y.Z.A
    Console.WriteLine(oa)
    Dim ob = New X.Y.Z.W.V.B
    Console.WriteLine(ob)
    End Sub
    End Module

    C:\Work\vb>vbc /r:StuffZ.dll Tst1Z.vb
    C:\Work\vb>Tst1Z
    I am an A
    I am a B

    C:\Work\vb>type Tst2Z.vb
    Imports System

    Imports X.Y.Z
    Imports X.Y.Z.W.V

    Module Tst1
    Sub Main()
    Dim oa = New A
    Console.WriteLine(oa)
    Dim ob = New B
    Console.WriteLine(ob)
    End Sub
    End Module

    C:\Work\vb>vbc /r:StuffZ.dll Tst2Z.vb
    C:\Work\vb>Tst2Z
    I am an A
    I am a B

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Tue Aug 27 14:30:00 2024
    On 8/25/2024 8:40 PM, Arne Vajhøj wrote:
    VB.NET:

    Imports x

    is not the equivalent of Python:

    import x

    It is (mostly) the equivalent to the difference between:

    import x

    and:

    from x import *

    And in case somebody wonder what I am trying to explain.

    Python (on VMS):

    $ type x.py
    class A(object):
    def __str__(self):
    return 'I am an A'

    class B(object):
    def __str__(self):
    return 'I am a B'
    $ type tst1.py
    import x

    oa = x.A()
    print(oa)
    ob = x.B()
    print(ob)
    $ python tst1.py
    I am an A
    I am a B
    $ type tst2.py
    from x import *

    oa = A()
    print(oa)
    ob = B()
    print(ob)
    $ python tst2.py
    I am an A
    I am a B

    (x.py may not be good Python, but it shows the point)

    VB.NET (not on VMS):

    C:\Work\vb>type Stuff.vb
    NameSpace X
    Public Class A
    Public Overrides Function ToString() As String
    Return "I am an A"
    End Function
    End Class
    Public Class B
    Public Overrides Function ToString() As String
    Return "I am a B"
    End Function
    End Class
    End NameSpace

    C:\Work\vb>vbc /t:library Stuff.vb
    C:\Work\vb>type Tst1.vb
    Imports System

    Module Tst1
    Sub Main()
    Dim oa = New X.A
    Console.WriteLine(oa)
    Dim ob = New X.B
    Console.WriteLine(ob)
    End Sub
    End Module

    C:\Work\vb>vbc /r:Stuff.dll Tst1.vb
    C:\Work\vb>Tst1
    I am an A
    I am a B

    C:\Work\vb>type Tst2.vb
    Imports System

    Imports X

    Module Tst1
    Sub Main()
    Dim oa = New A
    Console.WriteLine(oa)
    Dim ob = New B
    Console.WriteLine(ob)
    End Sub
    End Module

    C:\Work\vb>vbc /r:Stuff.dll Tst2.vb
    C:\Work\vb>Tst2
    I am an A
    I am a B

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Tue Aug 27 21:42:33 2024
    On Tue, 27 Aug 2024 14:30:00 -0400, Arne Vajhøj wrote:

    class A(object):

    Note that, in Python 3, all classes implicitly inherit from “object” anyway.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to John Dallman on Tue Aug 27 21:47:52 2024
    On Tue, 27 Aug 2024 13:40 +0100 (BST), John Dallman wrote:

    In article <vadndu$1igfq$1@dont-email.me>, ldo@nz.invalid (Lawrence D'Oliveiro) wrote:

    On the other hand, Perl has a lot of subtleties to it that I never
    quite understood. When I started learning Python, I found that was just
    as powerful, but so much easier to understand.

    The two languages are fine examples of different kinds of "simplicity".

    Perl has a smaller vocabulary of keywords, but they can be used in a
    vast range of combinations.

    Perl actually has a vast range of builtins. I understand that some words
    are reserved but not others, but to me that just adds to the confusion.

    Python has a huge vocabulary, but the keywords do pretty specific
    things, and until you learn the keywords for an idiom or pattern, you
    can't use that pattern.

    Python is actually a fairly small language. Its core language spec is less
    than 20% the size of the core Java language spec.

    I find Python frustrating, because the documentation is so determined to
    tell you about the way in which keywords differ in various versions of
    the language that I have trouble finding the keywords I need for a task.
    The language has so many keywords that I'm not really interested in
    learning all of them at my advanced age.

    The Python spec only lists 35 keywords <https://docs.python.org/3/reference/lexical_analysis.html#keywords>. Is
    that a lot to you?

    Perl feels like C to me; Python feels like Basic or COBOL.

    You never had functions and classes as first-class objects in BASIC or
    COBOL; you do in Python. You never had metaclasses in those languages; you
    do in Python. You never had custom operator overloads in those languages;
    you do in Python.

    Python is in some ways conceptually similar to the old, failed “Lisp 2” project: this was going to offer important Lisp concepts in a more Algol-
    like syntax. Python does give you something like that.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Tue Aug 27 21:51:28 2024
    On Tue, 27 Aug 2024 10:43:44 -0400, Arne Vajhøj wrote:

    The fact that they are widely used indicate that they somehow got
    something right.

    They attract users who are using it because everybody else they know is
    using it.

    When I first saw PHP, it looked to me like it was copying Perl, but the designers didn’t quite understand what they were copying.

    More recently, it seems to have started trying to copy Python, but again,
    the designers still don’t quite understand what they are copying. So they
    get it wrong.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Tue Aug 27 19:50:10 2024
    On 8/27/2024 5:47 PM, Lawrence D'Oliveiro wrote:
    On Tue, 27 Aug 2024 13:40 +0100 (BST), John Dallman wrote:
    Python has a huge vocabulary, but the keywords do pretty specific
    things, and until you learn the keywords for an idiom or pattern, you
    can't use that pattern.

    Python is actually a fairly small language. Its core language spec is less than 20% the size of the core Java language spec.

    Small nitpick: Python 3.12.5 LRM is 216 pages and Java 21 JLS
    is 872 pages. It is a little above 20% according to my calculator.

    But more important then I don't think pages in spec is a good
    indicator for language complexity. Some languages like to
    specify things very precise in great detail. Other languages
    like to produce something that is readable.

    But yes despite Java originally being intended to be a simple language
    then it has turned rather complex over the years.

    Original: checked exceptions, nested & inner classes, JNI
    5: generics (incl. covariant and contravariant generic types), auto boxing/unboxing, memory model
    8: lambda
    9: the module system (that nobody uses)

    It all adds up.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Tue Aug 27 23:34:35 2024
    On Tue, 27 Aug 2024 09:59:24 -0400, Arne Vajhøj wrote:

    I never create filenames with æøå. I never deliberately create filenames with spaces.

    I try to stay out of trouble. :-)

    Not only do I create filenames with spaces, I also like to use slashes and colons in them (where appropriate). However, “/” is, as you know, a path separator in Posix systems. But that’s OK: Unicode allows me to use “∕” instead.

    Similarly, “:” is interpreted by many network-aware programs (e.g. scp) as delimiting a node name prefix. So to avoid confusing them, if I feel the
    need for a “:” in a file name, I use “∶” instead.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Tue Aug 27 20:02:46 2024
    On 8/27/2024 5:47 PM, Lawrence D'Oliveiro wrote:
    On Tue, 27 Aug 2024 13:40 +0100 (BST), John Dallman wrote:
    In article <vadndu$1igfq$1@dont-email.me>, ldo@nz.invalid (Lawrence
    D'Oliveiro) wrote:
    Perl feels like C to me; Python feels like Basic or COBOL.

    You never had functions and classes as first-class objects in BASIC or
    COBOL; you do in Python. You never had metaclasses in those languages; you
    do in Python. You never had custom operator overloads in those languages;
    you do in Python.

    I suspect that he was more thinking philosophy than specific syntax
    and functionality.

    Also note that those languages has also evolved.

    Traditional Basic incl. VMS Basic and Cobol 74 & 85 incl.
    VMS Cobol does not have such features.

    But later Microsoft Basic flavors added a lot. And Cobol
    became object oriented with 2002.

    VB.NET has classes, lambdas and operator overload. Python metaclass
    does not have a direct equivalent in VB.NET but AppDomain, compiler
    services and extension methods should together provide
    similar functionality.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Wed Aug 28 05:36:28 2024
    On Tue, 27 Aug 2024 20:02:46 -0400, Arne Vajhøj wrote:

    On 8/27/2024 5:47 PM, Lawrence D'Oliveiro wrote:

    On Tue, 27 Aug 2024 13:40 +0100 (BST), John Dallman wrote:

    In article <vadndu$1igfq$1@dont-email.me>, ldo@nz.invalid (Lawrence
    D'Oliveiro) wrote:

    You never had functions and classes as first-class objects in BASIC or
    COBOL; you do in Python. You never had metaclasses in those languages;
    you do in Python. You never had custom operator overloads in those
    languages; you do in Python.

    I suspect that he was more thinking philosophy than specific syntax and functionality.

    So was I. The one is definitely a reflection of the other.

    Also note that those languages has also evolved.

    And they had more time to do so. But they are still behind Python.

    VB.NET has classes, lambdas and operator overload. Python metaclass does
    not have a direct equivalent in VB.NET but AppDomain, compiler services
    and extension methods should together provide similar functionality.

    You know how in Python, you can instantiate OSError to report an OS
    error code, and it automatically turns into the appropriate subclass
    (e.g. FileNotFoundError) depending on the error code? These happen to
    be built-in classes, but with metaclasses, you can do the same thing
    with your own class hierarchy.

    <https://gitlab.com/ldo/python_topics_notebooks/-/blob/master/Uses%20For%20Metaclasses.ipynb>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Wed Aug 28 05:32:40 2024
    On Tue, 27 Aug 2024 19:50:10 -0400, Arne Vajhøj wrote:

    But more important then I don't think pages in spec is a good indicator
    for language complexity. Some languages like to specify things very
    precise in great detail. Other languages like to produce something that
    is readable.

    Unless you can point out examples in my comparison of the Python and Java
    specs where this makes a significant difference, I will stick to my claims about their relative complexity.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Dallman@21:1/5 to D'Oliveiro on Wed Aug 28 16:35:00 2024
    In article <valhi8$34s18$4@dont-email.me>, ldo@nz.invalid (Lawrence
    D'Oliveiro) wrote:

    Perl actually has a vast range of builtins.

    True, but they are at least all in one list. The problem I've had with
    Python is finding what the word is to do a thing.

    Python is actually a fairly small language. Its core language spec
    is less than 20% the size of the core Java language spec.

    This does not really help your case: Java is another example of an
    overblown language.

    The Python spec only lists 35 keywords <https://docs.python.org/3/reference/lexical_analysis.html#keywords>
    . Is that a lot to you?

    No, but that's well short of the things I need to learn to write
    practical Python code. The file handling library functions are a prime
    example. The list rapidly grows larger than the Perl builtins, and is
    less well organised.

    Yes, Perl also has a large library that is not as well organised as the builtins. You aren't forced to use it, and I mostly don't.

    You never had functions and classes as first-class objects in BASIC
    or COBOL; you do in Python. You never had metaclasses in those
    languages; you do in Python. You never had custom operator
    overloads in those languages; you do in Python.

    You've missed my point. BASIC and COBOL are languages where you have to
    learn specific words to do specific things; Python has that in common
    with them. Many of those words are library functions rather than builtins,
    but that makes little practical difference in learning the language.

    I find learning the things I need to use to write practical development utilities in Python much harder than I did when learning Perl. I am older
    than I was when learning Perl, but more experienced in learning new
    languages. Writing this, I've realised that part of the reason for this
    is that the kind of code I need to write in one or the other of these
    languages is exactly the kind of thing Perl is meant for: gluing other
    programs together. Python has much larger ambitions and isn't as focused
    on my use case.

    Several younger people at work came to us as determined advocates of
    Python. They're written some useful tools in it, but the core of the development environment remains Perl. One of them who regarded Perl as
    very difficult found he got to grips with it naturally once he had some
    motive: using a parser written in Perl to output JSON for his pet project.


    John

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to John Dallman on Thu Aug 29 01:49:17 2024
    On Wed, 28 Aug 2024 16:35 +0100 (BST), John Dallman wrote:

    In article <valhi8$34s18$4@dont-email.me>, ldo@nz.invalid (Lawrence D'Oliveiro) wrote:

    Perl actually has a vast range of builtins.

    True, but they are at least all in one list. The problem I've had with
    Python is finding what the word is to do a thing.

    I’m not sure I understand that. Python does things by “constructs” rather than individual “words”. Do you mean function and class names?

    Python is actually a fairly small language. Its core language spec is
    less than 20% the size of the core Java language spec.

    This does not really help your case: Java is another example of an
    overblown language.

    Why, do you think Java is some kind of outlier?

    The file handling library functions are a prime
    example. The list rapidly grows larger than the Perl builtins, and is
    less well organised.

    There is really just the “open” builtin function, and the “io” module for
    the basic class definitions, and things like text/binary conversions and in-memory I/O. And “os” for lower-level OS-specific stuff, and “os.path”
    for pathname handling. Temporary files are handled by tempfile, globbing
    done by glob and fnmatch, and there’s shutil to provide higher-level operations like the equivalent of “rm -r”. That’s about it, really. Did I miss anything?

    Note that string formatting/parsing is not part of I/O.

    You never had functions and classes as first-class objects in BASIC or
    COBOL; you do in Python. You never had metaclasses in those languages;
    you do in Python. You never had custom operator overloads in those
    languages; you do in Python.

    You've missed my point. BASIC and COBOL are languages where you have to
    learn specific words to do specific things; Python has that in common
    with them.

    But you just said above that you can’t seem to find those “words” (whatever they are) in Python: so clearly by your own admission it doesn’t work that way at all.

    Several younger people at work came to us as determined advocates of
    Python. They're written some useful tools in it, but the core of the development environment remains Perl.

    There is a wonderful environment called “Jupyter”, which uses the notebook paradigm with “cells” that can contain program code or explanatory text. Program cells can generate various forms of rich output, like graphics,
    audio, video, even interactive widgets.

    It was originally for Python (the original project was called “IPython”), but now supports a range of other languages.

    I like to use it for “scratchpad” programming: write a few lines to try something out, then either copy and paste working bits into something more substantial, or just chuck it away.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Craig A. Berry@21:1/5 to Lawrence D'Oliveiro on Thu Aug 29 07:23:19 2024
    On 8/28/24 8:49 PM, Lawrence D'Oliveiro wrote:
    On Wed, 28 Aug 2024 16:35 +0100 (BST), John Dallman wrote:

    In article <valhi8$34s18$4@dont-email.me>, ldo@nz.invalid (Lawrence
    D'Oliveiro) wrote:

    Perl actually has a vast range of builtins.

    True, but they are at least all in one list. The problem I've had with
    Python is finding what the word is to do a thing.

    I’m not sure I understand that. Python does things by “constructs” rather
    than individual “words”. Do you mean function and class names?

    The extra things you import if you don't have a builtin that does what
    you want are called modules in both Perl and Python. As far as I can
    tell he's just saying that with Perl, the operations he uses most (e.g.
    I/O and regular expressions) are already there as builtins and there are
    no "use" statements necessary to import modules to do those things.

    There are 150+ modules that ship with Perl and thousands more on CPAN,
    and you do need some of them to do some things. But John is right; Perl
    is quite a capable language, sort of an awk on steroids, without those
    things.

    Python also ships with a ton of modules and has many more available via
    pip. But it has moved in the direction of fewer builtins and needing
    modules to do pretty much anything. I think Python 2 had an "open"
    builtin but in Python 3 you have to "import io" and use "io.open." I'm
    sure I will get a lecture on all the computer sciency reasons that's a
    superior way of doing things. But for someone trying to get work done,
    having the tools you use most already out on the workbench without
    having to remember which tool chest they're in can be an advantage.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Craig A. Berry on Thu Aug 29 08:33:55 2024
    On 8/29/2024 8:23 AM, Craig A. Berry wrote:
    On 8/28/24 8:49 PM, Lawrence D'Oliveiro wrote:
    On Wed, 28 Aug 2024 16:35 +0100 (BST), John Dallman wrote:
    In article <valhi8$34s18$4@dont-email.me>, ldo@nz.invalid (Lawrence
    D'Oliveiro) wrote:
    Perl actually has a vast range of builtins.

    True, but they are at least all in one list. The problem I've had with
    Python is finding what the word is to do a thing.

    I’m not sure I understand that. Python does things by “constructs” rather
    than individual “words”. Do you mean function and class names?

    The extra things you import if you don't have a builtin that does what
    you want are called modules in both Perl and Python.  As far as I can
    tell he's just saying that with Perl, the operations he uses most (e.g.
    I/O and regular expressions) are already there as builtins and there are
    no "use" statements necessary to import modules to do those things.

    There are 150+ modules that ship with Perl and thousands more on CPAN,
    and you do need some of them to do some things.  But John is right; Perl
    is quite a capable language, sort of an awk on steroids, without those things.

    Python also ships with a ton of modules and has many more available via pip.  But it has moved in the direction of fewer builtins and needing modules to do pretty much anything.  I think Python 2 had an "open"
    builtin but in Python 3 you have to "import io" and use "io.open."  I'm
    sure I will get a lecture on all the computer sciency reasons that's a superior way of doing things. But for someone trying to get work done,
    having the tools you use most already out on the workbench without
    having to remember which tool chest they're in can be an advantage.

    open is still listed at:
    https://docs.python.org/3/library/functions.html

    But yes the general trend is to externalize.

    In the J world we saw Java 11 remove JAX-WS and JAXB
    to make them external downloadable packages.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Craig A. Berry on Thu Aug 29 23:09:00 2024
    On Thu, 29 Aug 2024 07:23:19 -0500, Craig A. Berry wrote:

    Python also ships with a ton of modules and has many more available via
    pip. But it has moved in the direction of fewer builtins and needing
    modules to do pretty much anything. I think Python 2 had an "open"
    builtin but in Python 3 you have to "import io" and use "io.open."

    No, Python 2 had both “open” and “file” builtins which did the same thing,
    but Python 3 keeps “open”. Yes, there is an important “io” module if you
    want to get into the lower guts of file objects.

    According to the “What’s New In Python 3.0” notes <https://docs.python.org/3.0/whatsnew/3.0.html>, only about half a dozen builtins were removed.

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