Sujet : Fortran was NOT higher level than C. Was: Computer architects leaving Intel...
De : already5chosen (at) *nospam* yahoo.com (Michael S)
Groupes : comp.archDate : 04. Sep 2024, 09:31:23
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240904113123.00002098@yahoo.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
User-Agent : Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
On Tue, 3 Sep 2024 20:05:14 -0000 (UTC)
Thomas Koenig <
tkoenig@netcologne.de> wrote:
Stefan Monnier <monnier@iro.umontreal.ca> schrieb:
My impression - based on hearsay for Rust as I have no experience
- is that the key point of Rust is memory "safety". I use
scare-quotes here, since it is simply about correct use of dynamic
memory and buffers.
>
It is entirely possible to have correct use of memory in C,
>
If you look at the evolution of programming languages,
"higher-level" doesn't mean "you can do more stuff". On the
contrary, making a language "higher-level" means deciding what it
is we want to make harder or even impossible.
Really?
I thought Fortran was higher level than C, and you can do a lot
more things in Fortran than in C.
Or rather, Fortran allows you to do things which are possible,
but very cumbersome, in C. Both are Turing complete, after all.
I'd say that C in the form that stabilized around 1975-1976 is
significantly higher level language than contemporary Fortran dialects
or even the next Fortran dialect (F77).
EQUIVALENCE is lower level than union.
COMMON is ALOT lower level both than C automatic storage and than
dynamic storage (malloc/free) although the later probably was not
considered part of the language in 1976.
IF cond GOTO 42 is lower level than if (!cond) {}
Call-by-reference as the only mode of parameter passing is lower level
than call-by-value. Especially so in context of C, because in C one can
easily emulate call-by-reference with pointers if/when such need arises.
Few other higher level concepts of C appear to have no equivalents at
all in contemporary Fortran:
block scopes for variables, including variables with static storage;
struct;
enum.
I don't remember for sure, but it seems that back then Fortran had no
recursion.
Standardized preprocessor vs at best non-standard macro systems or at
worst nothing at all.
I'd guess there are more features of that sort that I forgot, but they
are less important than those I listed.
Overall, the differences in favor of C looks rather huge.
On the other hand, I recollect only two higher level feature present in
old Fortran that were absent in pre-99 C - VLA and Complex.
The first feature can be emulated in almost satisfactory manner by
dynamic allocation. Also, I am not sure that VLA were already part of
standard Fortran language in 1976.
The second feature is very specialized and rather minor.