<?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/"
	>

<channel>
	<title>mike.magin.org</title>
	<atom:link href="http://mike.magin.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://mike.magin.org</link>
	<description></description>
	<pubDate>Sun, 21 Feb 2010 04:23:42 +0000</pubDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Recent media intake</title>
		<link>http://mike.magin.org/2010/02/20/recent-media-intake/</link>
		<comments>http://mike.magin.org/2010/02/20/recent-media-intake/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 04:23:42 +0000</pubDate>
		<dc:creator>Michael Magin</dc:creator>
		
		<category><![CDATA[Books]]></category>

		<guid isPermaLink="false">http://mike.magin.org/?p=213</guid>
		<description><![CDATA[I&#8217;m watching Flight of the Navigator for the first time since I saw it in the theater when I was 8 years old.  While I wouldn&#8217;t say it&#8217;s going to rank as one of my adult favorites, it&#8217;s remarkably good for a PG-rated kid-oriented sci-fi film that I really liked when I was eight. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m watching <em>Flight of the Navigator</em> for the first time since I saw it in the theater when I was 8 years old.  While I wouldn&#8217;t say it&#8217;s going to rank as one of my adult favorites, it&#8217;s remarkably good for a PG-rated kid-oriented sci-fi film that I really liked when I was eight.  The red panasonic cassette recorder I had as a kid briefly appeared in it too!  I&#8217;m somewhat appalled at the idea of <a href="http://en.wikipedia.org/wiki/Flight_of_the_Navigator#Remake">a remake</a>, however.</p>
<p>I recently finished reading <em>The Elements of Murder: A History of Poison</em> by John Emsley.  It&#8217;s a fun book, if you like reading about such things as the historical use of toxic metals (and metalloids), both as medicines and as poisons.   It&#8217;s really interesting how many had useful medical purposes, albeit with side effects that were often as bad as their benefits.  (Typically, a lot of toxic heavy metal compounds are even more toxic against microorganisms than against humans, but not much.)</p>
<p>I&#8217;m currently reading <em>You Are Not a Gadget</em> by the decidedly-curmudgeonly Jaron Lanier.  I&#8217;ll have more to say about it later, but I think he really has some important things to say about the prospects for culture in the modern world.</p>
<p>Also, I bought a single-tuner HD Homerun and a UHF TV antenna (there was an existing and unused satellite mount and a piece of coax routed in through the wall, so it was quite easy), and I set up the MythTV backend on my home fileserver.  I&#8217;ve got it recording what little broadcast tv is worth watching.</p>
]]></content:encoded>
			<wfw:commentRss>http://mike.magin.org/2010/02/20/recent-media-intake/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Short 2009 retrospective</title>
		<link>http://mike.magin.org/2010/01/31/short-2009-retrospective/</link>
		<comments>http://mike.magin.org/2010/01/31/short-2009-retrospective/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 23:07:00 +0000</pubDate>
		<dc:creator>Michael Magin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mike.magin.org/?p=207</guid>
		<description><![CDATA[2009 was good to me.  I enjoyed the first year of my job at Airwave.  In some ways, it was a big adjustment for me, but I found it very satisfying &#8212; the organization works well, it&#8217;s given me a chance to improve my abilities as an engineer, and I&#8217;ve learned a lot. [...]]]></description>
			<content:encoded><![CDATA[<p>2009 was good to me.  I enjoyed the first year of my job at Airwave.  In some ways, it was a big adjustment for me, but I found it very satisfying &#8212; the organization works well, it&#8217;s given me a chance to improve my abilities as an engineer, and I&#8217;ve learned a lot.  I&#8217;ve even come to love Perl far more than I ever thought I would.</p>
<p>I got engaged to Tien, though that was really only a question of when.</p>
<p>The time, or at least attention I had to devote to other activities was somewhat limited.  I did a fair amount of gardening.  I set up a 25 gallon aquarium with lots of plants, and now that the pH has stabilized, it&#8217;s doing very well.</p>
]]></content:encoded>
			<wfw:commentRss>http://mike.magin.org/2010/01/31/short-2009-retrospective/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Things I&#8217;ve learned about gardening</title>
		<link>http://mike.magin.org/2009/08/19/things-ive-learned-about-gardening/</link>
		<comments>http://mike.magin.org/2009/08/19/things-ive-learned-about-gardening/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 04:45:37 +0000</pubDate>
		<dc:creator>Michael Magin</dc:creator>
		
		<category><![CDATA[Gardening]]></category>

		<guid isPermaLink="false">http://mike.magin.org/?p=196</guid>
		<description><![CDATA[Clay isn&#8217;t bad, but you&#8217;re going to want to dig in a lot of decayed organic matter.  Some mixture of the cheap commercial compost (composted redwood sawdust, around here) and aged chicken manure is pretty good for a start, though I expect I&#8217;m going to be buying less stuff now that the worm composting [...]]]></description>
			<content:encoded><![CDATA[<p>Clay isn&#8217;t bad, but you&#8217;re going to want to dig in a lot of decayed organic matter.  Some mixture of the cheap commercial compost (composted redwood sawdust, around here) and aged chicken manure is pretty good for a start, though I expect I&#8217;m going to be buying less stuff now that the worm composting is going well (and taking all our vegetable/fruit scraps and paper shredder output.)  If I had a lot to get started at once (maybe when we own a house and I can live my dream of having about 500 square feet of garden), I&#8217;d rent a truck and pick up a load of the composted yard waste freely available, even though I suspect it&#8217;s less nutritious and full of weed seeds.</p>
<p>I&#8217;m less impressed by mulching techniques and materials than most people seem to be.  More on that in the future.  Though, aside from being lazy, one possible reason not to mulch beds is that it may discourage ground-nesting bees.  (See <a href="http://www.cnr.berkeley.edu/urbanbeegardens/general_mulchmadness.html">Mulch Madness, One More Deterrent To Beeing Successful</a>).</p>
<p>In a dry climate, drip irrigation is the best thing ever.  You can maintain good moisture levels without over and underwatering.  You can avoid all the troubles of hitting plants too hard with water or disease related to having the tops of plants too moist.  Just about the only thing it&#8217;s not good for is sprouting seeds, since you don&#8217;t get very even moisture levels at the very top of the soil.</p>
<p><em>Drip Irrigation for Every Landscape and All Climates</em> by Robert Kourik is a good book on the subject, though I pretty much figured it out on my own beforehand.  It&#8217;s ideal to avoid lots of connections and just use lengths of tubing that have integral emitters.  Also, use a good filter, regulator, and always use a backflow preventer.</p>
<p>Mizuna is just about the only salad green you&#8217;re going to grow in the hot dry summer here.  Arugula will do okay, but it gets too bitter and bolts easily.  Nasturtium is trivial to grow even in partial shade (though you get less flowers that way.)</p>
<p>Give zucchini and tomatoes ample water and lots of manure.  As with any fruiting crop, don&#8217;t let the zucchini get too mature before picking, or it&#8217;ll start to slow down.  One zucchini plant is enough for two people unless you really love zucchini.  Zucchini (and many other fruiting annuals) need calcium.  If they don&#8217;t have enough, you get blossom-end rot.  With this somewhat alkaline soil, gypsum seems to work (and should help make the clay easier to work).  In more acidic soil, dolomitic lime is the standard thing, from what I hear.</p>
<p>Sunflowers are easy once they got big enough to resist slug and snail attack.  Growing pole beans up sunflowers works, but I&#8217;ll build a trellis next time to space the vines out better.  Also, if you&#8217;re unlucky, the weight of the beans breaks the sunflower in half.  (This is the &#8220;mammoth&#8221; sunflower I&#8217;m talking about &#8212; 7 feet tall even with shade for part of the day.)</p>
<p>As for slugs and snails, the baited iron phosphate granules (Sluggo is one brand) seems reasonably effective and is essentially harmless to people, pets, and plants in the quantity used.  Sprinkle on plenty at least monthly.  Most of the trouble I had was with small plants as they sprouted &#8212; once things like beans and sunflowers got bigger, they have reasonably snail-unfriendly surfaces.  And the zucchini is downright pest-unfriendly &#8212; the stems give me a temporary rash on my arms, though callouses on the my fingers make them okay to handle that way.</p>
<p>This was all the stuff in the ground, which I find vastly more enjoyable for growing annuals, compared to fiddly containers.  More on the container stuff next time&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://mike.magin.org/2009/08/19/things-ive-learned-about-gardening/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Lua and gardening</title>
		<link>http://mike.magin.org/2009/06/08/lua-and-gardening/</link>
		<comments>http://mike.magin.org/2009/06/08/lua-and-gardening/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 04:37:56 +0000</pubDate>
		<dc:creator>Michael Magin</dc:creator>
		
		<category><![CDATA[Gardening]]></category>

		<category><![CDATA[Lua]]></category>

		<guid isPermaLink="false">http://mike.magin.org/?p=182</guid>
		<description><![CDATA[I&#8217;ve been reading Programming in Lua lately, with my original intent to try using Lua to make Putty scriptable.  It&#8217;s a pretty neat language.  Quite high level for something that lightweight to embed in other programs.
Anyway, if I do this, it will be my first serious foray into Windows programming.
I&#8217;ve also done a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been reading <a href="http://www.lua.org/pil/">Programming in Lua</a> lately, with my original intent to try using Lua to make Putty scriptable.  It&#8217;s a pretty neat language.  Quite high level for something that lightweight to embed in other programs.</p>
<p>Anyway, if I do this, it will be my first serious foray into Windows programming.</p>
<p>I&#8217;ve also done a fair amount of gardening lately.  <a href="http://www.flickr.com/photos/recursive/sets/72157616319554049/">You can see more on Flickr.</a>  I&#8217;m really looking forward to getting that Canon 100mm macro lens so I can take more of the sort of photos of plants and bugs that I find interesting.</p>
<p>I plan to allocate a bit more of my time for writing, soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://mike.magin.org/2009/06/08/lua-and-gardening/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Been so busy.</title>
		<link>http://mike.magin.org/2009/03/14/been-so-busy/</link>
		<comments>http://mike.magin.org/2009/03/14/been-so-busy/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 03:49:48 +0000</pubDate>
		<dc:creator>Michael Magin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mike.magin.org/?p=177</guid>
		<description><![CDATA[In January, I took a new job, working at Airwave (A division of Aruba Networks) on the Airwave Management Platform (AMP).  We follow extreme programming methodology fairly closely (including pair programming), and I&#8217;m really enjoying it, though it makes for intense days.  (But better intense than excessively long days.)  It&#8217;s really good [...]]]></description>
			<content:encoded><![CDATA[<p>In January, I took a new job, working at <a href="http://www.airwave.com/">Airwave</a> (A division of Aruba Networks) on the Airwave Management Platform (AMP).  We follow extreme programming methodology fairly closely (including pair programming), and I&#8217;m really enjoying it, though it makes for intense days.  (But better intense than excessively long days.)  It&#8217;s really good for learning stuff quickly and not getting stuck.</p>
<p>The new commute sucked.  An hour each way by car, hour and a half by train (total, door-to-door).</p>
<p>So, after looking for a couple weeks, and hurriedly packing for a couple more, we moved at the end of February to a house in Sunnyvale.  More space, and I&#8217;m only 2 miles from work.  I can even walk to work in about 40 to 45 minutes, slowed down somewhat by the necessity of crossing the street excessively.  We&#8217;re still unpacking.</p>
]]></content:encoded>
			<wfw:commentRss>http://mike.magin.org/2009/03/14/been-so-busy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using ALSA for sound with VMware Workstation 6.5 on an Ubuntu 8.04 host</title>
		<link>http://mike.magin.org/2009/01/08/using-alsa-for-sound-with-vmware-workstation-65-on-an-ubuntu-804-host/</link>
		<comments>http://mike.magin.org/2009/01/08/using-alsa-for-sound-with-vmware-workstation-65-on-an-ubuntu-804-host/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 04:05:48 +0000</pubDate>
		<dc:creator>Michael Magin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://mike.magin.org/?p=172</guid>
		<description><![CDATA[I built a new desktop PC for use at home, and I installed Ubuntu 8.04 on it.  In anticipation of replacing the windows XP desktop with it, I&#8217;ve been playing with the evaluation license of VMware Workstation 6.5.  
Somewhat annoyingly, VMware uses the lowest-common-denominator Linux sound API, OSS.  Unfortunately, OSS, as typically [...]]]></description>
			<content:encoded><![CDATA[<p>I built a new desktop PC for use at home, and I installed Ubuntu 8.04 on it.  In anticipation of replacing the windows XP desktop with it, I&#8217;ve been playing with the evaluation license of VMware Workstation 6.5.  </p>
<p>Somewhat annoyingly, VMware uses the lowest-common-denominator Linux sound API, OSS.  Unfortunately, OSS, as typically implemented, only allows one application to have the sound device open at once.  This might have been a acceptable design in 1995, but it sucks today.</p>
<p>However, as many people mention in several places on the web, you can use the ALSA-OSS emulation layer to give you the benefits of ALSA (such as multiple applications opening the audio device at once) with VMware.  Almost all of them involve modifying the script which starts vmware to LD_PRELOAD the libaoss.so library.  However, this seems to not work in the latest versions, since there are multiple levels of shell scripts which start the actual binary, and some of them modify the LD_PRELOAD environment variable.  As far as I can discern, the &#8220;right&#8221; way is to add this line to /etc/vmware/config :</p>
<p>preload = &#8220;/usr/lib/libaoss.so&#8221;</p>
<p>And now, sound works just fine for me in VMware.<br />
(Note, I did have to &#8220;sudo apt-get install alsa-oss&#8221; beforehand.)</p>
]]></content:encoded>
			<wfw:commentRss>http://mike.magin.org/2009/01/08/using-alsa-for-sound-with-vmware-workstation-65-on-an-ubuntu-804-host/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Recent projects/interests</title>
		<link>http://mike.magin.org/2008/12/06/recent-projectsinterests/</link>
		<comments>http://mike.magin.org/2008/12/06/recent-projectsinterests/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 06:09:32 +0000</pubDate>
		<dc:creator>Michael Magin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mike.magin.org/?p=167</guid>
		<description><![CDATA[I&#8217;ve been reading the Java Virtual Machine spec and the book Inside the Java Virtual Machine.  I&#8217;ve begun to write my own JVM implementation in C++, not for practical reasons, but just for the learning experience.  So far it interprets most of a class file.  This has been on hold for a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been reading the Java Virtual Machine spec and the book <em>Inside the Java Virtual Machine</em>.  I&#8217;ve begun to write my own JVM implementation in C++, not for practical reasons, but just for the learning experience.  So far it interprets most of a class file.  This has been on hold for a few days.  What&#8217;s somewhat interesting to me, but which I did not realize before, is that the JVM design is very much centered around the java model of classes, interfaces, methods, etc.  Not that it&#8217;s stopped people from targeting a lot of languages to it in recent years.</p>
<p>I&#8217;m slowly heading back to my FPGA project.  I haven&#8217;t set up FPGA design software again, nor have I been mucking about in Verilog, however I&#8217;ve started to thinking about the implementation of a basic stack machine again.  I&#8217;m a little disinterested in Forth lately, so I may just code up a quick assembler for it and see what strikes my fancy after that.  At the moment, I&#8217;ve been scrawling some ideas on paper and thinking about how to best map about 19 instructions into a 16 bit word to minimize decoding logic.</p>
<p>More than ever, I believe that understanding how compilers work is among the most important practical topics in computer science, once you get beyond the basics.  I&#8217;m glad I took a &#8220;Programming Languages and Compilers&#8221; course in college, but it was just an intro really.  To really understand what&#8217;s going on and to really have the ability to make new tools when your tools are insufficient, this is a subject you can&#8217;t gloss over.  (<a href="http://steve-yegge.blogspot.com/2007/06/rich-programmer-food.html">Steve Yegge has a great rant about this.</a>)   </p>
<p>Mostly, I&#8217;ve just been cranking out solutions to Project Euler problems and reading books in my spare time.</p>
]]></content:encoded>
			<wfw:commentRss>http://mike.magin.org/2008/12/06/recent-projectsinterests/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Project Euler</title>
		<link>http://mike.magin.org/2008/11/20/project-euler/</link>
		<comments>http://mike.magin.org/2008/11/20/project-euler/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 05:30:35 +0000</pubDate>
		<dc:creator>Michael Magin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mike.magin.org/?p=162</guid>
		<description><![CDATA[I&#8217;ve been doing a lot of Project Euler problems in my spare time, as a sort of relaxation and challenge at the same time.  As of this evening, I&#8217;ve completed 25 of the 217 problems available so far.  I&#8217;ve written a few hundred lines of code to solve the problems using Haskell, C, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing a lot of <a href="http://projecteuler.net/">Project Euler</a> problems in my spare time, as a sort of relaxation and challenge at the same time.  As of this evening, I&#8217;ve completed 25 of the 217 problems available so far.  I&#8217;ve written a few hundred lines of code to solve the problems using Haskell, C, C++, Java, Javascript, and Python.  Some of those are much more concise than others.</p>
<p>I highly recommend it to anyone who enjoys writing code and math (especially number theory).  And I especially like my &#8220;language flavor of the moment&#8221; approach.  It keeps you nimble.  (Though, some problems just more difficult if your language of choice doesn&#8217;t have a built-in bignum implementation &#8212; fortunately Haskell and Python do.)</p>
]]></content:encoded>
			<wfw:commentRss>http://mike.magin.org/2008/11/20/project-euler/feed/</wfw:commentRss>
		</item>
		<item>
		<title>More Erlang, searching binaries</title>
		<link>http://mike.magin.org/2008/11/03/more-erlang/</link>
		<comments>http://mike.magin.org/2008/11/03/more-erlang/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 06:36:55 +0000</pubDate>
		<dc:creator>Michael Magin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mike.magin.org/?p=148</guid>
		<description><![CDATA[My enthusiasm is for erlang is somewhat dampened by the quality of its standard library, or at least it&#8217;s mismatch with some of the things I&#8217;ve come to expect through my use of Python, Perl, and other languages.
It is somewhat bizarre to me that there is not an obvious way to make a io_device() as [...]]]></description>
			<content:encoded><![CDATA[<p>My enthusiasm is for erlang is somewhat dampened by the quality of its standard library, or at least it&#8217;s mismatch with some of the things I&#8217;ve come to expect through my use of Python, Perl, and other languages.</p>
<p>It is somewhat bizarre to me that there is not an obvious way to make a io_device() as returned by <a href="http://www.erlang.org/doc/man/file.html#open-2">file:open/2</a> from a socket() returned by <a href="http://www.erlang.org/doc/man/gen_tcp.html#accept-1">gen_tcp:accept/1</a>.  Why would this be useful?  So as to make it easy to do things like <a href="http://www.erlang.org/doc/man/io.html#get_line-2">io:get_line/2</a> on it for protocols that are line-based.  Much like, in C, how you can fdopen on a socket to get a FILE * from any integer file descriptor including sockets. </p>
<p>I suppose the right thing to do is to create a server which wraps the socket() in a io_device() interface.  I&#8217;m not sure how that was going to perform, and I was just going to try doing the simplest thing that would work &#8212; which is to write my own line-buffering.</p>
<p>Now, in Erlang, strings are (linked) lists of chars (which are actually integers), so you don&#8217;t really want to use them for high performance IO.  You instead want to use &#8220;binaries&#8221; which are arrays of integers, essentially.  The standard functions for manipulation of binaries are pretty few in number, as far as I can tell.  You can efficiently split a binary with <a href="http://www.erlang.org/doc/man/erlang.html#split_binary-2">split_binary/2</a>, if you know the position you want to split it on, but if I wanted to split on a newline character (or character sequence) I&#8217;d need to be able to find the offset of that first, and I don&#8217;t see a function for searching a binary.</p>
<p>The obvious thing is to use pattern matching.  Unfortunately, pattern matching on binaries only allows variable length sections at the end.  So, I cannot do it in a single pattern match stage.  Instead, it seems that I need to write a function that recurses over the binary character-by-character:</p>
<p>[Until I figure out how to post code in wordpress, see <a href="http://paste.lisp.org/display/69677">http://paste.lisp.org/display/69677</a>]</p>
<p>I&#8217;ve yet to benchmark this and see how slow it is.  I suppose it might not be that bad if the erlang compiler and VM are good.  May not be much better than turning it into a string (list) and using the functions for strings:</p>
<p><a href="http://www.erlang.org/pipermail/erlang-questions/2004-December/013650.html">http://www.erlang.org/pipermail/erlang-questions/2004-December/013650.html</a><br />
<a href="http://www.erlang.org/pipermail/erlang-questions/2004-December/013666.html">http://www.erlang.org/pipermail/erlang-questions/2004-December/013666.html</a></p>
<p><em>[Edit: indeed.  I need to get to sleep, but a little benchmarking suggests this is vastly faster: <a href="http://paste.lisp.org/display/69680">http://paste.lisp.org/display/69680</a>]</em></p>
<p>At least I&#8217;m not the only one thinking along these lines: <a href="http://www.erlang.org/eeps/eep-0009.html">EEP 9 - Library for working with binaries</a></p>
<p>As a return to the original reason I started down this line of thought, it appears that both mochiweb (used both internally by Mochi Media and by CouchDB) and <a href="http://www.trapexit.org/A_fast_web_server_demonstrating_some_undocumented_Erlang_features">this http server</a> use an undocumented feature: </p>
<blockquote><p>
{packet, http} puts the socket into http mode. This makes the socket wait for a HTTP Request line, and if this is received to immediately switch to receiving HTTP header lines. The socket stays in header mode until the end of header marker is received (CR,NL,CR,NL), at which time it goes back to wait for a following HTTP Request line.
</p></blockquote>
<p>And, according to that page:</p>
<blockquote><p>
The undocumented features presented in this HOWTO are undocumented because they are not supported by Ericsson. On the other hand they are used in commercially shipping systems.
</p></blockquote>
<p>That, if true, rubs me the wrong way.</p>
]]></content:encoded>
			<wfw:commentRss>http://mike.magin.org/2008/11/03/more-erlang/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Haskell and Erlang, part 1</title>
		<link>http://mike.magin.org/2008/11/01/haskell-and-erlang-part-1/</link>
		<comments>http://mike.magin.org/2008/11/01/haskell-and-erlang-part-1/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 19:25:18 +0000</pubDate>
		<dc:creator>Michael Magin</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://mike.magin.org/?p=145</guid>
		<description><![CDATA[I&#8217;ve been rather quiet here lately.  For the most part, I&#8217;ve been just too busy, and in what free time I&#8217;ve had, I&#8217;ve preferred to spend it learning programming languages and related stuff.
I spent a few days playing with Haskell.  I should write some more about what I found interesting about a strongly-typed [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been rather quiet here lately.  For the most part, I&#8217;ve been just too busy, and in what free time I&#8217;ve had, I&#8217;ve preferred to spend it learning programming languages and related stuff.</p>
<p>I spent a few days playing with Haskell.  I should write some more about what I found interesting about a strongly-typed pure functional language, one where you have to essentially do side-effects (such as I/O) by passing the state of the world to the function and returning it from the function, albeit with some neat shortcuts (Monads, etc.) to make that less awkward than you&#8217;d think.  It was possibly even more fascinating than when I first learned Standard ML back in college.</p>
<p>I found that it was really difficult to express non-trivial things in Haskell however.  I think this may become easier with more exposure to it in the future, but for now I&#8217;m putting it on the back burner.  I think I&#8217;m going to aim to make one day a month &#8220;Haskell day&#8221; wherein I advance my exposure to Haskell, because I find it very perspective-expanding.</p>
<p>Largely because this renewed my belief in the usefulness of functional programming languages, I then decided to take a closer look at Erlang than I have in the past, including ordering <a href="http://www.pragprog.com/titles/jaerlang/programming-erlang">the Joe Armstrong book</a>.  At the moment, the toy project I&#8217;m working on is a twitter client that acts as a irc daemon, so I can just connect to this in my irc client (which easily handles multiple irc networks), and then I can read twitters and send twitters from within it, not wasting interface-space with another application, or time by going to the twitter homepage.</p>
<p>Erlang is rather ideal for applications that do a bunch of network stuff, it provides for the easy creation of lightweight processes and the easy sending of messages between them.  Sending messages is non-blocking, and the system insures that the message will be in the receiving process&#8217; mailbox, ready to be received with a pattern-matching construct.  It does not provide object-oriented programming constructs in the usual way people think of OOP, however, it can be argued that passing messages to processes is directly analogous to invoking methods on objects.  (See a good <a href="http://www.cincomsmalltalk.com/userblogs/ralph/blogView?showComments=true&#038;entry=3364027251">blog post by Ralph Johnson</a> and a <a href="http://lambda-the-ultimate.org/node/2386">comment thread on LtU</a>.)</p>
<p>So far, I feel like I understand 95% of the language, and about 50% of OTP (Open Telecom Platform, an included set of libraries and conventions for building applications.)  It feels pretty good, and practically quite usable.  It does feel a little less modern as functional programming languages go.  It doesn&#8217;t have currying, and some of the syntax is a little less clean than you find in Haskell.  But, on the whole, it does have a lot of the features I do want, including a decent pattern matching syntax.</p>
]]></content:encoded>
			<wfw:commentRss>http://mike.magin.org/2008/11/01/haskell-and-erlang-part-1/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
