<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Andy Balaam's Blog &#187; IGCC</title>
	<atom:link href="http://www.artificialworlds.net/blog/category/igcc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.artificialworlds.net/blog</link>
	<description>Four in the morning, still writing Free Software</description>
	<lastBuildDate>Fri, 10 Feb 2012 09:42:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>IGCC &#8211; a real-eval-print loop for C/C++</title>
		<link>http://www.artificialworlds.net/blog/2009/08/31/igcc-a-real-eval-print-loop-for-cc/</link>
		<comments>http://www.artificialworlds.net/blog/2009/08/31/igcc-a-real-eval-print-loop-for-cc/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 02:56:50 +0000</pubDate>
		<dc:creator>Andy Balaam</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[IGCC]]></category>
		<category><![CDATA[STL]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.artificialworlds.net/blog/?p=198</guid>
		<description><![CDATA[When you first hear about the Read-Eval-Print Loop you might well think &#8220;So what?&#8221; as I did. What&#8217;s so great about being able to type commands interactively? But the thing is that it creeps up on you. Everyone already knows programming is an interactive thing &#8211; we need constant feedback to validate our ideas. Programming [...]]]></description>
			<content:encoded><![CDATA[<p>When you first hear about the <a href="http://en.wikipedia.org/wiki/REPL">Read-Eval-Print Loop</a> you might well think &#8220;So what?&#8221; as I did.</p>
<p>What&#8217;s so great about being able to type commands interactively?</p>
<p>But the thing is that it creeps up on you.</p>
<p>Everyone already knows programming is an interactive thing &#8211; we need constant feedback to validate our ideas.  Programming on paper is incredibly frustrating because you have to plough on with assumptions that are probably wrong.</p>
<p>It&#8217;s just so <emph>comfortable</emph> to be able to try out ideas in an interactive interpreter.</p>
<p><img src="http://www.artificialworlds.net/blog/wp-content/uploads/Baby_foot_artlibre_jnl.jpg" alt="Foosball" title="Foosball" width="150" height="200" class="alignright size-full wp-image-200" /></p>
<p>I mean, it&#8217;s really not much hassle to create a new directory, make a new file, edit the file to contain the code you want to try, remember the right command to compile it, then run the program and see the results, is it?</p>
<p>Well, no, it isn&#8217;t, but it&#8217;s enough of a hassle that sometimes you don&#8217;t bother and you try it out in the code you are really working on, and if your work is like mine that means a minimum of 5 minutes to compile and link, and there you are playing foosball again when you could be getting something done.</p>
<p>The REPL gives you a place to try throwaway things extremely quickly, and when you&#8217;re working with something beautiful like Python it&#8217;s easy to get addicted.</p>
<p>So my mind started to wander and it struck me that a pale imitation of the REPL could be made for us poor C++ programmers, and it would generally serve the purposes I&#8217;ve described above.</p>
<p>So <a href="http://www.artificialworlds.net/wiki/IGCC/IGCC">IGCC</a> was born.  Its name means &#8220;Interactive GCC&#8221; and it&#8217;s a read-eval-print loop for C++ (and, for most cases it will work for C too).</p>
<p>It uses the real GCC underneath, so you know you are running the exact code you would be (and it&#8217;s <emph>somewhat</emph> easier to write than a custom C/C++ interpreter) and all it does is take away the hassle of creating a simple program and compiling it with GCC.</p>
<p>It wraps your code in a standard C program, includes some common dependencies, and compiles it, printing the results of running them immediately.  Using it looks like this:</p>
<pre>$ ./igcc
g++> int a = 5;
g++> a += 2;
g++> cout << a << endl;
7
g++> --a;
g++> cout << a << endl;
6
g++>
</pre>
<p>Apart from all the sugar that I&#8217;d love to add, the main missing features are some kind of equivalent of the <a href="http://www.network-theory.co.uk/docs/pytut/dirFunction.html">Python dir command</a>, and code completion.</p>
<p>It&#8217;s not rocket science, but it might make you a little bit more interactive in your C and C++ coding, which might save you valuable foosball time.</p>
<p>Enjoy, improve, etc. <a href="http://www.artificialworlds.net/wiki/IGCC/IGCC">IGCC</a>.</p>
<p style="font-size:smaller">Foosball image taken from http://en.wikipedia.org/wiki/File:Baby_foot_artlibre_jnl.jpg</p>
]]></content:encoded>
			<wfw:commentRss>http://www.artificialworlds.net/blog/2009/08/31/igcc-a-real-eval-print-loop-for-cc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

