<?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>hackinghat.com &#187; tibcorv</title>
	<atom:link href="http://www.hackinghat.com/index.php/category/tibcorv/feed" rel="self" type="application/rss+xml" />
	<link>http://www.hackinghat.com</link>
	<description></description>
	<lastBuildDate>Wed, 19 May 2010 07:48:25 +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>Learning Ruby by Extension</title>
		<link>http://www.hackinghat.com/index.php/tibcorv/learning-ruby-by-extension</link>
		<comments>http://www.hackinghat.com/index.php/tibcorv/learning-ruby-by-extension#comments</comments>
		<pubDate>Wed, 14 Mar 2007 13:53:11 +0000</pubDate>
		<dc:creator>Steve Knight</dc:creator>
				<category><![CDATA[tibcorv]]></category>

		<guid isPermaLink="false">http://www.hackinghat.com/index.php/tibcorv/learning-ruby-by-extension</guid>
		<description><![CDATA[So I&#8217;ve spent the past couple of months learning Ruby. My previous employers are python nuts. And I have to admit as languages go Python is pretty good. But then I heard about Rails and so I gave that a try. Already a fan of MVC, Rails appealed to me for the same reasons it [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve spent the past couple of months learning <a href="http://www.ruby-lang.org">Ruby</a>.   My previous employers are <a href="http://www.python.org">python</a> nuts.   And I have to admit as languages go Python is pretty good.    But then I heard about Rails and so I gave that a try.</p>
<p>Already a fan of <a href="http://www.hackinghat.com/index.php/windows/mvp-aka-mvc-in-vbnet">MVC</a>, Rails appealed to me for the same reasons it appeals to everyone else.   It&#8217;s quick to develop!   Still hunting for that killer Rails app I decided to take a look at what else Ruby could do and bought a copy of the <a href="http://www.pragmaticprogrammer.com/titles/ruby/index.html">pickaxe</a>.</p>
<p>Now it just so happened that I learnt Python by writing a wrapper to the <a href="http://www.tibco.com/software/messaging/rendezvous/default.jsp">TibCo Rendezvous</a> library.   I learnt a lot about Python that way.   Especially nasty, dirty stuff, like garbage collection, the <a href="http://www-gatago.com/comp/programming/threads/39541865.html">GIL</a> and other threading nasties.    This is because the Rendezvous library does/requires a number of things internally:</p>
<ol>
<li>creates/destroys memory that could have been referenced by a Python object</li>
<li>requires messages to be &#8216;pumped&#8217; from its message queue and delivered possibly in the same or different threads</li>
<li>requires a callback from the RendezVous library back into Python code</li>
</ol>
<p>These things generate a few programming challenges and require you to understand some internals of the language before you can make much progress.   So it was by some curious happen-chance that I ended up involved with the Ruby version of the <a href="http://rubyforge.org/projects/tibcorv/">project.</a></p>
<p>So now I get to do it all again, but in Ruby!   I&#8217;m hoping to make a better job of it this time, and I&#8217;m also helped by having some of the hard work already done.     I&#8217;ll be posting various bits and bobs about the progress of this project as time passes.</p>
<p>In the main though, learning Ruby by extension has been overall quite pleasant.   I disliked Python&#8217;s extension mechanism because it&#8217;s a bit of a pain to use and in the end I used <a href="http://www.boost.org/libs/python/doc/">Boost::Python</a> instead of using the C fn() calls.    In contrast then the Ruby extension mechanism is as clean as it can be and once a few simple rules are observed things mostly just work how you&#8217;d expect.   </p>
<p>Now then, every concept in computing these days seems to have a TLA to accompany it which is also its mission statement, e.g: REST, DRY, blah, blah.   Well I&#8217;ve now got my own.   Here&#8217;s mine: <strong>SANS.</strong>, <strong>S</strong>imple <strong>A</strong>nd <strong>N</strong>o <strong>S</strong>urprises.   </p>
<p>That&#8217;s what I want, simple programs that work how you&#8217;d expect,   SANS-crap.</p>
<p>Vive l&#8217;ordinateur!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackinghat.com/index.php/tibcorv/learning-ruby-by-extension/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

