<?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>oscarbonilla.com &#187; Languages</title>
	<atom:link href="http://oscarbonilla.com/tag/languages/feed/" rel="self" type="application/rss+xml" />
	<link>http://oscarbonilla.com</link>
	<description></description>
	<lastBuildDate>Thu, 15 Dec 2011 18:43:44 +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>Another useless C99 tidbit</title>
		<link>http://oscarbonilla.com/2008/04/another-useless-c99-tidbit/</link>
		<comments>http://oscarbonilla.com/2008/04/another-useless-c99-tidbit/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 06:50:04 +0000</pubDate>
		<dc:creator>ob</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Languages]]></category>

		<guid isPermaLink="false">http://blog.oscarbonilla.com/?p=64</guid>
		<description><![CDATA[Another useless C99 tidbit: trigraphs.]]></description>
			<content:encoded><![CDATA[<p>From page 18 of the <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf">C99</a> standard:</p>
<blockquote><p>
All occurrences in a source ﬁle of the following sequences of three characters (called trigraph sequences) are replaced with the corresponding single character. </p>
<pre>
??= #    ??( [     ??/ \
??) ]      ??' ^     ??< {
??! |      ??> }    ??- ~
</pre>
<p>No other trigraph sequences exist. Each ? that does not begin one of the trigraphs listed above is not changed.
</p></blockquote>
<p>Ok, so take the following C program:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">??=</span>include <span style="color: #339933;">&lt;</span>stdio.<span style="color: #202020;">h</span><span style="color: #339933;">&gt;</span>
<span style="color: #993333;">int</span>
main<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>argv<span style="color: #339933;">??</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">??</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">??&lt;</span>
	<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;hello world<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">??&gt;</span></pre></div></div>

<p>And compile it with the <code>-trigraphs</code> switch to gcc:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">dirac src $ gcc -trigraphs -o trigraphs trigraphs.c
dirac src $ ./trigraphs
hello world</pre></div></div>

<p>Combined with <a href="http://blog.oscarbonilla.com/2008/04/11/hidden-gems-in-c99-1/">this</a> you could seriously obfuscate your C code.</p>
]]></content:encoded>
			<wfw:commentRss>http://oscarbonilla.com/2008/04/another-useless-c99-tidbit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hidden Gems in C99 (1)</title>
		<link>http://oscarbonilla.com/2008/04/hidden-gems-in-c99-1/</link>
		<comments>http://oscarbonilla.com/2008/04/hidden-gems-in-c99-1/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 06:57:26 +0000</pubDate>
		<dc:creator>ob</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Languages]]></category>

		<guid isPermaLink="false">http://blog.oscarbonilla.com/?p=63</guid>
		<description><![CDATA[After some late night reading of the C99 spec, I've found quite a few hidden gems. I'm going to start posting some of these. Since it's late, I'll just post a teaser. On page 64 of the C99 standard it says: In all aspects of the language, the six tokens %: %:%: behave,respectively,the same as [...]]]></description>
			<content:encoded><![CDATA[<p>After some late night reading of the C99 spec, I've found quite a few hidden gems. I'm going to start posting some of these. Since it's late, I'll just post a teaser.</p>
<p>On page 64 of <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf">the C99 standard</a> it says:</p>
<blockquote><p>
In all aspects of the language, the six tokens</p>
<pre>
<: :> <% %> %: %:%:
</pre>
<p>behave,respectively,the same as the six tokens </p>
<pre>
[ ] { } # ##
</pre>
<p>except for their spelling.
</p></blockquote>
<p>Really? Then let's try this program:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">%:</span>include <span style="color: #339933;">&lt;</span>stdio .<span style="color: #202020;">h</span><span style="color: #339933;">&gt;</span>
<span style="color: #993333;">int</span>
main<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>argv<span style="color: #339933;">&lt;::&gt;</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">&lt;%</span>
	<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;hello world<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">%&gt;</span></pre></div></div>

<p>Compile it an run it:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">dirac src $ gcc main.c
dirac src $ ./a.out
hello world</pre></div></div>

<p>Whaddaya know... I know, I know... useless. Wait for the next post then.</p>
]]></content:encoded>
			<wfw:commentRss>http://oscarbonilla.com/2008/04/hidden-gems-in-c99-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Haskell</title>
		<link>http://oscarbonilla.com/2008/04/haskell/</link>
		<comments>http://oscarbonilla.com/2008/04/haskell/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 00:47:53 +0000</pubDate>
		<dc:creator>ob</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Languages]]></category>

		<guid isPermaLink="false">http://blog.oscarbonilla.com/?p=60</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href='http://blog.oscarbonilla.com/wp-content/uploads/2008/04/haskell.png' class="lightview" data-lightview-group="group-60" data-lightview-options="background: { color: '', opacity: 0.00 }, skin: '', border: { color: '', opacity: 0.00, size: 0 }, controls: '', overlay: { background: '', opacity: 0.00, close: true }, radius: { size: 0, position: 'border' }, shadow: false" data-lightview-title="Haskell and VS.Net"><img src="http://blog.oscarbonilla.com/wp-content/uploads/2008/04/haskell.png" alt="At the intersection between Haskell Programmers and VS.NET Users" title="Haskell and VS.Net" width="499" height="483" class="alignnone size-full wp-image-61" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://oscarbonilla.com/2008/04/haskell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I know how to program in&#8230;</title>
		<link>http://oscarbonilla.com/2005/07/i-know-how-to-program-in/</link>
		<comments>http://oscarbonilla.com/2005/07/i-know-how-to-program-in/#comments</comments>
		<pubDate>Sat, 02 Jul 2005 00:52:00 +0000</pubDate>
		<dc:creator>ob</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Languages]]></category>

		<guid isPermaLink="false">http://blog.oscarbonilla.com/?p=5</guid>
		<description><![CDATA[I've been reviewing a number of resumes for programming positions because we're hiring programmers and I've started wondering what it means to know a programing language. For some people it seems it means "I can write hello world in it", and they list dozens of programing languages. From a resume reviewer point of view, this [...]]]></description>
			<content:encoded><![CDATA[<p>I've been reviewing a number of resumes for programming positions because <a href="http://www.bitkeeper.com/Jobs.html">we're hiring programmers</a> and I've started wondering what it means to know a programing language.</p>
<p>For some people it seems it means "I can write hello world in it", and they list dozens of programing languages. From a resume reviewer point of view, this makes it very difficult to see at what level the candidate knows a language. It'd be much better to list only a few and give examples of the programs built on those.</p>
<p>What I'm looking for in a programer basically boils down to this: "can they come up with general purpose abstractions that give the program a self-consistent architecture or do they copy and paste blobs of code to get the job done?".</p>
]]></content:encoded>
			<wfw:commentRss>http://oscarbonilla.com/2005/07/i-know-how-to-program-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

