View Single Post
Old 7th November 2008
Oko's Avatar
Oko Oko is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 1,102
Default

Quote:
Originally Posted by mdh View Post
As much as I like C, I have to ask in what way you find it to be "small"? C is simple indeed, in that it stays out of my way and lets me do what I want to do (for the most part - being able to cast a function pointer to void * and pass it around would be useful). I don't see the small, though. Compilers are hugely complex, and the amount of code that must be written to perform a given task is usually more than with a lot of other, especially interpreted, languages.
If I remember correctly the reason that Ken Thomson chose C to write Unix was that once compiled C binaries are only 30% slower and bigger than if the Unix was coded in Assembly. Do not forget that Ken, Denis, and company where grand masters of the Assembly which was at the time consider basic programming skill. Roff and original version of Troff were written in Assembly.
In 60 both Ken and Ritch actually were involved in the writing an unsuccessful time-sharing operating system in Assembly.


The fact that Ruby in one command can do for what C needs 20 commands doesn't make it simple. The simplest language is Assembly (or to be more precise Assembly for couple MIPS chip-sets) and every C line of code requires 5 lines of code in Assembly.

Your remark about compilers is only partially true. It is true that modern compilers or more precisely GCC are huge but that fact is that you do not need compiler to run binaries unlike interpreter which must be present to execute program written in an interpreting language. Do you think it would be possible for Damn Small Linux to be 50MB if it had compiler? Basic OpenBSD installation is about 540MB (I never install the games and install bsd.mp kernel only if the machine actually has multiple processors). Without compiler the installation is only 300MB. It is fairly easy to trim down "Desktop" version of OpenBSD probably to 200MB.

On the another note I, as many OpenBSD users, have hight hope that GCC will be thing of the past in no time and that PCC will be the only compiler present in the base of the system.


C is not a perfect language. The C is if I remember correctly soft parsing
language. This problem is know from late 70 when U.S. department of defense commission large grant to overcome that weakness. Since C was not fixable they invented whole new language ADA Most of software for embedded devices in airplanes for instance is written in ADA for that particular reason.

The reality is that no computer language is perfect since otherwise we would not have so many of them. An average Unix user must use interpreter on the daily base (shell). I cast my vote for C but I really like
shell, sed, awk, and perl. In my line of the work I have to use mark up languages far more often (mostly TeX which is actually interpreter but
also HTML and CSS) than any of previous languages. All of us also use every day Post Script but only few of us thing of it as a real programming language which is. Post Script is the best language for describing graphics on the page but is general purpose language which could be used to program numerical computations for instance.

How relevant my opinion is? Probably not very much. In all my life I was exposed mostly to procedural languages with the exception of Lisp (Functional) and Fortran (Numerical language).

Last edited by Oko; 7th November 2008 at 03:52 PM.
Reply With Quote