Why would you ever use a language which isn't C? All you will ever need is C. Everyone knows it, and it can run on everything. Why use some stupid hipster language like LISP or Haskell? Just accept C is superior.
Too low-level to do high-level stuff, too high-level to do low-level stuff.
Name:
Anonymous2011-05-08 22:36
C is highlevel assembly. That doesn't necessarily make it bad; but it makes rather obviously clear that you wouldn't want to do highlevel stuff in it.
C was, after all, designed to write operating systems in it.
And C is perfect for exactly that.
Name:
Anonymous2011-05-08 22:39
Not just operating systems, but kernels specifically. C is really only good for stuff that needs to be super optimized, like kernels and low-level tools. I'm sure as fuck not gonna go write a web browser in straight C when I can use an object-oriented approach in Objective-C or another language.
>>7-8 but kernels specifically.
You can't even boot up a simple ``Hello, World!'' kernel without using Assembly. You should either use Forth-assisted Assembly (and you also get a REPL for free, since you can just embed a small Forth interpreter in the kernel), or even just Assembly and macros.
Also, widely used != quality, look at COBOL, look at Java, C is no exception. It's just too much work to replace it at that level, it would completely fuck up the compatibility with other systems, especially if you want to do things good and make it impossible to implement a POSIX layer on top of your system.
The whole concept of ``high-level assembly'', ``portable assembly'', ``portable low-level language'' is just flawed and moronic.
When you work at low-level, you want architecture specific stuff, how can you ``set al to 10h'' when the al register is something x86-specific? But, an assembly language, a low level language, must be able to do so, else it would be completely useless. To write a kernel, to write an OS, you must deal with lots and lots of architecture-specific stuff.
To get in protected mode, in x86, you have to disable interrupts, load the global descriptor table and set the lowest bit of the cr0 register. In some other architecture, it may just start in an equivalent ``protected mode''. C can't even access the FLAGS register (which makes implementing bignums painful), how the hell can it access the fucking cr0 register? By the power of magic?
A low-level language can't be portable. C fails at low-level because it wants to be portable.
Now, the funny part is that it fails at being portable because it wants to be low-level, so yes, it is a portable, efficient low-level language modulo all the low-level stuff being written in assembly, modulo all the #ifdef, #else, #include "arch/x86.h", #include "arch/ppc.h".
Name:
Anonymous2011-05-09 1:42
C can't even access the FLAGS register
Name lan guages that can?