Re: Why C for operating systems
- From: "BGB / cr88192" <cr88192@xxxxxxxxxxx>
- Date: Sun, 6 Dec 2009 11:34:54 -0700
"Pascal J. Bourguignon" <pjb@xxxxxxxxxxxxxxxxx> wrote in message
news:878wdgiedq.fsf@xxxxxxxxxxxxxxxx
"Bill Cunningham" <nospam@xxxxxxxxxxxxx> writes:
One reason why I am so attracted to C and not just markup languages
scripts and java is that C is for designing OS's. What exactly is it
about
C that makes it good to write operating systems?
Nothing. Well, historical accident.
Well, apart from the fact that it was developed to write unix.
First, you should keep in mind that operating systems have been
written in a lot of other programming languages, either assembler or
high level programming languages. C is not the best system
programming language, far from it.
<snip>
actually I disagree, and infact will hold the position that most of what was
written here is actually a big load of crap...
one thing that C-family languages have demonstrated themselves as being
really good at, is shaving away bytes and clock cycles "here and there" much
better than most other programming languages (apart from assembler).
hence, one "could" use a higher level language, and eat through a few more
bytes of memory here and there ("well, who cares if this integer always uses
32 bits when it could just as easily fit in 8?..."), and a few more clock
cycles here and there ("no one will notice this here indirect jump
instruction?"), ...
it may seem all fine and well, after all, modern computers ARE way the hell
faster and have have craploads more memory.
however, there is another property also worth noting:
these small costs have a way of adding up very quickly and coming to bite
one from behind later on, and so the choice at this later point may become
obvious:
a system which runs clean and smooth and in a small memory footprint;
or, a system which wastes lots of memory and performs like crap.
granted, yes, there are a few things C does not do well at.
this is why, even those of us who write most of their in C, may at times
have reason to use other languages (C++, ASM, or even HLL's / interpreters).
but, C holds its position for good reason, and as I see it, it is not simply
some accident, it all happened this way because it happened to be very good
at what it does well (and its main competitors could not perform similarly
in the same window).
and, granted, yes, a person can write total crap code, even in C...
however, most of its costs are more due to the code written in it, rather
than of the language itself...
or, one could even go as far as to assert that we live in a world where all
is well ordered and where everything happens for a reason (even those things
which may seem, upfront, to be terrible, may have been, at the end of the
day, the best possible course of events...).
.
- References:
- Why C for operating systems
- From: Bill Cunningham
- Why C for operating systems
- Prev by Date: Re: algorithm theory
- Next by Date: Re: Why C for operating systems
- Previous by thread: Re: Why C for operating systems
- Next by thread: Re: Why C for operating systems
- Index(es):
Relevant Pages
|