Sujet : Re: Duplicate identifiers in a single namespace
De : joegwinn (at) *nospam* comcast.net (Joe Gwinn)
Groupes : sci.electronics.designDate : 17. Oct 2024, 00:30:50
Autres entêtes
Message-ID : <hqg0hjl6jshfnqcqtu6982t6tksldn93m0@4ax.com>
References : 1 2 3 4
User-Agent : ForteAgent/8.00.32.1272
On Wed, 16 Oct 2024 14:17:54 -0700, Don Y
<
blockedofcourse@foo.invalid> wrote:
On 10/16/2024 7:36 AM, Joe Gwinn wrote:
Pascal
If you declare multiple identifiers in the same namespace
you are hit on the head. You can have nested namespaces
and there is no conflict, the inner namespace counts.
Pascal is compiled in a single pass through the source code, so
everything must be defied before it is first used. Unlike C/C++,
which has a multipass compiler and linker. This was done because
Pascal was intended for teaching programming, and the load in the
university's computers was from compiling buggy student homework code
time and time again, while C was intended to replace assembly in the
Unix operating system.
>
I think you are misassigning effect to cause. Wirth was
obsessed (?) with simplicity. Even at the expense of
making things *harder* for the developer! (shortsighted,
IMHO).
>
Requiring the developer to declare his *future* intention
to reference an object *could* be seen as simplifying the
process -- at least from the compiler's point of view.
>
But, I've no fond memories of *any* language where I was
forced to do something that the compiler could very obviously
do; how is making MORE work for me going to make things better?
>
I share his belief that things should be "simpler instead of
more complex". But, that only applies to the decomposition
of a problem; the problem itself defines its complexity.
I once had the suicidal job of choosing which language to write a
large mass of code in. When my name was made public, the phone
immediately blew off the hook with special pleaders for the two
candidates, Pascal and plain K&R C. I'm doomed - no matter which is
chosen, there will be war. And blood.
We had performed something like six prior benchmarks studies that
showed that compiled C code was 1.5 times faster than compiled Pascal
code, and Pascal had all sorts of awkward limitation when used to
implement large systems, in this case hundreds of thousands of lines
of code.
That didn't settle the issue, because the Ada mafia saw Pascal as the
stepping stone to Ada nirvana, and C as the devil incarnate.
I was still scratching my head about why Pascal was so different than
C, so I looked for the original intent of the founders. Which I found
in the Introductions in the Pascal Report and K&R C: Pascal was
intended for teaching Computer Science students their first
programming language, while C was intended for implementing large
systems, like the Unix kernel.
Prior operating systems were all written in assembly code, and so were
not portable between vendors, so Unix needed to be written in
something that could be ported, and yet was sufficient to implement a
OS kernel. Nor can one write an OS in Pascal.
This did work - only something like 4% of Unix had to be written in
assembly, and it was simply rewritten for each new family of
computers.
So the Pascal crowd fell silent, and C was chosen and successfully
used.
The Ada Mandate was rescinded maybe ten years later. The ISO-OSI
mandate fell a year or so later, slain by TCP/IP.
Joe Gwinn