Fortran 90 was a modern programming language including all
the useful features of C (except unsigned numbers), but surpassing it in power by far.
On Sat, 27 Jan 2024 11:04:21 -0000 (UTC), Thomas Koenig wrote:
Fortran 90 was a modern programming language including all
the useful features of C (except unsigned numbers), but surpassing it in
power by far.
It even does recursive functions/subroutines. But you must explicitly declare them RECURSIVE, which C doesn’t.
On the plus side, seems it has a proper MODULE import facility
(reminiscent of Ada), as opposed to relying on the #include hack.
Lawrence D'Oliveiro <ldo@nz.invalid> schrieb:
It even does recursive functions/subroutines. But you must explicitly
declare them RECURSIVE, which C doesn’t.
It's the functionality that counts, not the syntax.
On Sat, 27 Jan 2024 22:58:27 -0000 (UTC), Thomas Koenig wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> schrieb:
It even does recursive functions/subroutines. But you must explicitly
declare them RECURSIVE, which C doesn’t.
It's the functionality that counts, not the syntax.
You shouldn’t need separate syntax to enable something that should be available as a matter of course.
Lawrence D'Oliveiro <ldo@nz.invalid> schrieb:
You shouldn’t need separate syntax to enable something that should be
available as a matter of course.
What "should be available as a matter of course" is very much an
opinion ...
Just one example: Stack sizes are severely limited even on modern
systems ...
Lawrence D'Oliveiro <ldo@nz.invalid> schrieb:Definitely should NOT be the default.
On Sat, 27 Jan 2024 22:58:27 -0000 (UTC), Thomas Koenig wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> schrieb:
It even does recursive functions/subroutines. But you must explicitly
declare them RECURSIVE, which C doesn’t.
It's the functionality that counts, not the syntax.
You shouldn’t need separate syntax to enable something that should be
available as a matter of course.
What "should be available as a matter of course" is very much
an opinion, and there are two sides to that argument what should
be the default.
Just one example: Stack sizes are severely limited even on modern
systems, at least by default (and sometimes even more severely
for multithreaded applications). So, it is quite possible for an
application to work fine with non-recursive subroutines, but to
crash mysteriously with recursive subrotines, on modern systems.
So, should a compiler by default follow F2018 (which makes
procedures recursive by default) or not? Hmmm...
Lawrence D'Oliveiro <ldo@nz.invalid> schrieb:
On Sat, 27 Jan 2024 22:58:27 -0000 (UTC), Thomas Koenig wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> schrieb:
It even does recursive functions/subroutines. But you must explicitly
declare them RECURSIVE, which C doesn’t.
It's the functionality that counts, not the syntax.
You shouldn’t need separate syntax to enable something that should be
available as a matter of course.
What "should be available as a matter of course" is very much an
opinion, and there are two sides to that argument what should be the
default.
Just one example: Stack sizes are severely limited even on modern
systems, at least by default (and sometimes even more severely for multithreaded applications). So, it is quite possible for an
application to work fine with non-recursive subroutines, but to crash mysteriously with recursive subrotines, on modern systems.
So, should a compiler by default follow F2018 (which makes procedures recursive by default) or not? Hmmm...
I submitted a patch to implement the NON_RECURSIVE prefix and made the
change to make procedure recursive by default. It's in bugzilla. Janne
and I had a short discussion, and we are both leary of what might happen
with the stack; particular for an OS that provides a small stack.
On Sun, 28 Jan 2024 16:41:21 -0000 (UTC), Steven G. Kargl wrote:
I submitted a patch to implement the NON_RECURSIVE prefix and made the
change to make procedure recursive by default. It's in bugzilla. Janne
and I had a short discussion, and we are both leary of what might happen
with the stack; particular for an OS that provides a small stack.
Large objects tend to be variable in size anyway; how do you deal with
that?
Do you stop and restart the program with a different global
allocation size?
In modern languages, we do most dynamic allocations, especially large
ones, in the heap.
Lawrence D'Oliveiro <ldo@nz.invalid> schrieb:
In modern languages, we do most dynamic allocations, especially large
ones, in the heap.
Assume you have a fixed-size buffer for some sort of blocked algorithm. Where do you put it? If you make your subroutine recursive, where it
wasn't before, you suddenly end up using a lot more stack, which then
can crash a user's program.
And changing the default would cause that crash without source code modification... which is bad.
On 1/28/2024 2:54 AM, Thomas Koenig wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> schrieb:
On Sat, 27 Jan 2024 22:58:27 -0000 (UTC), Thomas Koenig wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> schrieb:
It even does recursive functions/subroutines. But you must explicitly >>>>> declare them RECURSIVE, which C doesn’t.
It's the functionality that counts, not the syntax.
You shouldn’t need separate syntax to enable something that should be
available as a matter of course.
What "should be available as a matter of course" is very much
an opinion, and there are two sides to that argument what should
be the default.
Just one example: Stack sizes are severely limited even on modern
systems, at least by default (and sometimes even more severely
for multithreaded applications). So, it is quite possible for an
application to work fine with non-recursive subroutines, but to
crash mysteriously with recursive subrotines, on modern systems.
So, should a compiler by default follow F2018 (which makes
procedures recursive by default) or not? Hmmm...
Definitely should NOT be the default.
Lawrence D'Oliveiro <ldo@nz.invalid> schrieb:
On Sat, 27 Jan 2024 22:58:27 -0000 (UTC), Thomas Koenig wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> schrieb:
It even does recursive functions/subroutines. But you must explicitly
declare them RECURSIVE, which C doesn’t.
It's the functionality that counts, not the syntax.
You shouldn’t need separate syntax to enable something that should be
available as a matter of course.
What "should be available as a matter of course" is very much
an opinion, and there are two sides to that argument what should
be the default.
Just one example: Stack sizes are severely limited even on modern
systems, at least by default (and sometimes even more severely
for multithreaded applications). So, it is quite possible for an
application to work fine with non-recursive subroutines, but to
crash mysteriously with recursive subrotines, on modern systems.
So, should a compiler by default follow F2018 (which makes
procedures recursive by default) or not? Hmmm...
On Mon, 29 Jan 2024 06:54:14 -0000 (UTC), Thomas Koenig wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> schrieb:
In modern languages, we do most dynamic allocations, especially large
ones, in the heap.
Assume you have a fixed-size buffer for some sort of blocked algorithm.
Where do you put it? If you make your subroutine recursive, where it
wasn't before, you suddenly end up using a lot more stack, which then
can crash a user's program.
And changing the default would cause that crash without source code
modification... which is bad.
Precisely my point.
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,096 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 400:34:51 |
| Calls: | 14,036 |
| Calls today: | 2 |
| Files: | 187,082 |
| D/L today: |
2,887 files (1,738M bytes) |
| Messages: | 2,479,121 |