<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Why do we still use C?</title>
	<atom:link href="http://www.dadhacker.com/blog/?feed=rss2&#038;p=833" rel="self" type="application/rss+xml" />
	<link>http://www.dadhacker.com/blog/?p=833</link>
	<description>Instant wisdom about any random thing I feel like.</description>
	<lastBuildDate>Sat, 21 Aug 2010 16:53:56 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jack P.</title>
		<link>http://www.dadhacker.com/blog/?p=833&#038;cpage=1#comment-200</link>
		<dc:creator>Jack P.</dc:creator>
		<pubDate>Tue, 06 Feb 2007 15:51:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=833#comment-200</guid>
		<description>C is so close to current CPU hardware that I don&#039;t see how another language could get &quot;under&quot; it to force it out of the system programming niche. At best we might see some upwards compatible extension (e.g. GNU C, or C 9x or C++) become popular enough to effectively replace C, just as ANSI C has effectively replaced the original K &amp;R C dialect.

Also, I don&#039;t think we&#039;re going to see any new CPU architectures (x86 or Arm) or OSs being developed, and all major current OSs (Unix, Windows) have a C-based API. So C will probably always be the first class citizen for OS work. (Where always means at least 20 more years. :-) )

But C has clearly lost ground in the application programming space, where VB/Java/C# rule, and in the client side of web apps, where JavaScript rules. (And if you consider C-based system programming error prone, wait until you try developing AJAX/ATLAS style programs!)

