<?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>Adztec Independent - Blog &#187; programming</title>
	<atom:link href="http://www.adztec-independent.de/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.adztec-independent.de</link>
	<description>Programming Ruby / JRuby / Rails / Common Lisp by Christopher Bertels</description>
	<lastBuildDate>Mon, 13 Sep 2010 22:58:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fancy Talk @ Warpzone.ms</title>
		<link>http://www.adztec-independent.de/2010/09/fancy-talk-warpzone-ms/</link>
		<comments>http://www.adztec-independent.de/2010/09/fancy-talk-warpzone-ms/#comments</comments>
		<pubDate>Mon, 13 Sep 2010 22:58:58 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[fancy]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[hackerspace]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[hobbies]]></category>
		<category><![CDATA[interpreter]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[smalltalk]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.adztec-independent.de/?p=284</guid>
		<description><![CDATA[Hey,
I haven&#8217;t posted here in a long time. Mostly due to working on Fancy a lot. Just wanted to post a video of a talk I gave in June at warpzone.ms hackerspace in Münster (Germany).
The talk is in German, but it might be of interest to some people, so here it is:

Fancy Talk 12.06.2010 @ [...]]]></description>
			<content:encoded><![CDATA[<p>Hey,</p>
<p>I haven&#8217;t posted here in a long time. Mostly due to working on <a href="http://www.fancy-lang.org" target="_blank">Fancy</a> a lot. Just wanted to post a video of a talk I gave in June at <a href="http://www.warpzone.ms" target="_blank">warpzone.ms </a>hackerspace in Münster (Germany).</p>
<p>The talk is in German, but it might be of interest to some people, so here it is:</p>
<p><iframe src="http://player.vimeo.com/video/12537929" width="549" height="309" frameborder="0"></iframe>
<p><a href="http://vimeo.com/12537929">Fancy Talk 12.06.2010 @ Warpzone.ms</a> from <a href="http://vimeo.com/user4042217">Christopher Bertels</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adztec-independent.de/2010/09/fancy-talk-warpzone-ms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Project: The Fancy Programming Language</title>
		<link>http://www.adztec-independent.de/2010/03/new-project-the-fancy-programming-language/</link>
		<comments>http://www.adztec-independent.de/2010/03/new-project-the-fancy-programming-language/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 21:37:22 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[fancy]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[hobbies]]></category>
		<category><![CDATA[interpreter]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[meta-programming]]></category>
		<category><![CDATA[parallel programming]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.adztec-independent.de/?p=278</guid>
		<description><![CDATA[Ok, I know I&#8217;m not a frequent poster. I guess, that&#8217;s just the way it is. Anyways..
I&#8217;ve been up to a lot of stuff in the past few months. Related to programming there are two projects, one of them I&#8217;m still working on (and intend to do so for the forseeable future):

generica, a small, simple [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, I know I&#8217;m not a frequent poster. I guess, that&#8217;s just the way it is. Anyways..</p>
<p>I&#8217;ve been up to a lot of stuff in the past few months. Related to programming there are two projects, one of them I&#8217;m still working on (and intend to do so for the forseeable future):</p>
<ul>
<li><a href="http://github.com/bakkdoor/generica">generica</a>, a small, simple &amp; dirty lisp-like language interpreter implemented in ANSI C.</li>
<li>and <a href="http://github.com/bakkdoor/fancy/">Fancy</a>, a new object-oriented dynamic programming language, heavily inspired by Ruby, Smalltalk and Erlang. There&#8217;s also a website up, but far from finished: <a href="http://fancy-lang.org">fancy-lang.org</a> &#8211; Check it out if you like <img src='http://www.adztec-independent.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p>So yeah, the latter project I started about 6 weeks ago but didn&#8217;t have the time to really work on it until about 3 weeks ago. Since then I&#8217;ve managed to implement quite a few features.<br />
Here&#8217;s a small overview of features working in Fancy already:</p>
<ul>
<li>Class definitions</li>
<li>Method definitions</li>
<li>String, Integer, Double, Array, Hash (Hashmap), and Block (lambda function / closure) Literals</li>
<li>Method and operator calls (<em>sending messages to objects</em>)</li>
<li>Simple loops</li>
<li>Support for closures (performance improvements are definately possible though <img src='http://www.adztec-independent.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</li>
</ul>
<p>There&#8217;s still lots of stuff missing, obviously. Mainly most of the standard library (I/O, Threading/Concurrency, Networking, etc&#8230;) will have to implemented as well as some runtime features I haven&#8217;t finished or started yet. But it&#8217;s getting along quite nicely. If anyone dares to try it out, I&#8217;d love to hear some feedback, especially hearing some opinions on the overall feel and semantics of the language would be nice. You can get the code on github (see the link above) and try to build it. Compiling instructions are in the README file. Fancy is licensed under the GNU LGPL.</p>
<p>I&#8217;m still excited to see where this is gonna go, for myself and possibly others as well. We&#8217;ll see.</p>
<p>I&#8217;ll probably post some more information on the language and its implementation some time soon. Need to go now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adztec-independent.de/2010/03/new-project-the-fancy-programming-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Screencast: Debugging with Emacs &amp; GDB</title>
		<link>http://www.adztec-independent.de/2009/11/screencast-debugging-with-emacs-gdb/</link>
		<comments>http://www.adztec-independent.de/2009/11/screencast-debugging-with-emacs-gdb/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 00:29:18 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[hobbies]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[screencast]]></category>
		<category><![CDATA[stupidvm]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.adztec-independent.de/?p=265</guid>
		<description><![CDATA[Hey there.
I wish I&#8217;d be posting more recently, but haven&#8217;t really had the time to do so.
I just wanted to share with you a small screencast I created today on debugging with emacs and gdb, since I think it might be of interest to someone else as well.
You can check out the video at my [...]]]></description>
			<content:encoded><![CDATA[<p>Hey there.<br />
I wish I&#8217;d be posting more recently, but haven&#8217;t really had the time to do so.<br />
I just wanted to share with you a small screencast I created today on debugging with emacs and gdb, since I think it might be of interest to someone else as well.</p>
<p>You can check out the video at my blip.tv channel: <a href="http://bakkdoor.blip.tv/" target="_blank">http://bakkdoor.blip.tv/ </a><br />
Currently the video is being converted to flash video (.flv), so you might want to check out the .ogv video file here, if it&#8217;s not done yet: <a href="http://blip.tv/file/2804484" target="_blank">http://blip.tv/file/2804484</a></p>
<p><strong>[Update:]</strong><br />
Video is available now. You can also watch it here:<br />
<embed src="http://blip.tv/play/g7R2gayxfAA" type="application/x-shockwave-flash" width="525" height="402" allowscriptaccess="always" allowfullscreen="true"></embed></p>
<p>Anyhow, I hope you like it and I&#8217;d like to hear some feedback.</p>
<p>Btw, the programm I&#8217;m debugging in the video is <strong>stupidvm</strong>, a small &#038; stupid virtual machine I&#8217;ve started working on 2 weeks ago, written in C.<br />
You can check out the code either on <a href="http://gitorious.org/stupidvm/stupidvm/" target="_blank">gitorious</a> or <a href="http://github.com/bakkdoor/stupidvm/" target="_blank">github</a>.</p>
<p>Feedback is, as always, welcome <img src='http://www.adztec-independent.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
I hope you like it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adztec-independent.de/2009/11/screencast-debugging-with-emacs-gdb/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Blocktalk Rubygem</title>
		<link>http://www.adztec-independent.de/2009/06/blocktalk-rubygem/</link>
		<comments>http://www.adztec-independent.de/2009/06/blocktalk-rubygem/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 21:05:27 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[blocktalk]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubygems]]></category>

		<guid isPermaLink="false">http://www.adztec-independent.de/?p=255</guid>
		<description><![CDATA[Blocktalk can now be easily installed via Rubygems:

gem sources -a http://gems.github.com (if not done yet)
sudo gem install bakkdoor-blocktalk

You can then simply run blocktalk from the shell via

blocktalk sourcefile.bt

To look at some debug information (e.g. the AST, the generated ruby code etc.) type:

blocktalk sourcefile.bt &#8211;debug
or
blocktalk sourcefile.bt &#8211;ruby (to only show the generated ruby code)

Feel free to [...]]]></description>
			<content:encoded><![CDATA[<p>Blocktalk can now be easily installed via <a href="http://rubygems.org/" target="_blank">Rubygems</a>:</p>
<blockquote><p>
<b>gem sources -a http://gems.github.com</b> (if not done yet)<br />
<b>sudo gem install bakkdoor-blocktalk</b>
</p></blockquote>
<p>You can then simply run blocktalk from the shell via</p>
<blockquote><p>
<b>blocktalk sourcefile.bt</b>
</p></blockquote>
<p>To look at some debug information (e.g. the AST, the generated ruby code etc.) type:</p>
<blockquote><p>
<b>blocktalk sourcefile.bt &#8211;debug</b><br />
or<br />
<b>blocktalk sourcefile.bt &#8211;ruby</b> (to only show the generated ruby code)
</p></blockquote>
<p>Feel free to play around with it, check out the examples in the examples folder, if you want to get a start.<br />
Would love to hear some feedback from anyone who&#8217;s interested, since this is my first attempt to language design <img src='http://www.adztec-independent.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.adztec-independent.de/2009/06/blocktalk-rubygem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blocktalk version 0.1 released</title>
		<link>http://www.adztec-independent.de/2009/06/blocktalk-version-01-released/</link>
		<comments>http://www.adztec-independent.de/2009/06/blocktalk-version-01-released/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 01:47:31 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[blocktalk]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[hobbies]]></category>
		<category><![CDATA[interpreter]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.adztec-independent.de/?p=253</guid>
		<description><![CDATA[I just released version 0.1 of Blocktalk at Github.
I&#8217;ve added quite some features in the past few days and got all of my main problems fixed and the most important features working.
One thing that was on that list until today was chained method calls.
Up to this point, the only way to chain method calls was [...]]]></description>
			<content:encoded><![CDATA[<p>I just released <a href="http://github.com/bakkdoor/blocktalk/downloads">version 0.1 of Blocktalk at Github</a>.<br />
I&#8217;ve added quite some features in the past few days and got all of my main problems fixed and the most important features working.<br />
One thing that was on that list until today was chained method calls.<br />
Up to this point, the only way to chain method calls was to surround each method call with parentheses, like this:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.adztec-independent.de/wp-content/plugins/wp-codebox/wp-codebox.php?p=253&amp;download=parens.bt">parens.bt</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2534"><td class="code" id="p253code4"><pre class="smalltalk" style="font-family:monospace;">str <span style="color: #000066; font-weight:bold;">=</span> <span style="">&#40;</span><span style="color: #007f00; font-style: italic;">&quot;Hello, world!&quot;</span> upcase<span style="">&#41;</span> gsub: <span style="color: #007f00; font-style: italic;">&quot;,&quot;</span> with: <span style="color: #007f00; font-style: italic;">&quot;:&quot;</span></pre></td></tr></table></div>

<p>Now you can do something like this:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.adztec-independent.de/wp-content/plugins/wp-codebox/wp-codebox.php?p=253&amp;download=no-parens.bt">no-parens.bt</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2535"><td class="code" id="p253code5"><pre class="smalltalk" style="font-family:monospace;">str <span style="color: #000066; font-weight:bold;">=</span> <span style="color: #007f00; font-style: italic;">&quot;Hello, world!&quot;</span> upcase gsub: <span style="color: #007f00; font-style: italic;">&quot;,&quot;</span> with: <span style="color: #007f00; font-style: italic;">&quot;:&quot;</span></pre></td></tr></table></div>

<p>Which is equivalent to this ruby code:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.adztec-independent.de/wp-content/plugins/wp-codebox/wp-codebox.php?p=253&amp;download=no-parens.rb">no-parens.rb</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2536"><td class="code" id="p253code6"><pre class="ruby" style="font-family:monospace;">str = <span style="color:#996600;">&quot;Hello, world!&quot;</span>.<span style="color:#9900CC;">upcase</span>.<span style="color:#CC0066; font-weight:bold;">gsub</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;,&quot;</span>, <span style="color:#996600;">&quot;:&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>

<p>Much nicer, if you ask me. Of course you can chain as many methods as you want, even with each method taking a codeblock, if you want to (as it is possible in ruby as well).<br />
So now that I&#8217;ve got the most important things done, I&#8217;ll try to focus a little more on refactoring, working on the standard library (adding more classes &#038; methods) and thinking about some more unique, new features for the language <img src='http://www.adztec-independent.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.adztec-independent.de/2009/06/blocktalk-version-01-released/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Blocktalk code available @ Github</title>
		<link>http://www.adztec-independent.de/2009/06/blocktalk-code-available-github/</link>
		<comments>http://www.adztec-independent.de/2009/06/blocktalk-code-available-github/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 01:38:56 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[blocktalk]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[hobbies]]></category>
		<category><![CDATA[interpreter]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.adztec-independent.de/?p=250</guid>
		<description><![CDATA[I just released the code for my Blocktalk interpreter at Github.
Feel free to clone my repository, create patches or file in some bugs, if you dare to  
]]></description>
			<content:encoded><![CDATA[<p>I just released the code for my Blocktalk interpreter <a href="http://github.com/bakkdoor/blocktalk/" target="_blank"><strong>at Github</strong></a>.<br />
Feel free to clone my repository, create patches or file in some bugs, if you dare to <img src='http://www.adztec-independent.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.adztec-independent.de/2009/06/blocktalk-code-available-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blocktalk: A simple portscanner</title>
		<link>http://www.adztec-independent.de/2009/06/blocktalk-a-simple-portscanner/</link>
		<comments>http://www.adztec-independent.de/2009/06/blocktalk-a-simple-portscanner/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 00:14:36 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[blocktalk]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[hobbies]]></category>
		<category><![CDATA[interpreter]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.adztec-independent.de/?p=242</guid>
		<description><![CDATA[Here&#8217;s a little blocktalk script, that shows the latest working feature I&#8217;ve added to my Blocktalk interpreter: Exception handling  
Basically, it&#8217;s just a simple portscanner.

?Download portscan.btSystem require: &#34;socket&#34;
&#160;
host = &#34;localhost&#34;
&#160;
&#40;ARGV at: 0&#41; if &#123;
  host = &#40;ARGV at: 0&#41;
&#125;
&#160;
open_ports = &#91;&#93;
&#160;
1 upto: 1024 do &#124;port&#124;
  Thread new &#123;
    try&#123;
 [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a little blocktalk script, that shows the latest working feature I&#8217;ve added to my Blocktalk interpreter: Exception handling <img src='http://www.adztec-independent.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Basically, it&#8217;s just a simple portscanner.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.adztec-independent.de/wp-content/plugins/wp-codebox/wp-codebox.php?p=242&amp;download=portscan.bt">portscan.bt</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2428"><td class="code" id="p242code8"><pre class="smalltalk" style="font-family:monospace;"><span style="color: #0000ff;">System</span> require: <span style="color: #007f00; font-style: italic;">&quot;socket&quot;</span>
&nbsp;
host <span style="color: #000066; font-weight:bold;">=</span> <span style="color: #007f00; font-style: italic;">&quot;localhost&quot;</span>
&nbsp;
<span style="">&#40;</span><span style="color: #0000ff;">ARGV</span> at: <span style="color: #00007f;">0</span><span style="">&#41;</span> if <span style="">&#123;</span>
  host <span style="color: #000066; font-weight:bold;">=</span> <span style="">&#40;</span><span style="color: #0000ff;">ARGV</span> at: <span style="color: #00007f;">0</span><span style="">&#41;</span>
<span style="">&#125;</span>
&nbsp;
open_ports <span style="color: #000066; font-weight:bold;">=</span> <span style="">&#91;</span><span style="">&#93;</span>
&nbsp;
1 upto: <span style="color: #00007f;">1024</span> do |<span style="color: #00007f;">port</span>|
  <span style="color: #0000ff;">Thread</span> new <span style="">&#123;</span>
    try<span style="">&#123;</span>
      t <span style="color: #000066; font-weight:bold;">=</span> <span style="color: #0000ff;">TCPSocket</span> new: <span style="color: #00007f;">host</span> port: <span style="color: #00007f;">port</span>
      open_ports &lt;&lt; port
&nbsp;
      s <span style="color: #000066; font-weight:bold;">=</span> <span style="color: #0000ff;">Socket</span> getnameinfo: <span style="">&#91;</span><span style="color: #007f00; font-style: italic;">&quot;AF_INET&quot;</span>, <span style="color: #00007f;">port</span>, <span style="color: #00007f;">host</span><span style="">&#93;</span>
      <span style="color: #0000ff;">Console</span> puts: <span style="">&#40;</span><span style="color: #007f00; font-style: italic;">&quot;\nPort #{port} (#{s[1]})&quot;</span> + <span style="color: #007f00; font-style: italic;">&quot; is open.&quot;</span><span style="">&#41;</span>
&nbsp;
      catch<span style="">&#123;</span>
        <span style="color: #0000ff;">Console</span> print: <span style="color: #007f00; font-style: italic;">&quot;.&quot;</span>
      <span style="">&#125;</span>
&nbsp;
      ensure<span style="">&#123;</span>
        t if <span style="">&#123;</span> t close <span style="">&#125;</span>
      <span style="">&#125;</span>
    <span style="">&#125;</span>
  <span style="">&#125;</span>
end
&nbsp;
<span style="color: #0000ff;">Console</span> puts
<span style="color: #0000ff;">Console</span> puts: <span style="color: #007f00; font-style: italic;">&quot;Open ports on #{host} are:&quot;</span>
<span style="color: #0000ff;">Console</span> puts: <span style="">&#40;</span><span style="color: #00007f;">open_ports</span> join: <span style="color: #007f00; font-style: italic;">&quot;, &quot;</span><span style="">&#41;</span></pre></td></tr></table></div>

<p>So yeah, this is actually working. Now I&#8217;ve basically have most of the language features done that I had in mind first. Next to come are probably some performance optimizations as well as some more unique features, I still have to come up with. We&#8217;ll see <img src='http://www.adztec-independent.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p><b>Update:</b><br />
I&#8217;ve added Threading to the code, this speeds up the process a little <img src='http://www.adztec-independent.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.adztec-independent.de/2009/06/blocktalk-a-simple-portscanner/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Blockd: Mixing Ruby &amp; Smalltalk</title>
		<link>http://www.adztec-independent.de/2009/05/blockd-mixing-ruby-smalltalk/</link>
		<comments>http://www.adztec-independent.de/2009/05/blockd-mixing-ruby-smalltalk/#comments</comments>
		<pubDate>Fri, 29 May 2009 17:42:18 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[blocktalk]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[hobbies]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.adztec-independent.de/?p=216</guid>
		<description><![CDATA[My new simple language, blockd, that I&#8217;ve mentioned in my last blog post is progressing quite nicely.
Since my last post a few days ago, I&#8217;ve worked on it quite a bit and I&#8217;ve got a first simple interpreter for it working.
For now, the interpreter is able to understand &#038; execute methodcalls on objects, anonymous methods [...]]]></description>
			<content:encoded><![CDATA[<p>My new simple language, <b>blockd</b>, that I&#8217;ve mentioned in my last blog post is progressing quite nicely.<br />
Since my last post a few days ago, I&#8217;ve worked on it quite a bit and I&#8217;ve got a first simple interpreter for it working.</p>
<p>For now, the interpreter is able to understand &#038; execute methodcalls on objects, anonymous methods (blocks &#038; procs in ruby) and some other minor stuff.</p>
<p>Heres a small example, that actually works now:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.adztec-independent.de/wp-content/plugins/wp-codebox/wp-codebox.php?p=216&amp;download=first_test.blk">first_test.blk</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p21611"><td class="code" id="p216code11"><pre class="smalltalk" style="font-family:monospace;">y <span style="color: #000066; font-weight:bold;">=</span> <span style="">&#123;</span> |<span style="color: #00007f;">x</span>|
  <span style="color: #0000ff;">Console</span> puts: <span style="color: #00007f;">x</span>
  <span style="color: #0000ff;">Console</span> puts: <span style="">&#40;</span><span style="color: #00007f;">x</span> * <span style="color: #00007f;">x</span><span style="">&#41;</span>
<span style="">&#125;</span>
y call: <span style="color: #00007f;">10</span>
&nbsp;
m <span style="color: #000066; font-weight:bold;">=</span> <span style="">&#123;</span> |<span style="color: #00007f;">x y</span>|
  <span style="color: #0000ff;">Console</span> puts: <span style="">&#40;</span><span style="">&#40;</span><span style="color: #00007f;">x</span> upcase<span style="">&#41;</span> * <span style="color: #00007f;">y</span><span style="">&#41;</span>
<span style="">&#125;</span>
m call: <span style="color: #007f00; font-style: italic;">&quot;cool &quot;</span> y: <span style="color: #00007f;">10</span>
&nbsp;
square <span style="color: #000066; font-weight:bold;">=</span> <span style="">&#123;</span> |<span style="color: #00007f;">y</span>|
  y * <span style="color: #00007f;">y</span>
<span style="">&#125;</span>
cubic <span style="color: #000066; font-weight:bold;">=</span> <span style="">&#123;</span>|<span style="color: #00007f;">x</span>| <span style="">&#40;</span><span style="color: #00007f;">x</span> * <span style="color: #00007f;">x</span><span style="">&#41;</span> * <span style="color: #00007f;">x</span><span style="">&#125;</span>
&nbsp;
<span style="color: #7f0000;">3</span> times do |<span style="color: #00007f;">i</span>|
  <span style="color: #0000ff;">Console</span> puts: <span style="color: #00007f;">i</span>
end
&nbsp;
foo <span style="color: #000066; font-weight:bold;">=</span> <span style="">&#123;</span>
  <span style="color: #7f0000;">3</span> times <span style="">&#123;</span> |<span style="color: #00007f;">i</span>| <span style="color: #0000ff;">Console</span> puts: <span style="">&#40;</span><span style="color: #00007f;">square</span> call: <span style="color: #00007f;">i</span><span style="">&#41;</span> <span style="">&#125;</span>
<span style="">&#125;</span>
&nbsp;
<span style="color: #0000ff;">Console</span> puts: <span style="color: #007f00; font-style: italic;">&quot;--&quot;</span>
&nbsp;
foo call
&nbsp;
<span style="color: #7f0000;">10</span> times &amp;foo</pre></td></tr></table></div>

<p>This basically is equivalent to the following ruby code:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.adztec-independent.de/wp-content/plugins/wp-codebox/wp-codebox.php?p=216&amp;download=first_test.rb">first_test.rb</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p21612"><td class="code" id="p216code12"><pre class="ruby" style="font-family:monospace;">y = <span style="color:#CC0066; font-weight:bold;">Proc</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>x<span style="color:#006600; font-weight:bold;">|</span> Console.<span style="color:#CC0066; font-weight:bold;">puts</span><span style="color:#006600; font-weight:bold;">&#40;</span>x<span style="color:#006600; font-weight:bold;">&#41;</span>;Console.<span style="color:#CC0066; font-weight:bold;">puts</span><span style="color:#006600; font-weight:bold;">&#40;</span>x.<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#40;</span>x<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
y.<span style="color:#9900CC;">call</span><span style="color:#006600; font-weight:bold;">&#40;</span>10<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
m = <span style="color:#CC0066; font-weight:bold;">Proc</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>x,y<span style="color:#006600; font-weight:bold;">|</span> Console.<span style="color:#CC0066; font-weight:bold;">puts</span><span style="color:#006600; font-weight:bold;">&#40;</span>x.<span style="color:#9900CC;">upcase</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#40;</span>y<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
m.<span style="color:#9900CC;">call</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;cool &quot;</span>, 10<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
square = <span style="color:#CC0066; font-weight:bold;">Proc</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>y<span style="color:#006600; font-weight:bold;">|</span> y.<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#40;</span>y<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
cubic = <span style="color:#CC0066; font-weight:bold;">Proc</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>x<span style="color:#006600; font-weight:bold;">|</span> x.<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#40;</span>x<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#40;</span>x<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
3.<span style="color:#9900CC;">times</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&amp;</span>Proc.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>i<span style="color:#006600; font-weight:bold;">|</span> Console.<span style="color:#CC0066; font-weight:bold;">puts</span><span style="color:#006600; font-weight:bold;">&#40;</span>i<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
foo = <span style="color:#CC0066; font-weight:bold;">Proc</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#123;</span>3.<span style="color:#9900CC;">times</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&amp;</span>Proc.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>i<span style="color:#006600; font-weight:bold;">|</span> Console.<span style="color:#CC0066; font-weight:bold;">puts</span><span style="color:#006600; font-weight:bold;">&#40;</span>square.<span style="color:#9900CC;">call</span><span style="color:#006600; font-weight:bold;">&#40;</span>i<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
Console.<span style="color:#CC0066; font-weight:bold;">puts</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;--&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
foo.<span style="color:#9900CC;">call</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
10.<span style="color:#9900CC;">times</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&amp;</span>foo<span style="color:#006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>

<p>Now, to make this clear: The ruby code above is what the current interpreter actually executes. The way I&#8217;ve implemented it for now (and for simplicity only &#8211; just to get something working first) is, that it simply parses the blockd code and <i>translates</i> it into equivalent ruby code, which then gets executed via <i>eval</i> in ruby.<br />
Now I know, this isn&#8217;t the best way to do it, for several reasons:<br />
Normally, an interpreter executes the code it gets fed directly, expression for expression, as this is also the case for ruby. If you have an syntax error within the code that is evaluated, the interpreter usually notices this only at the moment it reaches that part of the code and tries to evaluate it. This isn&#8217;t the case for the current interpreter I wrote here. The reason I chose to do it this way, was that I wanted to get something working as possible. I do want to change it though later on, so that each expression gets executed on the fly, once it is parsed.</p>
<p>So for now, i evaluate the parsetree, and each expression node gets turned into a string of equivalent ruby code, that then gets saved in a global list (within a class called <i>Evaluator</i>). When the parser has done it&#8217;s job and all the values (strings of ruby code) of all expression nodes have been accumulated, i simply run ruby&#8217;s <i>eval</i> on it and at that point do the actual evaluation (and possibly get semantic errors here &#8211; like missing variables etc.).</p>
<p>I still need to implement some stuff regarding classes  &#038; modules, but I&#8217;m quite happy for now, since it wasn&#8217;t so hard as I had expected before. Once I have everything working, I&#8217;ll start to actually rewrite the parser in a way, that it evaluates &#038; executes code on the fly, expression per expression and not all of them at once at the end. This should also improve performance, which is obviously another downside of my current approach, since I have to wait for all expressions being parsed &#038; evaluated to appropriate ruby code first, before even beginning the actual evaluation process&#8230; </p>
<p>For anyone, who is interested, here is a simple benchmark of the code above:</p>
<p>The <b>blockd version</b> (executed with my current interpreter):</p>
<blockquote><p>
real	0m0.264s<br />
user	0m0.184s<br />
sys	0m0.072s
</p></blockquote>
<p>The <b>ruby version</b> of the equivalent code (generated by my parser):</p>
<blockquote><p>
real	0m0.021s<br />
user	0m0.008s<br />
sys	0m0.008s
</p></blockquote>
<p>As you can see, there&#8217;s quite a performance overhead. Although not really noticeable by a viewer, the numbers tell the story. So I expect quite an improvement in performance, once I&#8217;ll start rewriting the interpreter in the way I&#8217;ve mentioned above. Still cool though, if you ask me <img src='http://www.adztec-independent.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.adztec-independent.de/2009/05/blockd-mixing-ruby-smalltalk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a simple game in Ruby &#8211; Episode 5</title>
		<link>http://www.adztec-independent.de/2009/05/creating-a-simple-game-in-ruby-episode-5/</link>
		<comments>http://www.adztec-independent.de/2009/05/creating-a-simple-game-in-ruby-episode-5/#comments</comments>
		<pubDate>Tue, 19 May 2009 02:29:10 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Ruby Screencast]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[hobbies]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[screencast]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.adztec-independent.de/?p=195</guid>
		<description><![CDATA[This is the 5th episode on creating a simple game in Ruby. In this episode, we&#8217;ll add some automated testing via the BDD framework RSpec. We&#8217;ll also start to implement the Character class.

]]></description>
			<content:encoded><![CDATA[<p>This is the 5th episode on creating a simple game in Ruby. In this episode, we&#8217;ll add some automated testing via the BDD framework RSpec. We&#8217;ll also start to implement the Character class.</p>
<p><embed src="http://blip.tv/play/gq94gYLNTgA" type="application/x-shockwave-flash" width="525" height="303" allowscriptaccess="always" allowfullscreen="true"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adztec-independent.de/2009/05/creating-a-simple-game-in-ruby-episode-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a simple game in Ruby &#8211; Episode 4</title>
		<link>http://www.adztec-independent.de/2009/05/creating-a-simple-game-in-ruby-episode-4/</link>
		<comments>http://www.adztec-independent.de/2009/05/creating-a-simple-game-in-ruby-episode-4/#comments</comments>
		<pubDate>Thu, 14 May 2009 17:06:09 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Ruby Screencast]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[hobbies]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[screencast]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.adztec-independent.de/?p=192</guid>
		<description><![CDATA[In this episode we&#8217;ll do some little refactoring.

]]></description>
			<content:encoded><![CDATA[<p>In this episode we&#8217;ll do some little refactoring.</p>
<p><embed src="http://blip.tv/play/gq94gYHFRQA" type="application/x-shockwave-flash" width="525" height="303" allowscriptaccess="always" allowfullscreen="true"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adztec-independent.de/2009/05/creating-a-simple-game-in-ruby-episode-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

