<?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>Brit Gardner ::: Web Developer ::: Dallas, TX &#187; erlang</title>
	<atom:link href="http://britg.com/tags/erlang/feed/" rel="self" type="application/rss+xml" />
	<link>http://britg.com</link>
	<description>The big yellow one&#039;s the sun.</description>
	<lastBuildDate>Sun, 10 Jan 2010 17:25:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Erlang Supervisor Behavior Gotcha &#8211; Worker Init Params</title>
		<link>http://britg.com/2009/05/23/erlang-supervisor-behavior-gotcha-worker-init-params/</link>
		<comments>http://britg.com/2009/05/23/erlang-supervisor-behavior-gotcha-worker-init-params/#comments</comments>
		<pubDate>Sat, 23 May 2009 14:26:10 +0000</pubDate>
		<dc:creator>britg</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[supervisor]]></category>

		<guid isPermaLink="false">http://britg.com/?p=874</guid>
		<description><![CDATA[When starting up a behavior like supervisor, the start_link func looks something like:

start_link() -&#62;
  supervisor:start_link({local, ?MODULE}, ?MODULE, []).

Which in turn calls the initialization callback:

init(_Args) -&#62;
  %% do some stuff.

Notice that the initialization callback takes 1 argument event though the params list (the third parameter) is empty in your start_link func.
So, naturally (am I [...]]]></description>
			<content:encoded><![CDATA[<p>When starting up a behavior like <em>supervisor</em>, the start_link func looks something like:</p>
<pre class="brush: plain;">
start_link() -&gt;
  supervisor:start_link({local, ?MODULE}, ?MODULE, []).
</pre>
<p>Which in turn calls the initialization callback:</p>
<pre class="brush: plain;">
init(_Args) -&gt;
  %% do some stuff.
</pre>
<p>Notice that the initialization callback takes 1 argument event though the params list (the third parameter) is empty in your start_link func.</p>
<p>So, naturally (am I alone in this?) I assumed that when defining a Child Spec for a Supervisor, the {M, F, A} definition would follow the same pattern:</p>
<pre class="brush: plain;">
Childspec = {child1,
            {child1, start, []},
            permanent, brutal_kill, worker, dynamic},
%% ...
</pre>
<p>But the above definition does not call <em>child1:start/1</em>, where the one parameter is the emtpy list.  Instead, the list items are extracted as individual parameters.  So <code>{child1, start, [p1, p2, p3]}</code> would call <em>child1:start/3</em>, and <code>{child1, start, []}</code> calls <em>child1:start/0</em>.  Just something to look out for if you&#8217;re new to erlang and the supervisor behavior like me.</p>
]]></content:encoded>
			<wfw:commentRss>http://britg.com/2009/05/23/erlang-supervisor-behavior-gotcha-worker-init-params/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenPoker Source As a Learning Tool</title>
		<link>http://britg.com/2008/06/20/openpoker-source-as-a-learning-tool/</link>
		<comments>http://britg.com/2008/06/20/openpoker-source-as-a-learning-tool/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 13:20:45 +0000</pubDate>
		<dc:creator>britg</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[multiplayer server]]></category>
		<category><![CDATA[openpoker]]></category>

		<guid isPermaLink="false">http://britg.com/?p=203</guid>
		<description><![CDATA[In a previous post I mentioned an article about using erlang to write multiplayer servers.  The author of the article referes to an open source project he created called OpenPoker which he released under dual licenses &#8211; GPL, Commercial.  Unfortunately, he later decided to stop supporting the GPL version of the project and removed all [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://britg.com/2008/05/30/thoughts-on-massively-multiplayer-flash-gaming-infrastructure/">previous post</a> I mentioned an article about using erlang to write multiplayer servers.  The author of the article referes to an open source project he created called OpenPoker which he released under dual licenses &#8211; GPL, Commercial.  Unfortunately, he later decided to stop supporting the GPL version of the project and removed all references to his source, but a simple google search for <em>openpoker</em> turns up the <a href="http://www.xach.com/misc/openpoker/">source code</a> in the first few results as of this writing.</p>
<p>Besides being a good lesson in how nothing really every dissappears from the internet, I mention it because studying the source has given me a lot of insight on how to approach a multplayer server in erlang.  I highly recommend checking it out, even if you don&#8217;t use a single line of code from it.  At the very least it&#8217;s a great working example of how to implement <code>gen_server</code>.</p>
<p>Also here&#8217;s a <a href="http://geeklair.net/~pratzsch/blog/2008/04/gen-server-behaviour-in-erlang.html">good primer</a> on <code>gen_server</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://britg.com/2008/06/20/openpoker-source-as-a-learning-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Erlang, CouchDB, Yaws and MochiWeb Amazon Machine Instance</title>
		<link>http://britg.com/2008/06/14/erlang-couchdb-yaws-and-mochiweb-amazon-machine-instance/</link>
		<comments>http://britg.com/2008/06/14/erlang-couchdb-yaws-and-mochiweb-amazon-machine-instance/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 19:50:04 +0000</pubDate>
		<dc:creator>britg</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[couchdb]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[mochiweb]]></category>
		<category><![CDATA[yaws]]></category>

		<guid isPermaLink="false">http://britg.com/?p=196</guid>
		<description><![CDATA[I call this my erlang playground instance.  Here&#8217;s what&#8217;s installed:

Ubuntu Server Hardy 8.0.4
Apache 2 listening to port 80
Erlang R12B-3
CouchDB 0.8 listening to port 5984
Yaws v1.76 listening to port 8080
MochiWeb Library

The instance ID is ami-12ae4a7b and I&#8217;ve made it public so feel free to use it to your hearts content!
I plan to add to this instance [...]]]></description>
			<content:encoded><![CDATA[<p>I call this my erlang playground instance.  Here&#8217;s what&#8217;s installed:</p>
<ol>
<li>Ubuntu Server Hardy 8.0.4</li>
<li>Apache 2 listening to port 80</li>
<li>Erlang R12B-3</li>
<li>CouchDB 0.8 listening to port 5984</li>
<li>Yaws v1.76 listening to port 8080</li>
<li>MochiWeb Library</li>
</ol>
<p>The instance ID is <code>ami-12ae4a7b</code> and I&#8217;ve made it public so feel free to use it to your hearts content!</p>
<p>I plan to add to this instance whenever I find time.  I definitely want to get SSL socket communication going using <a href="http://www.trapexit.org/Distributed_erlang_using_ssl_through_firewalls">this tutorial</a>.  I&#8217;m also interested in Kevin&#8217;s <a href="http://weblog.hypotheticalabs.com/?p=198">virtuerl project</a> over a hypotheticalabs for quick and easy VM management because the whole reason I&#8217;m going through the trouble of doing this on EC2 is I think development on any erlang system should start and end with multiple physical machines.</p>
]]></content:encoded>
			<wfw:commentRss>http://britg.com/2008/06/14/erlang-couchdb-yaws-and-mochiweb-amazon-machine-instance/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Immensely Interesting Look Into SmugMug&#8217;s Cloud-based Setup</title>
		<link>http://britg.com/2008/06/03/immensely-interesting-look-into-smugmugs-cloud-based-setup/</link>
		<comments>http://britg.com/2008/06/03/immensely-interesting-look-into-smugmugs-cloud-based-setup/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 22:14:53 +0000</pubDate>
		<dc:creator>britg</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[smug mug]]></category>

		<guid isPermaLink="false">http://britg.com/?p=154</guid>
		<description><![CDATA[Don MacAskill gives a really interesting bird&#8217;s eye view into how their service at Smug Mug is set up.  If you&#8217;re not familiar with SmugMug, it&#8217;s a for-pay image hosting site that&#8217;s profitable in a Flickr world so they must be doing something right, right?
I find his post especially interesting because I think the multiplayer [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.smugmug.com/don">Don MacAskill</a> gives a really interesting <a href="http://blogs.smugmug.com/don/2008/06/03/skynet-lives-aka-ec2-smugmug/">bird&#8217;s eye view</a> into how their service at Smug Mug is set up.  If you&#8217;re not familiar with SmugMug, it&#8217;s a for-pay image hosting site that&#8217;s profitable in a Flickr world so they must be doing something right, right?</p>
<p>I find his post especially interesting because I think the multiplayer gaming infrastructure of the future is going to be on these Cloud-type services.  Not just static data like Valve&#8217;s new Steam Cloud, but dynamic real-time multiplayer services that you can &#8220;just throw another box to&#8221; to handle load peaks, etc.</p>
<p>Their approach to &#8220;worker&#8221; instances I like a lot &#8211; they are completely stupid when they are born, but once started they execute a small script that fetches their intelligence.  Brilliant!  Updating your core software is dead simple &#8211; update it once on your mother ship, and all your worker instances will be up to date automatically when they are born.</p>
<p>This is in contrast to packaging your machine instance with all the necessary software to start work immediately, which limits you to the role that you&#8217;ve packaged it for.  Also, you don&#8217;t have to create and test new AMIs every time you want to update&#8230; have you ever made one of these things? &#8211; it&#8217;s <em>hard!</em> On a scale of one to ten I would rather take a fork in the eye than create, upload them and test a new instance.</p>
<p>The workers in the system Don outlines are isolated and receive their intelligence and work from a central server, but what if you were to take the <a href="http://britg.com/2008/05/30/thoughts-on-massively-multiplayer-flash-gaming-infrastructure/">advantages</a> of an Erlang based system &#8211; immediate awareness, concurrancy &#8211; and throw it into the equation?  Veeeery Interesting&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://britg.com/2008/06/03/immensely-interesting-look-into-smugmugs-cloud-based-setup/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Thoughts on Massively Multiplayer Flash Gaming Infrastructure</title>
		<link>http://britg.com/2008/05/30/thoughts-on-massively-multiplayer-flash-gaming-infrastructure/</link>
		<comments>http://britg.com/2008/05/30/thoughts-on-massively-multiplayer-flash-gaming-infrastructure/#comments</comments>
		<pubDate>Fri, 30 May 2008 15:51:16 +0000</pubDate>
		<dc:creator>britg</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[multiplayer]]></category>

		<guid isPermaLink="false">http://britg.com/?p=140</guid>
		<description><![CDATA[I&#8217;ve been thinking a lot about the different options we could use for the Space Survivor infrastructure.  The game itself is flash based and the site uses html/css (doesn&#8217;t make sense to make the entire site flash for performance reasons) and the site-specific framework and semi state-less page views will most likely be on CakePHP.  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been thinking a lot about the different options we could use for the <a href="http://britg.com/space-survivor">Space Survivor</a> infrastructure.  The game itself is flash based and the site uses html/css (doesn&#8217;t make sense to make the entire site flash for performance reasons) and the site-specific framework and semi state-less page views will most likely be on CakePHP.  So, if you just want to check your stats, view ships, read missions, or anything that fits into the normal webpage paradigm it&#8217;ll most likely be served from a PHP server.</p>
<p>When we start talking about the technology required to provide a backend for the actual game, that&#8217;s when the choices get interesting.  Most multiplayer games on the PC or console probably use some sort of custom framework for handling network traffic, probably written in C, C++, Java or some other low-level language.  But, I kinda want to mix things up and jump on what I think will be the next generation infrastructure for networking/multiplayer in games &#8211; <a href="http://erlang.org">Erlang</a>.</p>
<p>There was an article on <a href="http://reddit.com/">Reddit</a> quite a while ago &#8211; <a href="http://www.devmaster.net/articles/mmo-scalable-server/">Writing Low-Pain Massively Scalable Multiplayer Servers</a> &#8211; that really says it all a lot better than I am qualified to.  I highly suggest reading it, but I&#8217;ll talk about concurrency here.</p>
<p>Erlang is a great choice for multiplayer infrastructure because it was built from the ground up to be a high-concurrency system.  It&#8217;s trivially easy to add nodes to an Erlang cluster because there is built-in node detection; so once you create your new instance of the Erlang emulator and connect it to any other node in your system, all other nodes become aware of it.  The bottom line is, you don&#8217;t have to spend any resources creating this network effect  &#8211; it&#8217;s a fundamental part of the language!</p>
<p>In the article I linked to above, Joel recommends creating a node for each processor on a machine.  It&#8217;s not uncommon for servers now to have 8 processors, definitely at least 4.  So if erlang is your platform of choice, you can immediately create 4 or 8 instances, each doing separate tasks and maximizing your CPU usage out of the box!  Amazing.</p>
<p>I&#8217;ll continue this discussion in later posts as I gain more understanding of how things fit together in an erlang-based multiplayer infrastructure.</p>
]]></content:encoded>
			<wfw:commentRss>http://britg.com/2008/05/30/thoughts-on-massively-multiplayer-flash-gaming-infrastructure/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Twoorl &#8211; Twitter in Erlang</title>
		<link>http://britg.com/2008/05/29/twoorl-twitter-in-erlang/</link>
		<comments>http://britg.com/2008/05/29/twoorl-twitter-in-erlang/#comments</comments>
		<pubDate>Thu, 29 May 2008 13:47:15 +0000</pubDate>
		<dc:creator>britg</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[erlang]]></category>

		<guid isPermaLink="false">http://britg.com/?p=138</guid>
		<description><![CDATA[Yariv, one of the biggest evangelists and contributors to the erlang community, hacked out a twitter clone in erlang over the course of 2 or 3 days.  Although he tries to back out of an &#8216;Erlang will kick Rails ass at scaling&#8217; argument, I would like to see his app at a scale equal to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://yarivsblog.com/">Yariv</a>, one of the biggest evangelists and contributors to the erlang community, hacked out a <a href="http://yarivsblog.com/articles/2008/05/28/announcing-twoorl-an-open-source-erlyweb-based-twitter-clone/">twitter clone</a> in erlang over the course of 2 or 3 days.  Although he tries to back out of an &#8216;Erlang will kick Rails ass at scaling&#8217; argument, I would like to see his app at a scale equal to twitter and see which one wins.  My money is on Erlang.</p>
<p>Some of the reasons he wrote Twoorl:</p>
<blockquote><p>The reasons I wrote Twoorl are:</p>
<p>- ErlyWeb needs more open source apps showing how to use the framework. It’s hard to pick how to use the framework just from the API docs.<br />
- Twitter is awesome. Once you start using it, it becomes addictive. I thought it would be fun to write my own.<br />
- Twitter is very popular, but I don’t know of any open source clones. I figured somebody may actually want one!<br />
- Some people think Erlang isn’t a good language for building webapps. I like to prove them wrong <img src='http://britg.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://britg.com/2008/05/29/twoorl-twitter-in-erlang/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux, Yaws, CouchDB, Erlang &#8211; LYCE</title>
		<link>http://britg.com/2008/05/23/linux-yaws-couchdb-erlang-lyce/</link>
		<comments>http://britg.com/2008/05/23/linux-yaws-couchdb-erlang-lyce/#comments</comments>
		<pubDate>Fri, 23 May 2008 17:20:24 +0000</pubDate>
		<dc:creator>britg</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[couchdb]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[yaws]]></category>

		<guid isPermaLink="false">http://britg.com/?p=73</guid>
		<description><![CDATA[Just had a funny thought since CouchDB and Erlang have been on my mind so much lately.  Everyone&#8217;s familiar with the LAMP and WISC stacks, right? (Linux, Apache, MySQL, PHP and Windows, IIS, SQLServer, C# from those of you who aren&#8217;t)
Could the next big stack to hit mainstream be LYCE &#8211; Linux, Yaws, CouchDB, [...]]]></description>
			<content:encoded><![CDATA[<p>Just had a funny thought since CouchDB and Erlang have been on my mind so much lately.  Everyone&#8217;s familiar with the LAMP and WISC stacks, right? (Linux, Apache, MySQL, PHP and Windows, IIS, SQLServer, C# from those of you who aren&#8217;t)</p>
<p>Could the next big stack to hit mainstream be LYCE &#8211; Linux, <a href="http://yaws.hyber.org/">Yaws</a>, <a href="http://couchdb.com">CouchDB</a>, and <a href="http://erlang.org">Erlang</a>?</p>
<p>Given that scalability is such a huge issue right now, and Elastic/Cloud computing is almost certainly the next big infrastructure movement, I certainly think at least Erlang and CouchDB will go mainstream.</p>
<p>Another variant could be LYSE &#8211; Linux, Yaws, <a href="http://www.amazon.com/gp/browse.html?node=342335011">SimpleDB</a>, and Erlang.</p>
]]></content:encoded>
			<wfw:commentRss>http://britg.com/2008/05/23/linux-yaws-couchdb-erlang-lyce/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Erlang on a Media Temple Dedicated Virtual (dv) Server</title>
		<link>http://britg.com/2008/05/23/installing-erlang-on-a-media-temple-dedicated-virtual-dv-server/</link>
		<comments>http://britg.com/2008/05/23/installing-erlang-on-a-media-temple-dedicated-virtual-dv-server/#comments</comments>
		<pubDate>Fri, 23 May 2008 13:47:55 +0000</pubDate>
		<dc:creator>britg</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[cean]]></category>
		<category><![CDATA[dv]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[media temple]]></category>

		<guid isPermaLink="false">http://britg.com/?p=59</guid>
		<description><![CDATA[I&#8217;ve been playing around recently with erlang and couchdb on my local machine (Macbook Pro), but I decided yesterday to try to get the environment up and running on my Media Temple Dedicated Virtual (dv) server (which is a fantastic hosting service by the way).
Little did I know this would be a 5 hour long [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://britg.com/wp-content/uploads/2008/05/erlang.gif"><img class="alignleft size-full wp-image-60" title="erlang" src="http://britg.com/wp-content/uploads/2008/05/erlang.gif" alt="" width="114" height="96" /></a>I&#8217;ve been playing around recently with <a href="http://erlang.org">erlang </a>and <a href="http://incubator.apache.org/couchdb/">couchdb </a>on my local machine (Macbook Pro), but I decided yesterday to try to get the environment up and running on my <a href="http://mediatemple.net/webhosting/dv/">Media Temple Dedicated Virtual (dv) server</a> (which is a fantastic hosting service by the way).</p>
<p>Little did I know this would be a 5 hour long journey through rpm hell, failed dependencies, yum repository management, and who knows what else.  Heck, I didn&#8217;t even succeed completely, but I did manage to get Erlang up and running. Whew.  CouchDB, I&#8217;ll come back to you later.</p>
<p>Anyways, to save anyone who is trying to do this a whole lot of time &#8211; don&#8217;t worry about rpms, yum repos, any of that crap.  Go <a href="http://cean.process-one.net/about/">here</a>. No wait, better yet go <a href="http://cean.process-one.net/download/">here</a>.  The CEAN project packages and distributes binaries for OTP/Erlang as well as binaries for a whole slew of applications.  It&#8217;s a nice framework and easily updated.  Simply SSH into your media temple dv and grab the binary with:</p>
<blockquote><p><em>wget http://cean.process-one.net/pub/R11B/prod/linux-x86/cean_installer.bin</em></p></blockquote>
<p>Make sure and give the installer executable status:</p>
<blockquote><p><em>chmod +x cean_installer.bin</em></p></blockquote>
<p>Then execute it:</p>
<blockquote><p><em>./cean_installer.bin</em></p></blockquote>
<p>Voila &#8211; you now have Erlang installed and running on your Media Temple Dedicated Virtual.  At the time of this writing the latest Erlang release is R12B-2, but CEAN distributes R11B.</p>
]]></content:encoded>
			<wfw:commentRss>http://britg.com/2008/05/23/installing-erlang-on-a-media-temple-dedicated-virtual-dv-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
