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.
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 ...
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.
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.
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. :-)
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
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.
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.
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++
compile/POINTER_SIZE=32, LINK/SEG=CODE=P0 etc. can all help get stuff working.
But it is not the right long term solution.
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++
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.
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
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 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
And it has different size of long and pointers.
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?
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.For C++, the default pointer size should have remained 32.
But it is not the right long term solution.
It was a mistake to change the default from what it was on Alpha and IA64.
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
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 stuffFor C++, the default pointer size should have remained 32.
working.
But it is not the right long term solution.
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.
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.
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?
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.
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?
:-)
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.
However, since you ask, I prefer a writeup rather than a 40 minute
video for this kind of update ...
I 100% agree.
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?
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:It was a mistake to use 32 and not 64 on Alpha and Itanium, but that
compile/POINTER_SIZE=32, LINK/SEG=CODE=P0 etc. can all help get stuff working.For C++, the default pointer size should have remained 32.
But it is not the right long term solution.
It was a mistake to change the default from what it was on Alpha and IA64. >>
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.
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.
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?
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.
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.
Yes, that means dragging some apps forward. And dragging systen APIs forward.
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?
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?
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.
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.
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.
Today standard defined types are usually preferred.
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 ...
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.
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.
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.
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”.
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.
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.
I don't think there is much difference in how Linux vendors and
Microsoft position server and desktop products.
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?
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.
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?
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.
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.
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.
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...
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
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.
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.
strings and character encoding are more "fun":
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...
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.
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.
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.
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
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 ...
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.
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.
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 (whenOr if the application is passing pointers between code compiled
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. >>
with different languages/compilers/compiler settings.
Of course, that is what ABIs are _supposed_ to be for...
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.
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 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.
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.
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. :-)
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. :-)
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
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.
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...
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).
On 2024-08-18, Michael Kraemer <m.kraemer@gsi.de> wrote:Heck , Even then , the terminals were software driven .
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.
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) ...
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
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...
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.
Quite a bit of unix code that uses such techniques, as does vms with descriptors, if that'a the right name for it.
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.
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 ...
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.
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 ...
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?
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.
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.
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")
Few languages support multiple return values.
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?"
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.
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.
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 APIsBecause InputStream/OutputStream and Reader/Writer are fundamentally
(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... >>
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.
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.
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.
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.
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);
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.
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
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")
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
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?
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 ? :-)
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 ...
:-)
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?
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?
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. :-) ).
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
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.
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.
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.
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
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
and that the best option in C is the same
as in many other languages - return the structure itself.
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...
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.
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.
On 2024-08-20 12:04:13 +0000, Simon Clubley said:
On 2024-08-19, Arne Vajhøj <arne@vajhoej.dk> wrote:
Of course, that is what ABIs are _supposed_ to be for...
Or if the application is passing pointers between code compiled with
different languages/compilers/compiler settings.
Or Swift and C/C++, or Zig and C/C++, which are intended to
interoperate.
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.
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.
UTF-8 in file names, in usernames, in logicals, in identifiers and in programs/scripts: not really needed.
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.
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
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
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?
:-)
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
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.
I'm told Unicode support in Python 2.x was pretty shaky but Python 3 is
a lot better.
UTF-8 in file names, in usernames, in logicals, in identifiers and in programs/scripts: not really needed.
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 ...
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.
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.
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.
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”.
And it can also return multiple values from a function ...
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)
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.
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/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
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.
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".
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.
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."
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.
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” ...
I fully get the need for UTF-8 support in anything data related.
That is the safe choice for it being displayed correctly
everywhere and being understandable by all future maintenance
programmers.
But it is not a general multiple return value solution.
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?
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.
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]
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”?
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”.
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.
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?
:-)
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.
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
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”?
$ 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
Python modules are not exactly like packages/namespaces, but OK close.
I guess there are two approaches to naming:
shorter is better -> less typing and smaller files
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.
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.
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.
Python modules does way more than C++/C#/VB.NET namespaces and Java
packages.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 ?
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.
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.
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.
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.
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.
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?
:-)
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!
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
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.
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
And in case somebody wonder what I am trying to explain.
Python (on VMS):
VB.NET (not on VMS):
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 *
class A(object):
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.
The fact that they are widely used indicate that they somehow got
something right.
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.
I never create filenames with æøå. I never deliberately create filenames with spaces.
I try to stay out of trouble. :-)
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.
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.
Also note that those languages has also evolved.
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.
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.
Perl actually has a vast range of builtins.
Python is actually a fairly small language. Its core language spec
is less than 20% the size of the core Java language spec.
The Python spec only lists 35 keywords <https://docs.python.org/3/reference/lexical_analysis.html#keywords>
. Is that a lot to you?
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.
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 file handling library functions are a prime
example. The list rapidly grows larger than the Perl builtins, and is
less well organised.
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.
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.
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?
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.
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."
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 432 |
Nodes: | 16 (2 / 14) |
Uptime: | 30:39:41 |
Calls: | 9,081 |
Calls today: | 4 |
Files: | 13,409 |
Messages: | 6,022,248 |