On Tue, 24 May 2005 13:54:49 +0000, Mike Amling wrote:
> Andrew Reilly wrote:
>> On Tue, 24 May 2005 00:05:16 +0000, Bryan Olson wrote:
>>
>>> Presently, C is so widely used because it is so
>>>widely used. Back in the day, there were other reasons; chief
>>>among them, as we used to say, it combines the flexibility of
>>>assembly language with the power of assembly language.
>
> C got a big boost when Microsoft chose it as an implementation
> language in the 1980s. I wonder if they would have chosen differently
> had they foreseen the security problems that have resulted. Maybe not,
> since there's been little if any reduction of revenue.
When did they do that? I was under the impression that most of early
Word/Office at least, and some (most?) of early Windows was done in
Pascal. That was the explanation I'd heard for the Windows libraries
using Pascal rather than C calling conventions.
At around that time, Pascal was also the predominant development language
on the early Macintoshes, I thought. Apple's Programmer's workbench
Pascal was extended with dereference operators and other C-ish things,
though.
> If MS had chosen, say, Modula-2, that language would be much more
> significant today than it is.
> Before that, C's popularity was often attributed to the ubiquitous
> availability of good compilers for it.
Or, indeed, any at all. I first came across C in the form of one of the
"tiny C" varieties, on 8-bit micros. That was at a time when 8-bitters
were generally coded in interpreted languages (Basic or P-code pascal) or
assembly language. (Well, I wasn't coding professionally at the time, so
professional development systems may well have had more substantial
language systems.)
>> Not true: it has the (IMO huge) advantage over assembly language of
>> avoiding all of the tedious and error-prone manual register allocation
>> process.
>
> You can reduce the tedium be using register allocation macros,
> provided your assembler's macro language is sufficiently powerful.
Yeah, I've tried that, but it didn't feel all that satisfactory.
>> I reckon I'd actually be happier with a language that looked and felt
>> like a good assembler (along with a "real" macro language), but which
>> did some measure of automatic register allocation.
>
> But then your code is less portable than with a HLL.
How so? I'm really talking about something not entirely unlike like C,
but without expressions (so order of evaluation is not an issue). True,
it's not really that great an idea, becuase unless you allowed
re-ordering, and similar optimizations, code could never be as
fast across such a wide range of architectures as you can get with
somewhat higher level languages. Different processors just do things
differently, and prefer different idioms.
Cheers,
--
Andrew
Received on Thu Sep 29 21:38:27 2005