P.S. I am interested in some of these wacky French programmed-proof systems, like the verifiably correct C compiler that the Coq project is working on. I would like to have a compiler that was known to be correct. If only it didn&#039;t typically take eight times as much code to prove a system correct as to write the system in the first place.</description>
		<content:encoded><![CDATA[<p>C is so close to current CPU hardware that I don&#8217;t see how another language could get &#8220;under&#8221; it to force it out of the system programming niche. At best we might see some upwards compatible extension (e.g. GNU C, or C 9x or C++) become popular enough to effectively replace C, just as ANSI C has effectively replaced the original K &amp;R C dialect.</p>
<p>Also, I don&#8217;t think we&#8217;re going to see any new CPU architectures (x86 or Arm) or OSs being developed, and all major current OSs (Unix, Windows) have a C-based API. So C will probably always be the first class citizen for OS work. (Where always means at least 20 more years. :-) )</p>
<p>But C has clearly lost ground in the application programming space, where VB/Java/C# rule, and in the client side of web apps, where JavaScript rules. (And if you consider C-based system programming error prone, wait until you try developing AJAX/ATLAS style programs!)</p>
<p>P.S. I am interested in some of these wacky French programmed-proof systems, like the verifiably correct C compiler that the Coq project is working on. I would like to have a compiler that was known to be correct. If only it didn&#8217;t typically take eight times as much code to prove a system correct as to write the system in the first place.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.dadhacker.com/blog/?p=833&#038;cpage=1#comment-198</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Mon, 05 Feb 2007 18:59:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=833#comment-198</guid>
		<description>C is also hard to leave.  I come from a kernel background on embedded applications.  Now I&#039;m designing a server, and performance is key.  I find it hard to trust languages such as Java in terms of memory allocation, efficient buffer handling, etc.  Everything tells me to use C, but we&#039;ll be hiring other developers over time that probably won&#039;t be C experts, which scares me into using something a little more application programmer friendly.</description>
		<content:encoded><![CDATA[<p>C is also hard to leave.  I come from a kernel background on embedded applications.  Now I&#8217;m designing a server, and performance is key.  I find it hard to trust languages such as Java in terms of memory allocation, efficient buffer handling, etc.  Everything tells me to use C, but we&#8217;ll be hiring other developers over time that probably won&#8217;t be C experts, which scares me into using something a little more application programmer friendly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: landon</title>
		<link>http://www.dadhacker.com/blog/?p=833&#038;cpage=1#comment-194</link>
		<dc:creator>landon</dc:creator>
		<pubDate>Sun, 04 Feb 2007 04:13:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=833#comment-194</guid>
		<description>(See post about FORTH).</description>
		<content:encoded><![CDATA[<p>(See post about FORTH).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim D</title>
		<link>http://www.dadhacker.com/blog/?p=833&#038;cpage=1#comment-193</link>
		<dc:creator>Tim D</dc:creator>
		<pubDate>Sun, 04 Feb 2007 01:00:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=833#comment-193</guid>
		<description>What do you think of Forth?  It&#039;s different and it&#039;s fast.</description>
		<content:encoded><![CDATA[<p>What do you think of Forth?  It&#8217;s different and it&#8217;s fast.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Volz</title>
		<link>http://www.dadhacker.com/blog/?p=833&#038;cpage=1#comment-192</link>
		<dc:creator>Joshua Volz</dc:creator>
		<pubDate>Sat, 03 Feb 2007 19:44:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=833#comment-192</guid>
		<description>Wasn&#039;t C supposed to be the &quot;portable assembly language?&quot;  I believe that C&#039;s flexibility to work on multiple architectures has helped its proliferation.  It&#039;s also the beginning of everything.  There aren&#039;t language replacing it, because most of the languages that have been written since then are implemented in C or C++.  Java, Python, Ruby and C# for example.  

Admittedly, C doesn&#039;t provide the higher level abstractions and doesn&#039;t really supply a way to create domain specific languages with ease (for example, somebody mentioned the language understanding paging above).  If you need to create a DSL, you are basically as restricted as you are in Java, which leads to fooling the type system (void* anyone) or making a bunch of XML documents.  

I think we still use C because we have a large amount of existing C code, it&#039;s really fast (particularly compared to the languages implemented in it), everybody who learned CS in school is at some point forced to learn about pointers, as they are the basis for all kinds of other artifacts in the higher level languages.  This is kind of like asking &quot;why do we still use gasoline?&quot;  The answer is that everybody is used to it, consumers, mechanics, car companies, oil companies, national politics, et cetera.  If you make a fundamental system change, everyone will have to be reeducated.  I am not saying it is impossible, I am just saying it is a big task.</description>
		<content:encoded><![CDATA[<p>Wasn&#8217;t C supposed to be the &#8220;portable assembly language?&#8221;  I believe that C&#8217;s flexibility to work on multiple architectures has helped its proliferation.  It&#8217;s also the beginning of everything.  There aren&#8217;t language replacing it, because most of the languages that have been written since then are implemented in C or C++.  Java, Python, Ruby and C# for example.  </p>
<p>Admittedly, C doesn&#8217;t provide the higher level abstractions and doesn&#8217;t really supply a way to create domain specific languages with ease (for example, somebody mentioned the language understanding paging above).  If you need to create a DSL, you are basically as restricted as you are in Java, which leads to fooling the type system (void* anyone) or making a bunch of XML documents.  </p>
<p>I think we still use C because we have a large amount of existing C code, it&#8217;s really fast (particularly compared to the languages implemented in it), everybody who learned CS in school is at some point forced to learn about pointers, as they are the basis for all kinds of other artifacts in the higher level languages.  This is kind of like asking &#8220;why do we still use gasoline?&#8221;  The answer is that everybody is used to it, consumers, mechanics, car companies, oil companies, national politics, et cetera.  If you make a fundamental system change, everyone will have to be reeducated.  I am not saying it is impossible, I am just saying it is a big task.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eli Gottlieb</title>
		<link>http://www.dadhacker.com/blog/?p=833&#038;cpage=1#comment-189</link>
		<dc:creator>Eli Gottlieb</dc:creator>
		<pubDate>Sat, 03 Feb 2007 04:03:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=833#comment-189</guid>
		<description>&quot;Pray that you have everything right in sync, that you understand the memory system semantics, that the fancy runtime hasn’t gotten in your way, and that you haven’t forgotten a zillion details about the rules for environment you’re writing for).&quot;

In that case you need a language whose syntax, semantics and runtime all match the architecture to which you code.

I&#039;ve got a pet kernel whose virtual memory manager has had too many bugs for ages, so I&#039;d love a language that inherently understood what page tables, segments and descriptor tables are, and how to check them for validity!  However, this language would be stuck firmly on my x86 processor.  It would limit the portability of my kernel in addition to its own.  Yikes.

We use C and Object Pascal as compromises: low-level enough that a smart human can take the time and write useful systems code without the language&#039;s ideas about theory of computation getting in the way, but high enough that doing so takes months instead of years.

A Lisp operating system worked on Lisp machines where the language matched the architecture.  C still reasonably approximates the resources available to a kernel programmer at boot when the kernel knows nothing about the hardware it runs on and has no hardware resources of which to speak.</description>
		<content:encoded><![CDATA[<p>&#8220;Pray that you have everything right in sync, that you understand the memory system semantics, that the fancy runtime hasn’t gotten in your way, and that you haven’t forgotten a zillion details about the rules for environment you’re writing for).&#8221;</p>
<p>In that case you need a language whose syntax, semantics and runtime all match the architecture to which you code.</p>
<p>I&#8217;ve got a pet kernel whose virtual memory manager has had too many bugs for ages, so I&#8217;d love a language that inherently understood what page tables, segments and descriptor tables are, and how to check them for validity!  However, this language would be stuck firmly on my x86 processor.  It would limit the portability of my kernel in addition to its own.  Yikes.</p>
<p>We use C and Object Pascal as compromises: low-level enough that a smart human can take the time and write useful systems code without the language&#8217;s ideas about theory of computation getting in the way, but high enough that doing so takes months instead of years.</p>
<p>A Lisp operating system worked on Lisp machines where the language matched the architecture.  C still reasonably approximates the resources available to a kernel programmer at boot when the kernel knows nothing about the hardware it runs on and has no hardware resources of which to speak.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: landon</title>
		<link>http://www.dadhacker.com/blog/?p=833&#038;cpage=1#comment-188</link>
		<dc:creator>landon</dc:creator>
		<pubDate>Sat, 03 Feb 2007 03:51:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=833#comment-188</guid>
		<description>I looked at D. It doesn&#039;t truly change anything about the way you do systems software (that is: Pray that you have everything compiled in sync with the same headers, with nothing stale, that you understand the memory system semantics, that the fancy runtime hasn&#039;t gotten in your way, and that you haven&#039;t forgotten a zillion rules for environment you&#039;re writing for).

I have a rant in progress about this....

Oh boy.  In the early 80s I was in love with LISP machines (made a pilgrammage to MIT to visit my friend Jack and to see the LMs on the 9th floor). Wonderful things, but evolutionary Do-do birds as soon as stock hardware got fast enough (I&#039;m going to have to crank up a CADR emulator some time).

I&#039;ve written tons of code in Object Pascal. Thanks, no. This was in the late 80s and early 90s on the Macintosh. My experience with Pascal-like languages is that you generally lie to the type system about as much as you lie in C.  The languages are really equivalent.  You&#039;re doing the same things, with &quot;semicolons in different places.&quot; I believe that Object Pascal has non-&quot;duck&quot;-types, which are stronger, yes, but I think not the whole story.  Again, things like having stale objects around, getting interfaces out of sync and screwing up your environmental rules are equally possible. O-P is not a panacea.

More, when the toddler is asleep... :-)</description>
		<content:encoded><![CDATA[<p>I looked at D. It doesn&#8217;t truly change anything about the way you do systems software (that is: Pray that you have everything compiled in sync with the same headers, with nothing stale, that you understand the memory system semantics, that the fancy runtime hasn&#8217;t gotten in your way, and that you haven&#8217;t forgotten a zillion rules for environment you&#8217;re writing for).</p>
<p>I have a rant in progress about this&#8230;.</p>
<p>Oh boy.  In the early 80s I was in love with LISP machines (made a pilgrammage to MIT to visit my friend Jack and to see the LMs on the 9th floor). Wonderful things, but evolutionary Do-do birds as soon as stock hardware got fast enough (I&#8217;m going to have to crank up a CADR emulator some time).</p>
<p>I&#8217;ve written tons of code in Object Pascal. Thanks, no. This was in the late 80s and early 90s on the Macintosh. My experience with Pascal-like languages is that you generally lie to the type system about as much as you lie in C.  The languages are really equivalent.  You&#8217;re doing the same things, with &#8220;semicolons in different places.&#8221; I believe that Object Pascal has non-&#8221;duck&#8221;-types, which are stronger, yes, but I think not the whole story.  Again, things like having stale objects around, getting interfaces out of sync and screwing up your environmental rules are equally possible. O-P is not a panacea.</p>
<p>More, when the toddler is asleep&#8230; :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CLH</title>
		<link>http://www.dadhacker.com/blog/?p=833&#038;cpage=1#comment-187</link>
		<dc:creator>CLH</dc:creator>
		<pubDate>Sat, 03 Feb 2007 03:17:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=833#comment-187</guid>
		<description>The &lt;a href=&quot;http://en.wikipedia.org/wiki/Lisp_machine&quot; rel=&quot;nofollow&quot;&gt;Lisp Machines&lt;/a&gt; ran an OS written in lisp, hardware designed specifically to run &lt;a href=&quot;http://en.wikipedia.org/wiki/Pascal_MicroEngine&quot; rel=&quot;nofollow&quot;&gt;Pascal&lt;/a&gt;, and even &lt;a href=&quot;http://en.wikipedia.org/wiki/PicoJava&quot; rel=&quot;nofollow&quot;&gt;Java bytecode&lt;/a&gt;.  Naturally the LMs had an emacs-like editor, &lt;a href=&quot;http://en.wikipedia.org/wiki/Zmacs&quot; rel=&quot;nofollow&quot;&gt;zmacs&lt;/a&gt; written in lisp along with the GUI, TCP/IP stack, etc.

C is used for those purposes today because the OS and libraries they run on are written in C, and because hardware is optimized for C&#039;s execution model, not because of any inherent superiority for such tasks.</description>
		<content:encoded><![CDATA[<p>The <a href="http://en.wikipedia.org/wiki/Lisp_machine" rel="nofollow">Lisp Machines</a> ran an OS written in lisp, hardware designed specifically to run <a href="http://en.wikipedia.org/wiki/Pascal_MicroEngine" rel="nofollow">Pascal</a>, and even <a href="http://en.wikipedia.org/wiki/PicoJava" rel="nofollow">Java bytecode</a>.  Naturally the LMs had an emacs-like editor, <a href="http://en.wikipedia.org/wiki/Zmacs" rel="nofollow">zmacs</a> written in lisp along with the GUI, TCP/IP stack, etc.</p>
<p>C is used for those purposes today because the OS and libraries they run on are written in C, and because hardware is optimized for C&#8217;s execution model, not because of any inherent superiority for such tasks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eli Gottlieb</title>
		<link>http://www.dadhacker.com/blog/?p=833&#038;cpage=1#comment-185</link>
		<dc:creator>Eli Gottlieb</dc:creator>
		<pubDate>Sat, 03 Feb 2007 02:21:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=833#comment-185</guid>
		<description>Try out Object Pascal, as implemented by the Free Pascal Compiler.  It&#039;s got classes, manually allocated dynamic arrays, reference counted strings that can be handled manually at the programmer&#039;s convenience, a much stronger type system than C, exceptions, and the option to compile in run-time sanity checks.

The only downside is that you have to write a minimal Run-Time Library for bare metal.  I can send you mine, if you like, but several are already on the Free Pascal unit contributions page.</description>
		<content:encoded><![CDATA[<p>Try out Object Pascal, as implemented by the Free Pascal Compiler.  It&#8217;s got classes, manually allocated dynamic arrays, reference counted strings that can be handled manually at the programmer&#8217;s convenience, a much stronger type system than C, exceptions, and the option to compile in run-time sanity checks.</p>
<p>The only downside is that you have to write a minimal Run-Time Library for bare metal.  I can send you mine, if you like, but several are already on the Free Pascal unit contributions page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Uzair</title>
		<link>http://www.dadhacker.com/blog/?p=833&#038;cpage=1#comment-184</link>
		<dc:creator>Uzair</dc:creator>
		<pubDate>Sat, 03 Feb 2007 00:19:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=833#comment-184</guid>
		<description>Have you looked at D? It&#039;s certainly from the C family but much cleaner than C++ ever dreamt of being.</description>
		<content:encoded><![CDATA[<p>Have you looked at D? It&#8217;s certainly from the C family but much cleaner than C++ ever dreamt of being.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
