Monday, May 24, 2010

Mostly operating system develop in c,why ?

The C programming language is considered to be a low to middle level language; in other words, while you can program using the usual kind of stuff: functions, types, and so-on, C also makes it easier to program using assembly language (also called 'bit twiddling'). OS developers often use C because of this. They can program many facets of an OS much faster with C, but they can still get close to the metal to program the more delicate sequences.





Assembly language and the aspects of C allowing the same function are use for things like disk formatting, code optimization, drivers, and things like that. Other more high leveled languages make this more difficult. An example is the C++ programming language, which while being object oriented and based directly on C, makes it more difficult to program close to the metal.

Mostly operating system develop in c,why ?
One consequence of C's wide acceptance and efficiency is that the compilers, libraries, and interpreters of other higher-level languages are often implemented in C.





C is used as an intermediate language by some higher-level languages. This is implemented in one of two ways, as languages which:





Emit C source code, and one or more other representations: machine code, object code, and/or bytecodes. Examples: some Lisp dialects (Lush), Squeak's C-subset Slang.


Emit C source code only, and no other representation. Examples: Eiffel, Sather; Esterel.


C source code is then input to a C compiler, which then emits finished machine or object code. This is done to gain portability (C compilers exist for nearly all platforms) and to avoid having to develop machine-specific code generators.





Unfortunately, C was designed as a programming language, not as a compiler target language, and is thus less than ideal for use as an intermediate language. This has led to development of C-based intermediate languages such as C


No comments:

Post a Comment