<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8981740280837861615</id><updated>2011-12-14T07:42:33.124-05:00</updated><category term='tpk'/><category term='r'/><category term='meta'/><category term='offtrack'/><category term='helloworld'/><category term='ada'/><category term='python'/><category term='fp'/><category term='gfx'/><category term='smalltalk'/><title type='text'>Sixteen Languages</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>51</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-1758807145659672059</id><published>2009-03-19T12:00:00.001-04:00</published><updated>2010-10-18T21:27:30.292-04:00</updated><title type='text'></title><content type='html'>&lt;span style="font-style:italic;"&gt;Paul has gone off to &lt;a href="http://www.ccs.neu.edu/research/prl/"&gt;grad school&lt;/a&gt; to study programming languages up close.  As time goes on, the things he said in the past seem ever more misleading and uninformed; that is how he knows he is learning. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-1758807145659672059?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1758807145659672059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1758807145659672059'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2009/03/paul-is-currently-being-lame-o-and.html' title=''/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-5583169050322049075</id><published>2008-02-24T17:44:00.010-05:00</published><updated>2008-02-24T20:10:43.229-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtrack'/><title type='text'>Variations on the curly bracket</title><content type='html'>I've been experimenting with exorcising the curly bracket, which, uh, &lt;a href='http://16languages.blogspot.com/2007/12/defensely-engineered-ada-retrospective.html'&gt;bothers me somewhat&lt;/a&gt;.  I've been coding in Envy Code R and Inconsolata, whose curly brackets I've been tweaking in FontForge.&lt;br /&gt;&lt;br /&gt;Here are some renderings of the variations I've tried out:&lt;br /&gt;&lt;br /&gt;Inconsolata, unmodified: &lt;br /&gt;&lt;br /&gt;&lt;img src='http://lh3.google.com/paul.stansifer/R8IQy-odzaI/AAAAAAAAAJg/yqZbxdyEHIQ/s800/i_norm.png' /&gt;&lt;br /&gt;&lt;br /&gt;Envy Code R, with my first variation: &lt;br /&gt;&lt;br /&gt;&lt;img src="http://lh6.google.com/paul.stansifer/R8IQ8uodzbI/AAAAAAAAAJo/fsoy_8lbnkk/s800/e_lines.png" /&gt;&lt;br /&gt;&lt;br /&gt;Inconsolata, with my second variation: &lt;br /&gt;&lt;br /&gt;&lt;img src="http://lh3.google.com/paul.stansifer/R8IR_-odzcI/AAAAAAAAAJw/Pgh3P15ZSpg/s800/i_gaps.png" /&gt;&lt;br /&gt;&lt;br /&gt;Inconsolata, with my current variation: &lt;br /&gt;&lt;br /&gt;&lt;img src="http://lh6.google.com/paul.stansifer/R8ISLuodzdI/AAAAAAAAAJ4/zujR0EP6t8g/s800/i_halves.png" /&gt;&lt;br /&gt;&lt;br /&gt;None of these completely satisfies me, but I feel like I'm making some progress.  (Anyone with actual experience with type will probably tear me to pieces for these.)  It's amazing how much room there is for variation with that one stupid character.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-5583169050322049075?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/5583169050322049075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=5583169050322049075' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/5583169050322049075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/5583169050322049075'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2008/02/variations-on-curly-bracket.html' title='Variations on the curly bracket'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-9037805583522826460</id><published>2008-01-27T22:24:00.000-05:00</published><updated>2008-01-27T23:44:22.267-05:00</updated><title type='text'>Programming by not programming</title><content type='html'>My other project, the one that has put this one on hold (or perhaps just intense slow motion), is going along fine.  Or so I think.  My collaborator and I seem to have a rather nice collection of bits and pieces that we're slowly integrating in the direction of a useful application.  The thing is, I don't seem to remember working on it.  I've touched a little bit of Python that uses web.py, but mostly I've just been fiddling with CSS (which I don't really know), and looking at graphs in R (which I also really don't know).&lt;br /&gt;&lt;br /&gt;For example, I'm not even really sure why the first little bit of AJAX stuff that I did started working because I didn't know why it wasn't working in the first place.  But there are so few moving parts that I'm not too worried about it being fragile.  If necessary, we could rewrite it, and it wouldn't take too long.  In fact, there just isn't that much code.  We've been spending most of our time discussing minutiae.  That's a good thing, though, because it kept us from coding, and code is a liability.  Not only did it not take us too long to get here, but we also aren't carrying the weight of a huge and complicated codebase, just a scattering of parts and some baling wire that we're slowly working with.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-9037805583522826460?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/9037805583522826460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=9037805583522826460' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/9037805583522826460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/9037805583522826460'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2008/01/programming-by-not-programming.html' title='Programming by not programming'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-1863630776773538569</id><published>2008-01-13T20:34:00.000-05:00</published><updated>2008-01-13T21:04:07.040-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='r'/><title type='text'>Getting further distracted: R</title><content type='html'>Well, I'm going further off track, but it's an interesting track.  I'm now (again for outside reasons) learning &lt;a href='http://en.wikipedia.org/wiki/R_%28programming_language%29'&gt;R&lt;/a&gt;.  It's a language made for mathematics and statistics, and, having seen someone who knows what he's doing operate it, I'm very impressed with its tools for succinctly exploring data.  It's an interactive language, so the focus is a bit different, but it's apparently got most of the nice functional features that I'm learning to know and love.  Also: it's very vector-oriented, with lots of tools to create and manipulate vectors.  In fact, I'm pretty sure there's just no distinction between a number and a one-element numerical vector:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&gt; 4 == 4&lt;br /&gt;[1] TRUE&lt;br /&gt;&gt; 4 == c(4)&lt;br /&gt;[1] TRUE&lt;br /&gt;&gt; 4 == c(4, 5)&lt;br /&gt;[1]  TRUE FALSE&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It'll be an interesting world to live in.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-1863630776773538569?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/1863630776773538569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=1863630776773538569' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1863630776773538569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1863630776773538569'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2008/01/getting-further-distracted-r.html' title='Getting further distracted: R'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-4843507434908272910</id><published>2008-01-04T18:57:00.000-05:00</published><updated>2008-01-04T20:07:07.364-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Frameworks</title><content type='html'>I'm working on two things in Python right now, a simple physics-based game, and a frontend for a web application (the later is part of an unrelated project that just seemed best to do in Python).  I'm using pygame and web.py respectively.  From my limited experience, I'm very impressed by both.  The main way that I measure my impressedness is that I keep on getting stuck on problems that are actually hard problems in the things I'm trying to write.  In fact, it's kind of frustrating, because I'm just jumping from problem to problem as I start to lay out my programs, with only occasional breaks for figuring out how the framework works.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-4843507434908272910?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/4843507434908272910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=4843507434908272910' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/4843507434908272910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/4843507434908272910'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2008/01/frameworks.html' title='Frameworks'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-3918855834909835051</id><published>2007-12-22T23:08:00.000-05:00</published><updated>2007-12-23T00:49:13.016-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='meta'/><title type='text'>Moving off the schedule</title><content type='html'>Well, I've really been neglecting Python.  This season turns out to be kinda hectic, which I incorrectly figured that I could absorb with my slack more easily.  So I'm dropping the 16 days on/7 days off schedule so I can give these languages the attention they deserve.  My XO is coming with me on vacation, and I'll see if I can work on Python some over the next week.&lt;br /&gt;&lt;br /&gt;It's a shame because I'm usually rather deadline-motivated, so this will make everything take longer.  Oh well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-3918855834909835051?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/3918855834909835051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=3918855834909835051' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/3918855834909835051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/3918855834909835051'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/12/moving-off-schedule.html' title='Moving off the schedule'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-3594678038927524084</id><published>2007-12-17T00:57:00.001-05:00</published><updated>2007-12-17T01:05:00.009-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gfx'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Cities and roads in python</title><content type='html'>Here's what I've been working on (on and off — I have to admit I haven't devoted too much time to it) in Python.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_iipz4kJmBUs/R2YP9g7RDDI/AAAAAAAAAHU/GHKKrkMt1fA/s1600-h/terr.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://bp3.blogger.com/_iipz4kJmBUs/R2YP9g7RDDI/AAAAAAAAAHU/GHKKrkMt1fA/s400/terr.png" alt="" id="BLOGGER_PHOTO_ID_5144817173802322994" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The blue squares are cities, which emit workers.  The workers build roads, and a complicated decision procedure determines whether the workers actually follow the roads or not.  (Approximately, they'll do it if they're going in the same direction, and haven't hit a road in a while.)  The original plan was to do some more city-building and resource-gathering simulation, but I wound up focusing of making the lines look nice, which was probably more on-task anyways.  A neat hack: the workers could only move in 8 directions, which gave chunky lines.  But the directions themselves were stored as floating-point numbers, so I nudged rounding back and forth every other timestep, which gave pretty nice and smooth lines.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It's funny how the things we will or won't do in the name of performance are so influenced by syntax.  It's a lot easier to bring myself to write something O(n) in the middle of a tight loop if it's a list comprehension than if it's a &lt;code&gt;for&lt;/code&gt; loop.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-3594678038927524084?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/3594678038927524084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=3594678038927524084' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/3594678038927524084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/3594678038927524084'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/12/cities-and-roads-in-python.html' title='Cities and roads in python'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_iipz4kJmBUs/R2YP9g7RDDI/AAAAAAAAAHU/GHKKrkMt1fA/s72-c/terr.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-4500843030824706394</id><published>2007-12-12T19:41:00.000-05:00</published><updated>2007-12-13T01:13:31.555-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Settling in with Python</title><content type='html'>Dude, Python needs forward declares?  That's a shame.&lt;br /&gt;&lt;br /&gt;It's vaguely disconcerting that it seems like &lt;em&gt;nothing&lt;/em&gt; is checked until runtime, and that all kinds of errors don't get caught unless the code actually gets executed.  It totally confuses my traditionaly ways of reasoning about what is wrong.  I bet it's more intuitive for beginners, though, to think of parsing/typechecking/execution as happening all at the same time.&lt;br /&gt;&lt;br /&gt;Ada is really subversive.  In Ada, you can call a zero-argument function by stating its name.  In Python, with first-class functions, that is a legal syntax for the wrong thing, but it doesn't stop me from using it.  (The solution, of course, is that functions must not have zero arguments.  If you have referential transparency, there's no point in zero-arg functions.)&lt;br /&gt;&lt;br /&gt;Doing object-oriented design in Python is a lot like doing it in Smalltalk, except that I can work in just one text file easily.  It's quite pleasant.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-4500843030824706394?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/4500843030824706394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=4500843030824706394' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/4500843030824706394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/4500843030824706394'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/12/settling-in-with-python.html' title='Settling in with Python'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-3096848171417643208</id><published>2007-12-11T00:38:00.000-05:00</published><updated>2007-12-11T00:43:29.200-05:00</updated><title type='text'>Clerical error</title><content type='html'>Forgot to actually put up the &lt;a href='http://16languages.blogspot.com/2007/12/python-begins.html'&gt;post&lt;/a&gt; about starting Python.  Oops.  Abandoning the file metaphor (as Blogger does) for autosaved, no-management-needed drafts is a big improvement in usability, but it causes me to lose important bits of things whose brain cells atrophied a while back.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-3096848171417643208?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/3096848171417643208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=3096848171417643208' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/3096848171417643208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/3096848171417643208'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/12/clerical-error.html' title='Clerical error'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-8316259484978458960</id><published>2007-12-11T00:22:00.001-05:00</published><updated>2007-12-11T00:36:55.987-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tpk'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Quick TPK update</title><content type='html'>With help from a friend of mine who knows Python, here's an edit to make TPK a bit more Pythonic:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;from math import sqrt&lt;br /&gt;&lt;br /&gt;def f(x):&lt;br /&gt;    return sqrt(abs(x)) + 5.0*(x**3)&lt;br /&gt;&lt;br /&gt;a = [input() for i in xrange(11)]&lt;br /&gt;a.reverse()&lt;br /&gt;for e, res in [(e, f(e)) for e in a]:&lt;br /&gt;    if res &gt; 400:&lt;br /&gt;        print e, "TOO LARGE"&lt;br /&gt;    else:&lt;br /&gt;        print e, res&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;code&gt;xrange&lt;/code&gt; is a nifty tool, returning an object that is somewhere between a lazy array and a function.  Well, I guess it &lt;em&gt;is&lt;/em&gt; one or the other, but it's a nice conceptual place.  Also, is it just me, or is it the case that the name doesn't make any sense, and it's better than any name that does?&lt;br /&gt;&lt;br /&gt;Also, creating tuples for my loop state is bringing back memories of FP...  I think I may prefer the more imperative style for that part of the task.  Either that, or I just don't like the look of list comprehension.  Introducing a variable name in the &lt;em&gt;middle&lt;/em&gt;?  What's wrong with just making a function &lt;code&gt;for&lt;/code&gt; that does both &lt;code&gt;filter&lt;/code&gt; and &lt;code&gt;map&lt;/code&gt;?&lt;br /&gt;&lt;br /&gt;You know, doing without curlies is perhaps less strange than doing without semicolons.  Maybe it's just habit, but it's real strange to leave statements unpunctuated, ready to float off to the right.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-8316259484978458960?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/8316259484978458960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=8316259484978458960' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/8316259484978458960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/8316259484978458960'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/12/quick-tpk-update.html' title='Quick TPK update'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-1495728737238695174</id><published>2007-12-08T21:24:00.000-05:00</published><updated>2007-12-11T00:38:05.813-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tpk'/><category scheme='http://www.blogger.com/atom/ns#' term='helloworld'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Python begins</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Python:&lt;/span&gt; 9:13 PM December 8th, 2007 through 9:13 PM December 8th, 2007&lt;br /&gt;&lt;br /&gt;&lt;img src="http://bp0.blogger.com/_iipz4kJmBUs/R1Y2YzlhBrI/AAAAAAAAAGc/oONsqr-J1IQ/s400/python_stamp.png" style="float: left;" /&gt;&lt;br /&gt;&lt;pre&gt;print "hello, world"&lt;/pre&gt;&lt;a href="http://xkcd.com/353/"&gt;As XKCD points out&lt;/a&gt;, it really is pretty simple.&lt;br /&gt;&lt;br /&gt;TPK is not hard, either.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;from math import sqrt&lt;br /&gt;&lt;br /&gt;def f(x):&lt;br /&gt;   return sqrt(abs(x)) + 5.0*(x**3)&lt;br /&gt;&lt;br /&gt;a = [input() for i in range(0, 10)]&lt;br /&gt;a.reverse()&lt;br /&gt;for e in a:&lt;br /&gt;   res = f(e)&lt;br /&gt;   if res &gt; 400:&lt;br /&gt;       print e, "TOO LARGE"&lt;br /&gt;   else:&lt;br /&gt;       print e, res&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I made a couple mistakes in writing it.  First, I &lt;code&gt;a.append&lt;/code&gt; without defining &lt;code&gt;a&lt;/code&gt;.  Not sure how variable declarations work in Python (isn't it not supposed to have any?), so I just used a list comprehension.  (Because of my predispositions, it feels vaguely sinful to put side-effects in what is effectively a &lt;code&gt;map&lt;/code&gt;, but maybe this is my &lt;a href="http://en.wikipedia.org/wiki/Rumspringa"&gt;Rumspringa&lt;/a&gt;.)&lt;br /&gt;&lt;br /&gt;The second is more interesting.  I attempted to do &lt;code&gt;for e in a.reverse()&lt;/code&gt;, which gave me a slightly cryptic error.  (Having worked with an FP implementation with exactly two error messages, I am not complaining.  For that matter, having used the STL in C++, I am not complaining.)  When I was retyping it to put &lt;code&gt;a.reverse&lt;/code&gt; on its own, a note popped up (I'm using Editra, which, it turns out, provides as-you-type Python documentation.  I'm going to be spoiled!), documenting &lt;code&gt;reverse&lt;/code&gt; as "&lt;tt&gt;L.reverse -- reverse *IN PLACE*&lt;/tt&gt;".  I think this is significant.&lt;br /&gt;&lt;br /&gt;This is my fastest zero-to-TPK time so far.  (I should point out that I already knew a bit of Python beforehand.  Not nearly enough to implement TPK, though.)  It'll probably be all downhill from here.  Heck, I don't know if 16 days is enough to implement TPK in some of the languages I have coming up. &lt;br /&gt;&lt;br /&gt;Looking at it over again, I wonder if I have introduced a subtle bug.  Is the order of evaluation of list comprehensions defined?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-1495728737238695174?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/1495728737238695174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=1495728737238695174' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1495728737238695174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1495728737238695174'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/12/python-begins.html' title='Python begins'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_iipz4kJmBUs/R1Y2YzlhBrI/AAAAAAAAAGc/oONsqr-J1IQ/s72-c/python_stamp.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-542655791974779199</id><published>2007-12-04T20:56:00.000-05:00</published><updated>2007-12-05T00:22:34.174-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ada'/><title type='text'>Defensely Engineered: Ada Retrospective</title><content type='html'>Ada doesn't really deserve the reputation that it's gotten.  I was expecting a language that was clunky, verbose, and unmanageable, but it really wasn't bad.  I did wind up writing a lot of ugly clumps of code, but I'm fair sure that, with a little more time it would have been a lot better.  I certainly wouldn't be writing code this nice this far into, say, C++.  If D is the language that C++ should have been (so I have heard, anyhow), Ada is the language that Java should have been.  Ada has the same flaws and features that Java (at least the later versions) has: it's safe, generic, and consistent, but pedantic, verbose, and unfocused.  But the flaws are less deep, and the features are closer to working (because what language actually is "safe, generic, and consistent"?)&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Types&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Ada is strongly-typed.  I think that Java has given static explicit type systems a bad name.  Ada's type system is kind of bewildering, but it's much more flexible, and the verbosity is more manageable.  Also, generic packages (though I haven't really used them) seem like a great way to have type-independent functionality without tying it to one class, or requiring the full parameterized type name to be scattered all over code.&lt;br /&gt;&lt;br /&gt;Lightweight numeric types of a limited range are also really cool.  Sadly, I don't think that they are necessarily lightweight enough.  Also, I understand that there isn't any significant compile-time typechecking for them.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Syntax&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I don't like curly braces.  This may be a minor thing, but, since it lacks them, Ada code just looks better to me.  Python (my next language on the list) removes block delimiters entirely in favor of indentation, which I like, and I figured would be more important, but perhaps it not the presence of block delimiters but their prominence that bothers me.&lt;br /&gt;&lt;br /&gt;You see, in C-syntaxed languages, when I'm off-balance and dumbly staring at some code trying to collect my wits, the only thing I'm ever aware of is "This code has some blocks in it." It's the utter obviousness of it that bothers me: with those ugly markings around each visual group of lines, the code is saying &lt;span style="font-weight: bold;"&gt;"Okay now, these lines, and only these lines will be grouped for the purpose of a control structure!  Got it?"&lt;/span&gt;, and I'm just sitting there, repeating the words back without any understanding, because I don't care since what I'm really worried about is how I can't concentrate on figuring out the significance of the funny squiggles that I think spell out "w h i l e", which, if I recall correctly, is a preposition that has some significance in whatever language it is that I was programming in before my mind ran out of memory and crashed trying to store all those little punctuation delimiters that have all of these weird points and curves, and they don't look right together, and it's like it's not really sure whether it wanted to be a nice curvy parenthesis or a solid, well-build square bracket, and it wound up with like a billion control points just to define its shape, which was all to no avail, because I'm programming in a font that's too small to make the points stand out from the body and they come out looking like some kind of badly-drawn vertical pipes, I mean, look at this:&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;code&gt;{&lt;/code&gt;&lt;/center&gt;&lt;br /&gt;What is it even supposed to look like?  Sheesh.  No wonder we have a software crisis.&lt;br /&gt;&lt;br /&gt;Uh, so, Ada is very much a verbose language, but the lack of extraneous punctuation makes up for a great deal.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Data structures&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;There's no way this could actually be true, but to all appearances, the following is the case:  Ada did not have, in its default library, any data structures that could be resized after creation, until 2005.  In Ada '05, they added nice generic containers to the standard library, which, for technical reasons, cannot be used unless you create an additional source file for each declaration of a container.&lt;br /&gt;&lt;br /&gt;I'm sure there is a better way.  I'm sure there &lt;span style="font-style: italic;"&gt;was&lt;/span&gt; a better way in the eighties.  I couldn't figure it out, so I rolled my own linked-lists, one for each type I wanted.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Syntax again&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Oh, I forgot that I had more to say about Ada syntax.  For a lot of the errors I made in Ada, the compiler would helpfully tell me something along the lines of "You meant to use a &lt;code&gt;;&lt;/code&gt; instead of a &lt;code&gt;,&lt;/code&gt; here.", or "You need to have a &lt;code&gt;with&lt;/code&gt; declaration in order to use this package.", etc.  Error messages like this are very helpful, but if you deal with them long enough, you start to want to say to the compiler, "Look, who's the programmer here, me or you?  If you know so much, why don't you just write the stupid program yourself, huh?".  Basically, there's a lot of Ada syntax which exists mainly as error-correcting codes.  These things force you to convey your intent in multiple ways, so the compiler knows what you really meant.&lt;br /&gt;&lt;br /&gt;Theoretically, this sort of thing could prevent certain errors from escaping human review.  However, I seriously doubt that it saves the programmer from much more than the occasional typo.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Conclusion&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I better wrap this up before it gets even later, and I fall further off my rocker.  I suspect that, if Ada had been more popular, more languages that came after it would have tried to build effective and/or shiny static type systems.  And that would have been pretty nice.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-542655791974779199?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/542655791974779199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=542655791974779199' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/542655791974779199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/542655791974779199'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/12/defensely-engineered-ada-retrospective.html' title='Defensely Engineered: Ada Retrospective'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-4479557784903294121</id><published>2007-12-01T21:08:00.000-05:00</published><updated>2007-12-01T22:37:05.838-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ada'/><title type='text'>Ada done (kind of)</title><content type='html'>Well, I have something that resembles a static type checker right now.  I'll take a break now, and revisit my work at some point later to flesh it out.  In my defense, I ran into a couple compiler bugs in GNAT that slowed me down as I rooted out the code that triggered them (one time it was a repeated declaration, another was something that I was about to replace anyways).  I don't even have enough capabilities to test it properly right now -- I need to allow declarations of functions in order to do interesting things, and I should also read some predefined functions from a file, since there will be magic functions that create the POV-Ray scene elements in the first place.&lt;br /&gt;&lt;br /&gt;But I think it works mostly.  The code came out pretty smoothly, despite a few restructurings of certain parts of the code.&lt;br /&gt;&lt;br /&gt;Why doesn't Ada 95 have some kind of runtime-variable-sized container as part of its default library?  Even FP has that!  I had to roll my own linked lists, because specifying a generic list from the Ada 2005 just wouldn't work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-4479557784903294121?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/4479557784903294121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=4479557784903294121' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/4479557784903294121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/4479557784903294121'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/12/ada-done-kind-of.html' title='Ada done (kind of)'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-5795441613930282464</id><published>2007-12-01T10:04:00.000-05:00</published><updated>2007-12-01T10:10:23.375-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ada'/><title type='text'>Oops.</title><content type='html'>So, I wasn't paying attention, and didn't realize that my 16 days for Ada were almost up.  Today will be a mad dash to complete Ada's part of the POV-Ray frontend project.  I decided that it would be most appropriate to build the static type checker in Ada, so that's what I'll be doing today.  &lt;br /&gt;&lt;br /&gt;This project has been a really interesting exploration of my tendency to procrastinate.  Dang it, I have to stop using phrases like that.  What I mean is, it's a good thing that I set strict deadlines for myself, or I wouldn't get &lt;i&gt;anything&lt;/i&gt; done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-5795441613930282464?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/5795441613930282464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=5795441613930282464' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/5795441613930282464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/5795441613930282464'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/12/oops.html' title='Oops.'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-6763477467677228123</id><published>2007-11-28T20:58:00.000-05:00</published><updated>2007-11-28T22:25:08.992-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gfx'/><category scheme='http://www.blogger.com/atom/ns#' term='ada'/><title type='text'>Making Bars</title><content type='html'>This little graphics generator is based on a pretty simple concept.  It takes a swath of vertical space and randomly assigns it one of four types:&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Color&lt;/span&gt; is a random shade of grey.&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Pair&lt;/span&gt; is two equal-sized swaths.&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Dupe&lt;/span&gt; is a pair of equal-sized swaths with the same content.&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Swirl&lt;/span&gt; is two equal-sized swaths, twisted together.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_iipz4kJmBUs/R04ibUtt36I/AAAAAAAAAGE/TfwZmvKAluo/s1600-h/bars3.png"&gt;&lt;img style="float:left; margin:0 10px 10px 10px;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_iipz4kJmBUs/R04ibUtt36I/AAAAAAAAAGE/TfwZmvKAluo/s400/bars3.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5138082077688586146" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_iipz4kJmBUs/R04ipUtt37I/AAAAAAAAAGM/7OTaukBQh6M/s1600-h/bars4.png"&gt;&lt;img style="float:left; margin:0 10px 10px 10px;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_iipz4kJmBUs/R04ipUtt37I/AAAAAAAAAGM/7OTaukBQh6M/s400/bars4.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5138082318206754738" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;It's partially inspired by &lt;a href="http://www.eblong.com/zarf/boodler/"&gt;Boodler&lt;/a&gt;, a "soundscape" tool that can, among other things, generate random mutating drum rhythms with (what I think is) a similar technique.  It's also kind of inspired by the &lt;a href="http://amarok.kde.org/wiki/Moodbar"&gt;moodbar&lt;/a&gt; in Amarok; I started out imagining the images as being much narrower, and completely 1-dimensional.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Object-orientation in Ada is, as I may have hinted earlier, powerful but has confusing syntax.  And this is from someone who writes in C++ for a living.  I guess that it's not fair to do this to Ada: it only has a few days, and I've been learning C++, on and off, for the last six years or so.  (It feels like longer.)  I wonder how much it matters how learnable a language is?  Consider that languages with enthusiastic user communities are often said (albeit by those same communities) to be good first languages for new programmers (I'm thinking of Smalltalk, Python, and Scheme, here).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-6763477467677228123?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/6763477467677228123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=6763477467677228123' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/6763477467677228123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/6763477467677228123'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/11/making-bars.html' title='Making Bars'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_iipz4kJmBUs/R04ibUtt36I/AAAAAAAAAGE/TfwZmvKAluo/s72-c/bars3.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-6650567906842733451</id><published>2007-11-28T09:03:00.001-05:00</published><updated>2007-11-28T09:06:43.070-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gfx'/><category scheme='http://www.blogger.com/atom/ns#' term='ada'/><title type='text'>Whew!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_iipz4kJmBUs/R011f0tt35I/AAAAAAAAAF8/drI1t-T7Vrk/s1600-h/bars2.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://bp3.blogger.com/_iipz4kJmBUs/R011f0tt35I/AAAAAAAAAF8/drI1t-T7Vrk/s400/bars2.png" alt="" id="BLOGGER_PHOTO_ID_5137891939486392210" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_iipz4kJmBUs/R011aEtt34I/AAAAAAAAAF0/SzWvDfSKmg0/s1600-h/bars1.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp0.blogger.com/_iipz4kJmBUs/R011aEtt34I/AAAAAAAAAF0/SzWvDfSKmg0/s400/bars1.png" alt="" id="BLOGGER_PHOTO_ID_5137891840702144386" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I think I may have finally figured out how to make packages work in Ada.  Explanation for the images will come later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-6650567906842733451?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/6650567906842733451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=6650567906842733451' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/6650567906842733451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/6650567906842733451'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/11/whew.html' title='Whew!'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_iipz4kJmBUs/R011f0tt35I/AAAAAAAAAF8/drI1t-T7Vrk/s72-c/bars2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-5230680020802789798</id><published>2007-11-27T20:58:00.000-05:00</published><updated>2007-11-27T23:54:19.297-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ada'/><title type='text'>Okay, I lied.</title><content type='html'>It turns out that I hardly got any work done on vacation.  Go figure!&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;'Class&lt;/code&gt; is strange to get used to, but it's a neat feature, because it distinguishes between things that are exactly typed and things that can hold anything of a subtype.&lt;/li&gt;&lt;li&gt;Okay, I think I've found something about Ada to complain about.  In fact, it's a big part of why I don't have anything more to show right now.  Making the code work right now is kind of a guessing game.  I guess it's a lot like C++ like this, having lots of complicated rules that ultimately have a reason behind them, but C++ can get away with a lot more because it's more popular.  Also, Ada really oughtn't be like C++ in this way.  A C++ program is like a huge contraption made of wires and gears and relays, ranging in size from the enormous to the minuscule.  There are no panels or gates or guards, so that the maintainers can access any part as quickly as possible.  An Ada program is, well, more like a military submarine, with everything carefully screwed into place, labels on every part, all in a consistent industrial style.  But once you pull off the panels, you discover that what a part looks like and what a part is used for are not always related.&lt;/li&gt;&lt;li&gt;In other words, Ada's syntax lulls you into a false sense of security with all of its alphabetic friendliness, and then strangles you with details. &lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-5230680020802789798?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/5230680020802789798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=5230680020802789798' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/5230680020802789798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/5230680020802789798'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/11/okay-i-lied.html' title='Okay, I lied.'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-1478931717351736892</id><published>2007-11-20T00:56:00.000-05:00</published><updated>2007-11-20T01:02:16.585-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gfx'/><category scheme='http://www.blogger.com/atom/ns#' term='ada'/><title type='text'>On break</title><content type='html'>Learning &lt;span style="font-style: italic;"&gt;per se&lt;/span&gt; never sleeps, but Internet access is irregular, so updates will be suspended for a week.  Here's a preview of what the Ada graphics project is looking like so far:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_iipz4kJmBUs/R0J3surkKCI/AAAAAAAAAFs/hvuXDbgEQhM/s1600-h/bars.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_iipz4kJmBUs/R0J3surkKCI/AAAAAAAAAFs/hvuXDbgEQhM/s400/bars.png" alt="" id="BLOGGER_PHOTO_ID_5134798135484491810" border="0" /&gt;&lt;/a&gt;It needs some work compositionally, but the complexity is nice to see from a rather small source file and simple idea.  The image is divided up vertically by a binary tree.  Nodes in the tree can be all black, all while, two nodes next to each other, or two nodes overlayed and mixed diagonally.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-1478931717351736892?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/1478931717351736892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=1478931717351736892' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1478931717351736892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1478931717351736892'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/11/on-break.html' title='On break'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_iipz4kJmBUs/R0J3surkKCI/AAAAAAAAAFs/hvuXDbgEQhM/s72-c/bars.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-1818552155900139204</id><published>2007-11-20T00:55:00.000-05:00</published><updated>2007-11-20T00:56:29.710-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ada'/><title type='text'></title><content type='html'>I'm getting close to finished with the graphics hack, but there's a typing syntax issue that's driving me crazy. &lt;br /&gt;&lt;ul&gt;&lt;li&gt; I totally don't understand why &lt;code&gt;.all&lt;/code&gt; dereferences a pointer.  It's just really strange.  &lt;/li&gt;&lt;li&gt; &lt;code&gt;.all&lt;/code&gt; seems to be opposed to &lt;code&gt;.constant&lt;/code&gt; access, which makes some sense, I guess.&lt;/li&gt;&lt;li&gt; I'm using examples from &lt;a href="http://sandbox.mc.edu/%7Ebennet/ada/examples/index.html"&gt;http://sandbox.mc.edu/~bennet/ada/examples/index.html&lt;/a&gt; as guides.  They're pretty good.&lt;/li&gt;&lt;li&gt; &lt;code&gt;bars2.adb:30:26: R "enames" expected&lt;/code&gt; is the strangest error message in the world.  Is it trying to tell me to use the keyword "&lt;code&gt;renames&lt;/code&gt;"?&lt;/li&gt;&lt;li&gt; Using aggregates instead of writing a full constructor makes banging out a lightweight class hierarchy much simpler.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-1818552155900139204?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/1818552155900139204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=1818552155900139204' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1818552155900139204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1818552155900139204'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/11/im-getting-close-to-finished-with.html' title=''/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-1921170987631350978</id><published>2007-11-17T23:26:00.000-05:00</published><updated>2007-11-18T00:05:48.922-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ada'/><title type='text'></title><content type='html'>&lt;ul&gt;&lt;li&gt; For some reason, Ada's error messages always seem to be really informative.  I suppose that some of this is by comparison with FP's error messages (the complete set of which are as follows: &lt;code&gt;syntax error&lt;/code&gt;, &lt;code&gt;?&lt;/code&gt;), but it also seems to quite often actually point me to the right place.&lt;/li&gt;&lt;li&gt; It's surprisingly useful to have an exponentiation operator.&lt;/li&gt;&lt;li&gt; I like not having to parenthesize the conditions in an &lt;code&gt;if&lt;/code&gt;.  For some reason, typing &lt;code&gt;then&lt;/code&gt; feels a lot cheaper than adding the extra parens.  I guess perhaps they mush up with the parentheses that inevitably are a part of the condition?&lt;/li&gt;&lt;li&gt; Also, the named-argument style for constructors &lt;code&gt;Font := (Face =&gt; Helvetica, Weight =&gt; Bold, Size =&gt; 12)&lt;/code&gt; is pretty neat.  Constructors never have any sensible ordering for their arguments, anyways.&lt;/li&gt;&lt;li&gt; I really feel kinda guilty for liking Ada like this, like there's something that I'm ignoring.  I hope I figure out what it is soon, so I don't spend the next two weeks trying to figure out if I have Stockholm Syndrome or something.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-1921170987631350978?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/1921170987631350978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=1921170987631350978' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1921170987631350978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1921170987631350978'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/11/for-some-reason-adas-error-messages.html' title=''/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-3140890758327655452</id><published>2007-11-15T22:52:00.000-05:00</published><updated>2007-11-17T22:19:45.684-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tpk'/><category scheme='http://www.blogger.com/atom/ns#' term='ada'/><title type='text'>TPK Ada</title><content type='html'>&lt;pre&gt;&lt;br /&gt;with Ada.Text_IO;&lt;br /&gt;with Ada.Numerics.Generic_Elementary_Functions;&lt;br /&gt;&lt;br /&gt;procedure tpk is&lt;br /&gt;&lt;br /&gt;  package FMath is new Ada.Numerics.Generic_Elementary_Functions(Float);&lt;br /&gt;  package F_IO is new Ada.Text_IO.Float_IO(Float);&lt;br /&gt;&lt;br /&gt;  function F(X : Float) return Float is&lt;br /&gt;  begin&lt;br /&gt;     return FMath.Sqrt(abs(X)) + 5.0 * X ** 3;&lt;br /&gt;  end F;&lt;br /&gt;&lt;br /&gt;  A : array (Integer range 0 .. 10) of Float;&lt;br /&gt;  Res : Float;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;  for I in A'Range loop&lt;br /&gt;     F_IO.Get(A(I));&lt;br /&gt;  end loop;&lt;br /&gt;  for I in reverse 0 .. 10 loop&lt;br /&gt;     Res := F(A(I));&lt;br /&gt;     Ada.Text_IO.Put(Integer'Image(I));&lt;br /&gt;     if Res &gt; 400.0 then&lt;br /&gt;        Ada.Text_IO.Put_Line(" TOO LARGE");&lt;br /&gt;     else&lt;br /&gt;        Ada.Text_IO.Put_Line(Float'Image(Res));&lt;br /&gt;     end if;&lt;br /&gt;  end loop;&lt;br /&gt;end;&lt;br /&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;I'm working from &lt;a href="http://en.wikibooks.org/wiki/Ada_Programming"&gt;Wikibooks&lt;/a&gt;, which has a pretty good-looking tutorial.  It does, however, contain the sentence "Because the use of a goto needs the declaration of a label, the goto is in fact twice as readable than the use of return.", which is rather unsettling.  &lt;/li&gt;&lt;li&gt;Ada is kinda verbose, especially with regards to those &lt;code&gt;with&lt;/code&gt; and &lt;code&gt;using&lt;/code&gt; lines.  I'm not sure that that's worse than Java though.  On the other hand, I'm not sure that less verbose than Java means anything.  Somehow, Ada's verbosity seems friendlier, if that's even possible.  I guess &lt;code&gt;Ada.Text_IO.Get&lt;/code&gt; is better than &lt;code&gt;BufferedInputReader in = new BufferedInputReader(InputReader(System.in));&lt;/code&gt;, or whatever you have to do in Java.  Maybe it's because the definitions that take up half the file feel like they're more reusable, and would wind up being a smallish part of a real program.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;C++ had me convinced that generics were inherently ugly.  Ada has the &lt;i&gt;slight&lt;/i&gt; problem that I had to think about generics in order to write TPK, but the solution for delivering them seems elegant in some way.  I'm not sure how, though.  Maybe I just don't like angle brackets, either?&lt;br /&gt;&lt;ul&gt;&lt;li&gt;It seems like one way to make a complicated abstract feature tolerable is to require it for the most basic of operations.   That way, people will find a way to make it less obtrusive.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;There's a distinction between functions and procedures, which is cool.  I tend to feel that the mushing of the two together is rather random.  Sadly, however, functions are not referentially transparent.&lt;/li&gt;&lt;li&gt;Now that I'm back to static typing, it feels really unusual to have to declare all my variables at the top of the local procedure/function.  &lt;/li&gt;&lt;/ul&gt;Final evaluation:  Judging by &lt;a href="http://www.cs.fit.edu/%7Eryan/compare/tpk-adb.html"&gt;a pre-existing implementation&lt;/a&gt;, I didn't do too badly.  I didn't need generics after all, and I could have taken the reverse of the range of the array, rather than dealing with the indices directly.  Thinking of which: array index types are cool.&lt;br /&gt;&lt;br /&gt;Now I better go to bed...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-3140890758327655452?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/3140890758327655452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=3140890758327655452' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/3140890758327655452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/3140890758327655452'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/11/tpk-ada.html' title='TPK Ada'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-9222562445546097582</id><published>2007-11-15T21:46:00.000-05:00</published><updated>2007-12-01T09:52:53.260-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='helloworld'/><category scheme='http://www.blogger.com/atom/ns#' term='ada'/><title type='text'>Ada begins</title><content type='html'>&lt;b&gt;Ada&lt;/b&gt; 9:13 PM November 15th, 2007 through 9:13 PM December 1st, 2007&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://lh4.google.com/paul.stansifer/RzkiGJPS5LI/AAAAAAAAAFk/tE_Lx8lQehM/ada_stamp.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://lh4.google.com/paul.stansifer/RzkiGJPS5LI/AAAAAAAAAFk/tE_Lx8lQehM/ada_stamp.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;with Ada.Text_IO;&lt;br /&gt;&lt;br /&gt;procedure Main is&lt;br /&gt;begin&lt;br /&gt;  Ada.Text_IO.Put_Line("hello, world");&lt;br /&gt;end;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Ada ... Ada is kind of a normal language.  Actually, it was my first language.  I remember making some really simple &lt;a href="http://en.wikipedia.org/wiki/Scorched_Earth_%28computer_game%29"&gt;Scorched Earth&lt;/a&gt;-like computer game... but back then, I was still kind of unclear on the distinction between the underscore and the period, so I'm mostly starting from a blank slate here.&lt;br /&gt;&lt;br /&gt;What I currently know about Ada:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; It's strongly, statically typed. &lt;/li&gt;&lt;li&gt; It tends to forgo symbols for English reserved words.  (As someone who doesn't really like the way &lt;code&gt;{}&lt;/code&gt; look, I cannot object.)&lt;/li&gt;&lt;li&gt;It's associated with the Department of Defense, and was commissioned for  building reliable systems.&lt;/li&gt;&lt;li&gt;Lots of people really don't like it.  This is possibly correlated with the above.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;I also found out recently that one of the more famous software-related space accidents, &lt;a href="http://en.wikipedia.org/wiki/Ariane_5_Flight_501"&gt;the Ariane 5 test flight&lt;/a&gt;, was destroyed because of a numerical conversion problem in Ada code, which was guarded by a run-time check that had been removed for performance reasons.  I'm not sure whether that's a point for or against Ada.&lt;br /&gt;&lt;br /&gt;Anyways, I'm about to go write TPK in Ada.  I'm excited, since I know that TPK already exists in Ada, so it couldn't be that insane.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-9222562445546097582?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/9222562445546097582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=9222562445546097582' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/9222562445546097582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/9222562445546097582'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/11/ada-begins.html' title='Ada begins'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-1930981559444325709</id><published>2007-11-14T21:29:00.000-05:00</published><updated>2007-11-15T01:03:37.252-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fp'/><title type='text'>Life without names: FP retrospective</title><content type='html'>Some of the languages I'm working in for this project are esoteric languages, that have no direct practical use, like FP.  This isn't really FP's fault, since it's only a proof-of-concept language.  FP has some descendants that are (I assume) much more &lt;i&gt;useful&lt;/i&gt;.  But working in a simple language is possibly more instructive.  Specifically:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; It &lt;i&gt;is&lt;/i&gt; possible to live without names.  I'll admit that I often felt like I was translating imperative programming to sequences of lists, changing over iterations of &lt;code&gt;while&lt;/code&gt;, but I think that, for some problems that is a bit inevitable.  Not having names did help me break my programs down into smaller bits, but I'm not sure how I feel about such a draconian restriction.&lt;/li&gt;&lt;li&gt; One of the questions that bugged me about FP is "What makes FP so much different than other functional programming languages?".  Reading Backus's paper doesn't make it terribly clear, but this sentence is telling: "For example, pure Lisp is often buried in large extensions with many von Neumann features."  The context is about machine efficiency, but I get the sense that Backus feels that Lisp is conceptually muddled by the (potential) presence of side-effects.  &lt;/li&gt;&lt;li&gt; Ah-ha!  Haskell, the only major side-effect-free programming language I can think of, appeared in 1990, which is 13 years after Backus's Turing Award.  I guess that FP introduced the concept of pure functional programming.  This could very well explain Backus's emphasis on provability, because pure functional languages are much easier to prove things about.&lt;/li&gt;&lt;li&gt; In fact, I think this property turned out to be useful while I was working in FP.  I didn't have access to a debugger, or even error messages other than "&lt;code&gt;?&lt;/code&gt;", so I wound up cutting up pieces of the program and trying them out alone.  I could do this with confidence, because the flow of information in and out of an FP function is always explicit.&lt;/li&gt;&lt;li&gt; Working on esoteric languages in esoteric environments is ... different.  I'm reminded of this statement from the author of Unlambda: "Writing Unlambda programs isn't really as hard as it might seem; however, reading Unlambda programs is practically impossible."  As I was working with simple problems, FP's low readability wasn't a problem.  In fact, it kinda felt more easy than Smalltalk because the scale of the problems.  This reminds me of what Garrison Keillor said: "Intelligence is like four-wheel drive:  it only lets you get stuck in more remote places."&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-1930981559444325709?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/1930981559444325709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=1930981559444325709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1930981559444325709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1930981559444325709'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/11/life-without-names-fp-retrospective.html' title='Life without names: FP retrospective'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-3627064410796462650</id><published>2007-11-08T23:30:00.000-05:00</published><updated>2007-11-08T23:48:23.852-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fp'/><title type='text'>FP: finished</title><content type='html'>So, here's topological sort in FP.  It went pretty smoothly, and didn't take too long (which is fortunate, because I dallied, and wound up sort of rushing on the final debugging).  The good news is that, when finished with one part, the others could be built on it with confidence.  (Not shown are the test cases built into the source code, interspersed between functions). &lt;br /&gt;&lt;br /&gt;Topological sort, incidentally, is an important small piece of my project to write a compiler for the POV-Ray SDL: it's needed to sort out the order that declarations should appear in the file, based on their interdependencies.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;{&lt;br /&gt;  inDegreeZero #&lt;vertex  list_of_edges&gt; -&gt; bool&lt;br /&gt;  (null@2 -&gt; =@[%1 %1] ;&lt;br /&gt;   (=@[1 2@1@2] -&gt; =@[%0 %1] ;&lt;br /&gt;     inDegreeZero@[1 tl@2] ) )&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;{  #Oh, for a _filter_ functional form!&lt;br /&gt;  eligibles&lt;br /&gt;  3@(while not@null@1&lt;br /&gt;    [tl@1 2 (inDegreeZero@[1@1 2] -&gt; apndl@[1@1 3] ; 3)]&lt;br /&gt;  )@[1 2 iota@%0]&lt;br /&gt;}  #oops... really should've done that recursively&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;  in&lt;br /&gt;  (null@2 -&gt; =@[%1 %0] ;&lt;br /&gt;    (=@[1 1@2] -&gt; =@[%1 %1] ;&lt;br /&gt;      in@[1 tl@2] ))&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;  dropEdgesFrom&lt;br /&gt;  (null@2 -&gt; 2 ;&lt;br /&gt;    (in@[1@1@2 1] -&gt; dropEdgesFrom@[1 tl@2] ;&lt;br /&gt;          apndl@[1@2 dropEdgesFrom@[1 tl@2]] ))&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;  drop&lt;br /&gt;  (null@2 -&gt; 2 ;&lt;br /&gt;    (in@[1@2 1] -&gt; drop@[1 tl@2] ;&lt;br /&gt;        apndl@[1@2 drop@[1 tl@2]] ))&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;  toposort&lt;br /&gt;  (null@2 -&gt; 1 ;&lt;br /&gt;    concat@[3 toposort@[drop@[3 1] dropEdgesFrom@[3 2] ]]@[1 2 eligibles]&lt;br /&gt;  )&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Thursday, 9:13 PM, next week, I start in on Ada.  Before then: thoughts on FP.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-3627064410796462650?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/3627064410796462650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=3627064410796462650' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/3627064410796462650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/3627064410796462650'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/11/fp-finished.html' title='FP: finished'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-2974631350414720579</id><published>2007-11-07T18:58:00.000-05:00</published><updated>2007-11-08T19:35:02.772-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fp'/><title type='text'>Simple regex engine</title><content type='html'>It's pretty simple: the only special things that it handles are "&lt;tt&gt;dot&lt;/tt&gt;", representing any character, and alternation, which without some form of grouping, is basically just character classes.  It wouldn't be that hard to add on some other features, except that I realized that I didn't have a good way to represent grouping, seeing as I had already given a meaning to array-within-an-array.  I recall certain problems in Lisp being a pain as the lists-within-lists structures became more complicated.  I suppose that the solution, in both cases, is to have many definitions  of the form &lt;code&gt;(defun timeout caadar)&lt;/code&gt; or whatever (I don't remember much syntax: that's supposed to be setting the function &lt;code&gt;(timeout x)&lt;/code&gt;, an accessor for a data member, to &lt;code&gt;(car (car (cdr (car x))))&lt;/code&gt;, the place it's located in some data structure).  I stumble over my procedural background again!&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;{dot %-1}&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;  match #&lt;pat string&gt;&lt;br /&gt;  (&lt;br /&gt;    null@2 -&gt; null@1 ;&lt;br /&gt;    or@[startmatch match@[1 tl@2]])&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;  startmatch #&lt;pat string&gt;&lt;br /&gt;  (&lt;br /&gt;    or@[null@1 null@2] -&gt;&lt;br /&gt;      null@1   #if the pattern's empty, it's a match&lt;br /&gt;               #otherwise, it's not.&lt;br /&gt;    ;&lt;br /&gt;    #does this character match?&lt;br /&gt;    (atom@1@1 -&gt;&lt;br /&gt;      (or@[&lt;br /&gt;            =@[1@1 dot]&lt;br /&gt;            =@[1@1 1@2]&lt;br /&gt;          ] -&gt; startmatch@[tl@1 tl@2]&lt;br /&gt;          ; =@[%0 %1] #no match, return a fake False&lt;br /&gt;      )&lt;br /&gt;      ; # it's an alternation&lt;br /&gt;      |or@&amp;(startmatch)@distr@[&amp;concat@&amp;([[1] 2])@distr@[1@1 tl@1]  2]&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Doing this with first-class functions would have been more cool, I think.  It should be possible to represent the various syntactic elements of the regex as functions on partial strings that return the set of possible remaining strings.  Hm.  Lazy evaluation would be essential for reasonable performance.  I may have to reconsider my feelings about lazy/eager if I keep on thinking lazily like this.&lt;br /&gt;&lt;br /&gt;It was interesting to see that idea evolve while I was considering it, by the way.  First, I thought of the functions as functions that returned a boolean (for match or not) and a number, for the number of characters consumed.  But multiple return values are a pain, so I figured on some hack like returning null to represent "no match".  I also realized that it'd be more elegant to return a string of characters remaining, as that follows the problem more tightly.  Then I realized that the problem naturally requires not just one continuation but a set of possible continuations, and the empty set is the natural way to represent "no match".&lt;br /&gt;&lt;br /&gt;Anyways, I have to say that the purity of FP expressions makes debugging them easier, which partially compensates for the often infuriating simplicity and lack of features.  It's surprisingly easy to use for being essentially an esoteric language, which I think may partially be Backus's point.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-2974631350414720579?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/2974631350414720579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=2974631350414720579' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/2974631350414720579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/2974631350414720579'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/11/simple-regex-engine.html' title='Simple regex engine'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-1717940318072952176</id><published>2007-11-05T22:29:00.000-05:00</published><updated>2007-11-05T22:35:12.695-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fp'/><title type='text'></title><content type='html'>You know, lazy evaluation would be kind of nice to have.  It means being able to write &lt;code&gt;or&lt;/code&gt;s instead of &lt;code&gt;if&lt;/code&gt;s without having infinite loops and horrible performance characteristics.  Those issues are funny things.  Running time is definitely a side-effect, right?  A truly functional language shouldn't have any, then...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-1717940318072952176?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/1717940318072952176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=1717940318072952176' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1717940318072952176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1717940318072952176'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/11/you-know-lazy-evaluation-would-be-kind.html' title=''/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-654183734524729161</id><published>2007-11-04T23:16:00.000-05:00</published><updated>2007-11-05T22:41:40.669-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fp'/><title type='text'></title><content type='html'>FP still drives me a bit batty.  I want my first class functions back!  Okay, I've never extensively used first-class functions before, but FP feels an awful lot like it had them, and then they were removed.  I was about to blame it on syntax, but I realized that there &lt;i&gt;is&lt;/i&gt; no natural way to apply an object as a function.  However, I would claim that the syntax of functionals is ad-hoc and kinda awkward as a result.&lt;br /&gt;&lt;br /&gt;Nice long chains of function application &lt;code&gt;@&lt;/code&gt; are pretty neat, but there's always a limit to how useful they wind up being, because programs are never linear in any way for long.  Does that make any sense?&lt;br /&gt;&lt;br /&gt;Anyways, I'm currently stumped on a puzzle: how do I take &lt;code&gt;&amp;lt; &amp;lt;a1 a2 a3 ...&gt; b&lt;/code&gt; to &lt;code&gt;&amp;lt; &amp;lt;a1 b&gt; &amp;lt;a2 b&gt; &amp;lt;a3 b&gt; ...&gt;&lt;/code&gt;?  Oh, got it, it's &lt;code&gt;distr&lt;/code&gt;, a function that does exactly that.  I feel that &lt;code&gt;distr&lt;/code&gt; is a sign of trouble though: it's used to mush information around that would be better off with a name.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-654183734524729161?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/654183734524729161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=654183734524729161' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/654183734524729161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/654183734524729161'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/11/fp-still-drives-me-bit-batty.html' title=''/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-226759929639801520</id><published>2007-11-03T12:44:00.000-04:00</published><updated>2007-11-03T13:46:39.282-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gfx'/><category scheme='http://www.blogger.com/atom/ns#' term='fp'/><title type='text'>Shiny gradient!</title><content type='html'>So, I thought it would be a neat idea to make a cover for &lt;i&gt;In Rainbows&lt;/i&gt;, the new Radiohead album that doesn't have an official cover yet.  I figured I could make something neat and rainbow-oriented in FP.  Turns out this was a dumb idea, since I'd mock something up in the Gimp, and then continue mocking at it until it was two hours later and I had a completed image that had nothing to do with FP.  But I finally got my goal, which was a neat rainbow-oriented image to serve as the basis of something.  I had to write a converter from RGB to HSV, which was sort of lame, but I got to use functional programming techniques for pixel-level operations.  I made a grid of number pairs, where the numbers were coordinates, and then mapped gradients over it to create the image, and then mapped the converter across it to get RGB.  I used a Perl script to turn the triplets into a PPM image, which looked like this:  &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_iipz4kJmBUs/RyymYMM0SMI/AAAAAAAAAE8/o2FZX1_A8MY/s1600-h/fp_gfx.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_iipz4kJmBUs/RyymYMM0SMI/AAAAAAAAAE8/o2FZX1_A8MY/s400/fp_gfx.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5128657010190207170" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After some fiddling in the Gimp, I got this:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_iipz4kJmBUs/RyyySMM0SNI/AAAAAAAAAFE/cFT6B0Mb7P0/s1600-h/inrainbows5.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_iipz4kJmBUs/RyyySMM0SNI/AAAAAAAAAFE/cFT6B0Mb7P0/s320/inrainbows5.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5128670101250525394" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The source code, which is pretty short, if dense.  It'd be shorter still if my implementation had &lt;code&gt;abs&lt;/code&gt; or a properly-working &lt;code&gt;mod&lt;/code&gt;:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;{      &lt;br /&gt;  grid&lt;br /&gt;  &amp;(distl@[1 iota@2])@distr@[iota id]&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;  abs&lt;br /&gt;  (&gt;@[1 2] -&gt; - ; -@[2 1])&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;  ipqtv  #intermediate numbers for hsv-to-rgb conversion&lt;br /&gt;  [&lt;br /&gt;    +@[mod@[1 %6] %1]&lt;br /&gt;    *@[4 -@[%1 3]]&lt;br /&gt;    *@[4 -@[%1 *@[3 2]]]&lt;br /&gt;    *@[4 -@[%1 *@[3 -@[%1 2]]]]&lt;br /&gt;    4&lt;br /&gt;  ] @ [2 -@[/@[1 %60] 2] 3 4] @ [1 div@[1 %60] 2 3]&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;{&lt;br /&gt;  rgb&lt;br /&gt;  (=@[2 %0] -&gt; [%0 %0 %0] ;&lt;br /&gt;    pick@[ 1 [&lt;br /&gt;      [5 4 2]&lt;br /&gt;      [3 5 2]&lt;br /&gt;      [2 5 4]&lt;br /&gt;      [2 3 5]&lt;br /&gt;      [4 2 5]&lt;br /&gt;      [5 2 3]&lt;br /&gt;    ]]@ipqtv&lt;br /&gt;  )&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;  gradient&lt;br /&gt;  +@[ +@[*@[1@1 2] *@[2@1 3]] 4]&lt;br /&gt;  #+@[1@1 2@1]&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;  genmod  #mod that works on non-integers.  Slow.&lt;br /&gt;  1@(while &lt;@[1 %0] [+@[1 2] 2])@(while &gt;@[1 2] [-@[1 2] 2])&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;  bump&lt;br /&gt;  -@[%1 *@[id id]@-@[%1 id]]&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;(&amp;(rgb@[&lt;br /&gt;  #hue:&lt;br /&gt;  gradient@[[1 2] %3 %4 %180]&lt;br /&gt;  #saturation:&lt;br /&gt;  bump@genmod@[gradient@[[1 2] /@[%3.3 %360] /@[%4.4 %360] %0] %1.0]&lt;br /&gt;  #value:&lt;br /&gt;  %1.0&lt;br /&gt;  ] ))@grid:800&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-226759929639801520?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/226759929639801520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=226759929639801520' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/226759929639801520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/226759929639801520'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/11/shiny-gradient.html' title='Shiny gradient!'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_iipz4kJmBUs/RyymYMM0SMI/AAAAAAAAAE8/o2FZX1_A8MY/s72-c/fp_gfx.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-448420462486404443</id><published>2007-10-29T19:41:00.000-04:00</published><updated>2007-10-29T20:39:48.107-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fp'/><title type='text'>Square root in FP</title><content type='html'>My implementation of FP doesn't have a square root function (and I need one for TPK), so I cribbed an algorithm from somewhere and got the following:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;{&lt;br /&gt;  abs&lt;br /&gt;  (&gt;@[id %0] -&gt; id ; -@[%0 id])&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;  sqrt  #by Newton's Method&lt;br /&gt;  2@(while &gt;@[abs@-@[2 3] %0.01]&lt;br /&gt;    [1 *@[%0.5 +@[2 /@[1 2]]] 2]&lt;br /&gt;  )@[id id %0]&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It's short, but obtuse.  It turns that the funky functional &lt;tt&gt;while&lt;/tt&gt; isn't bad, once you start thinking about lists as the wads of state that you carry around.  I wonder if there's another way to look at it, a way that isn't so ... imperative.&lt;br /&gt;&lt;br /&gt;Distinguishing between &lt;tt&gt;2&lt;/tt&gt;, the second parameter, and &lt;tt&gt;%2&lt;/tt&gt;, the number is a pain.  As is the special case of 1-parameter functions.  But at least the resulting code is nice and short.  And the functional style of testing a program, breaking it in to bits and testing each bit, is pretty neat.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-448420462486404443?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/448420462486404443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=448420462486404443' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/448420462486404443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/448420462486404443'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/square-root-in-fp.html' title='Square root in FP'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-4109363783312615363</id><published>2007-10-28T21:56:00.000-04:00</published><updated>2007-10-29T21:05:48.584-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fp'/><category scheme='http://www.blogger.com/atom/ns#' term='tpk'/><title type='text'>TPK complete in FP</title><content type='html'>&lt;pre&gt;&lt;br /&gt;{&lt;br /&gt;  abs&lt;br /&gt;  (&gt;@[id %0] -&gt; id ; -@[%0 id])&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;  sqrt  #by Newton's Method&lt;br /&gt;  2@(while &gt;@[abs@-@[2 3] %0.0001]&lt;br /&gt;    [1 *@[%0.5 +@[2 /@[1 2]]] 2]&lt;br /&gt;  )@[id id %0]&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;  f&lt;br /&gt;  +@[sqrt@abs |*@[%5 id id id]]&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;([1 (&gt;@[2 %400] -&gt; %0 ; 2)])@&lt;br /&gt;&amp;([1 f@2])@reverse@&amp;([id *@[id %0.45]])@iota:11&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It's sort of TPK, anyhow.  I don't have a properly working input, so I just take the index multiplied by 0.45.  And, instead of printing "TOO LARGE", it just emits 0, since it doesn't have strings.  But it's surprisingly easy to write, once you get the hang of it, and the motivation.  I sure wouldn't want to come back and debug these programs after a week, though.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-4109363783312615363?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/4109363783312615363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=4109363783312615363' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/4109363783312615363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/4109363783312615363'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/tpk-complete-in-fp.html' title='TPK complete in FP'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-86274198430060162</id><published>2007-10-27T20:05:00.000-04:00</published><updated>2007-10-27T20:10:20.486-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fp'/><title type='text'></title><content type='html'>Here are a few little tidbits of FP:&lt;br /&gt;&lt;br /&gt;Construct a list of the results of the four basic operations, applied to two numbers. &lt;code&gt;[- + * /] : &lt;6&gt;&lt;/code&gt; → &lt;code&gt;&lt;-1 13 42 0.857142857&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;code&gt;iota&lt;/code&gt; constructs lists from 1 to the parameter: &lt;code&gt;iota:5&lt;/code&gt; → &lt;code&gt;&lt;1&gt;&lt;br /&gt;&lt;/code&gt;I suspect that map (spelt &lt;code&gt;&amp;amp;&lt;/code&gt;) will be very useful with it:&lt;code&gt; &amp;amp;(%1)@iota:9&lt;/code&gt; → &lt;code&gt;&lt;1&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;I want a function that creates a 2D array of coordinate pairs.  It looks like &lt;code&gt;dist&lt;span style="font-family: georgia;"&gt;[&lt;/span&gt;lr&lt;span style="font-family: georgia;"&gt;]&lt;/span&gt;&lt;/code&gt; is pretty useful: &lt;code&gt;distl@[%42 iota]:5&lt;/code&gt; → &lt;code&gt;&lt;&lt;42&gt; &lt;42&gt; &lt;42&gt; &lt;42&gt; &lt;42&gt;&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Okay, I've got it:&lt;code&gt; &amp;amp;(distl@[1 iota@2]@[id %5])@iota:5&lt;/code&gt; gives me a 5 by 5 array of coordinates.  The interpreter I'm using is a little buggy -- that was giving me incorrect results.&lt;br /&gt;&lt;br /&gt;But that needs to be generalized:&lt;code&gt; &amp;amp;(distl@[1 iota@2])@distr@[iota id]:5&lt;/code&gt; &lt;br /&gt;It turns out that generalizing got rid of that ugly double&lt;code&gt;@[]&lt;/code&gt;, but required an extra &lt;code&gt;distl&lt;/code&gt;, which is an unnecessary performance cost.  Programming without using names feels awkward, like I need to manage the shape of all the information I need at any given point.&lt;br /&gt;&lt;br /&gt;And now comes the cool part.  If I want to make the pairs into triplets where the third element is the distance between them, I just tack on &lt;code&gt;&amp;amp;(&amp;amp;([1 2 -]))@&lt;/code&gt; to the front. &lt;br /&gt;&lt;br /&gt;(Oh, I get what &lt;code&gt;[...]&lt;/code&gt; means now; FP applies each function in the brackets to the given arguments, creating a list of the results.  It's like the opposite of a &lt;code&gt;map&lt;/code&gt;.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-86274198430060162?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/86274198430060162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=86274198430060162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/86274198430060162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/86274198430060162'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/here-are-few-little-tidbits-of-fp.html' title=''/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-5280013391191533813</id><published>2007-10-25T18:34:00.001-04:00</published><updated>2007-10-25T18:45:49.698-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fp'/><title type='text'>Reading "Can Programming be Liberated?"</title><content type='html'>Instead of writing code just yet, I've decided to read Backus's paper that introduced FP, &lt;a href='http://portal.acm.org/citation.cfm?id=359579'&gt;&lt;i&gt;Can Programming be Liberated from the von Neumann Style?&lt;/i&gt;&lt;/a&gt;.  He delivers a well-argued (though I would argue, incorrect) deconstruction of von Neumann languages (imperative languages, approximately), claiming that they are entirely accidents of the physical structure of computers, and that functional languages are inherently better suited to representing formal human thought.  What I haven't seen yet is why he favors a compositional approach.  I've seen hints of that: I think that he thinks that parameter names are mental baggage that should be avoided if possible, but I suspect that I'm missing something about the big picture.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-5280013391191533813?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/5280013391191533813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=5280013391191533813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/5280013391191533813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/5280013391191533813'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/reading-can-programming-be-liberated.html' title='Reading &quot;Can Programming be Liberated?&quot;'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-7747585604085289998</id><published>2007-10-23T23:14:00.000-04:00</published><updated>2007-10-23T23:48:50.122-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fp'/><category scheme='http://www.blogger.com/atom/ns#' term='helloworld'/><title type='text'>FP begins</title><content type='html'>&lt;span style="font-weight: bold;"&gt;FP:&lt;/span&gt; 9:13 PM October 23rd, 2007 through 9:13 PM November 8th, 2007&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://lh4.google.com/paul.stansifer/RxVoacwtDTI/AAAAAAAAAEI/mtX9FjBI-6U/fp_stamp.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://lh4.google.com/paul.stansifer/RxVoacwtDTI/AAAAAAAAAEI/mtX9FjBI-6U/fp_stamp.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;tt&gt;id:&amp;lt;104 101 108 108 111 44 32 119 111 114 108 100&amp;gt;&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;And now my madness begins in earnest.  FP is a language that, to the best of my knowledge, has no modern implementation. In fact, the implementation that I'm using does not seem to have actual string literals at all, so I'm using a vector of ASCII.  Why would I choose this language?&lt;br /&gt;&lt;br /&gt;Well, my brother likes it.  Also, I kinda like the drawing I did of a mysterious, brooding John Backus, just daring the foolish coder to program in the von Neumann style.  And FP is really unusual.  As far as I can visualize it, it's like a cross between Forth and Haskell.  Well, maybe Forth and Lazy K.  So it's really hard to imagine what it's like.  Which will make it a learning experience.  But not right now.  I didn't have much time tonight, so TPK is for tomorrow.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-7747585604085289998?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/7747585604085289998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=7747585604085289998' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/7747585604085289998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/7747585604085289998'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/fp-begins.html' title='FP begins'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-5275952956333513147</id><published>2007-10-21T18:10:00.000-04:00</published><updated>2007-10-22T21:02:20.136-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smalltalk'/><title type='text'>Smalltalk retrospective</title><content type='html'>The following are my inexperienced and judgmental feelings about Smalltalk.  Undoubtedly, they would be different if I knew more of the language.  If only I knew how!&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;It's amazing how much matters of syntax are matters of taste.&lt;ul&gt;&lt;li&gt;I really like programming language syntax.  One of the coolest things about Smalltalk, to me, is the function call syntax.  The idea that a method name can be interspersed with its arguments has far-reaching effects: it means that it's easier to have many similar methods that differ in the interpretation of arguments (which, in turn, means that Smalltalkers don't miss having argument overloading), and it also means that method names are sometimes more natural, and 10-argument methods are less confusing.&lt;/li&gt;&lt;li&gt;Also regarding function calls, the message-passing syntax &lt;code&gt;object method: arg&lt;/code&gt; is rather strange in the way it places the colon.  I'm not sure how I feel about it.  Its lightweightness is nice (especially if you're using a 10-argument method), but it feels unbalanced in that it doesn't point out the object of invocation, which I think makes it a bit harder to read and write.  For example, I just looked at the following code and noticed it was incorrect:&lt;pre&gt;target location connectedTo: destination ifTrue: [&lt;br /&gt;&lt;/pre&gt;However, inserting parentheses is a one-time cost, and a nice clean look is worth a lot.&lt;/li&gt;&lt;li&gt;The character syntax (&lt;code&gt;$a&lt;/code&gt; represents the letter 'a') is something I never got used to.  I guess I see character literals as being like string literals, and don't want them escaping out the right side.  I'm not sure that's a real reason to dislike something, though.&lt;/li&gt;&lt;li&gt;&lt;code&gt;;&lt;/code&gt;, the syntax for sending multiple methods to the same object, is an unsung hero.  It's hard to notice using it because it leaves code nice and clean, which is just the way syntactic sugar should be.&lt;/li&gt;&lt;li&gt;I really miss having operator precedence.  But perhaps not as much as I could have.  There's even a sense in which lack of precedence is a good thing — it encourages the programmer to write expressions that can be read from left to right.  Huh.  I never realized that before.  That's kind of cool.  Nonetheless, I will be happy to have my &lt;code&gt;a + b*c&lt;/code&gt; back.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div style="text-align: center;"&gt;&lt;b&gt;Idioms&lt;/b&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;I found myself scattering methods whose name began with "init" all over the place.  I realize that I could have rolled the same functionality into a class method starting with "new", but the init methods would still have to exist, which bothered me. &lt;/li&gt;&lt;li&gt;In Smalltalk, local variables are frequently-used:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;The good news: Lack of explicit variable types means that changing your mind about how you're going to use a variable is easy.&lt;/li&gt;&lt;li&gt;The bad news: there's no way to declare and initialize a variable in one statement.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;div style="text-align: center;"&gt;&lt;b&gt;Blocks&lt;/b&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Having real blocks is really nice.  On the other hand, I'm really missing &lt;code&gt;break&lt;/code&gt; and &lt;code&gt;continue&lt;/code&gt;.  Perhaps the solution is to write utility iterators like &lt;code&gt;findFirst:&lt;/code&gt;?  As an aside, why is it that I never actually wind up writing things like that that would make my life easier?  &lt;/li&gt;&lt;li&gt;At first I was confused about the meaning of &lt;code&gt;^&lt;/code&gt; — did it return from the current block or the current method?  It turns out that returning from the current method is almost always what you want.  But at some level, it feels inelegant.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div style="text-align: center;"&gt;&lt;b&gt;Expressions versus statements&lt;/b&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;The dicotomy between side-effects and return values has been on my mind lately. Return values are less important in Smalltalk than side-effects, and it shows in the syntax.  I'm afraid that my prexisting radical views, that side-effecting procedures and value-returning functions should be totally separated and have different syntaxes, are unchanged.  This is no less a problem in ... well, any other language that has both statements and expressions, so I should probably stop worrying about it so much.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Dynamic types&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;I surprised myself with how often I wound up changing the type of a variable I had already named.  With a good debugger, the lack of compile-time typechecking is usually not much of a problem.  Also, Squeaks compile-time pop-up indicating that a method name does not exist globally is surprisingly useful: no matter how bad namespace pollution gets, there will probably never be a method named &lt;code&gt;asStirng&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;Still, I have a soft spot for static types.  (hm, that seems like the wrong turn of phrase; it's dynamic types that feel soft)  Most of the time, anyhow, the compiler can tell you what type something is, so I'd appreciate it trying.&lt;/li&gt;&lt;li&gt;I ran into a number of OO dilemmas, where I found myself trying to decide whether a particular kind of state was best represented with a symbolically-valued variable or a new class.  Those problems are just difficult!  It'd be nice if there were more of a continuum between the two options.&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Overall thoughts&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;Smalltalk did feel a little old to my fingers: the overall lack of syntax bothered me some.  I guess that's something of a matter of taste.  The tools available were very impressive, even if I wound up denying myself access to them because I couldn't stand using my mouse to navigate between methods.  (It occurs to me that part of the reason was perhaps that I often use a graphics tablet for mousing, which has a very high time cost associated with switching between mouse and keyboard.  (You know what would be neat?  A tablet which had little robotic arms that pick up the stylus when you drop it on the tablet, and hold it upright until you grab it again.))&lt;br /&gt;&lt;br /&gt;I can see why a thriving Smalltalk community exists.  For certain tasks (say&lt;a href="http://16languages.blogspot.com/2007/10/stupid-simulation.html"&gt; graphically-oriented simulations&lt;/a&gt;), Smalltalk really welcomes designing and fiddling and tinkering.  And the way the design of the language cooperates with reflective tools is amazing to behold.  I suspect I'll be wanting to have that debugger back for some time to come.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-5275952956333513147?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/5275952956333513147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=5275952956333513147' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/5275952956333513147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/5275952956333513147'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/smalltalk-retrospective.html' title='Smalltalk retrospective'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-3192817983897270272</id><published>2007-10-18T23:06:00.000-04:00</published><updated>2007-10-21T14:14:13.058-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='meta'/><title type='text'>One language down: postmortem</title><content type='html'>"A language that doesn't affect the way you think about programming, is not worth knowing"  —Adam Perlis&lt;br /&gt;&lt;br /&gt;So, now I know Smalltalk!  Or, in a sense, I can use Smalltalk.  I haven't yet touched exceptions, or continuations, or designed any particularly large systems.  However, I would dare to say that I've allowed it to change the way I think about programming, at least a little (a post discussing exactly in what way this happened will follow later).&lt;br /&gt;&lt;br /&gt;Thanks to online resources, and some helpful comments, I was usually able to grasp the concepts I needed reasonably quickly.  What I really missed from having personal instruction was the ability to have someone criticize my style, point out idioms that I miss, or tell me to throw out my Java-addled design and build something that fits my medium better.  Sometimes I was able to do that to myself, though:  it's often possible to guess that that I'm not doing something right, and sometimes a moment's reflection will suggest a better way to do things.  Other times, I'm not so sure.&lt;br /&gt;&lt;br /&gt;People who stopped by and left notes, especially Paolo Bonzini, the maintainer of GNU Smalltalk, were a big help.  As is my brother who's currently working on a Haskell implementation of FP, since the language simply does not have a modern implementation.&lt;br /&gt;&lt;br /&gt;Sixteen days sounds like a longer time than it turns out to be.  Between getting stuck on little things (like how to take a substring!), having other things to do, going back and rewriting things that were really lousy the first time, I didn't get too much implementation done.  However, I think it may be just the right amount of time for a self-driven project like this.  If I were to continue much further, I might risk ingraining my own misunderstandings of the language.  Nonetheless, I've started to notice the absence of Smalltalk in my day job.  Some of it is just wanting to use a period instead of using a semicolon at the end of statements, but some of it is the different attitude towards variable typing, and how much cooler debugging in Smalltalk is, as opposed to using &lt;span style="font-family:courier new;"&gt;gdb&lt;/span&gt;.  Typing has already given (and I suspect it will continue to give) me much to mull over.  I had to reread &lt;a href="http://cdsmith.twu.net/types.html"&gt;this essay about type systems&lt;/a&gt;, which is definitely worth rereading.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-3192817983897270272?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/3192817983897270272/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=3192817983897270272' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/3192817983897270272'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/3192817983897270272'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/one-language-down-postmortem.html' title='One language down: postmortem'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-8106469415709621164</id><published>2007-10-16T21:17:00.000-04:00</published><updated>2007-10-16T21:35:43.063-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smalltalk'/><title type='text'>Done with Smalltalk.</title><content type='html'>As of 9:13 PM, my proscribed period for learning Smalltalk is over.  After a one-week break, I'll be attacking &lt;a href="http://en.wikipedia.org/wiki/FP_programming_language"&gt;FP&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I was intending to complete some other part-of-a-project before finishing, but I kept on flipping back and forth between things I figured I didn't have enough time left to complete (stupid! stupid!), so I wound up converting the code generator for POV-Ray to use strings rather than write to the Transcript, for modularity reasons. So I didn't complete any part of the grand cross-language game that I had been thinking about.  (Partially, this reflects the fact that I'd realized that I don't have much of an overall plan for it.  I had some neat components, though, that I'd still like to try to fit into something.)  The conversion isn't complete -- I'll have to debug it later.&lt;br /&gt;&lt;br /&gt;Coming up later:  final thoughts on Smalltalk, and thoughts on the learning process itself.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-8106469415709621164?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/8106469415709621164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=8106469415709621164' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/8106469415709621164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/8106469415709621164'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/done-with-smalltalk.html' title='Done with Smalltalk.'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-2123066421562825891</id><published>2007-10-15T22:47:00.000-04:00</published><updated>2007-10-15T22:56:20.305-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smalltalk'/><title type='text'>The clock is ticking down...</title><content type='html'>&lt;ul&gt;&lt;li&gt;Well, I still remember how to work the cycle of procrastination from college.  I won't have too much time tomorrow night, so I need to get everything substantive done tonight.  The good news is that the code generator for POV-Ray seems to be mostly working.  I'll try gradually expanding its scope (it doesn't generate everything: mainly, it's applied around the areas that are kind of weird corner cases in POV-Ray).&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The name for your variables changes depending on how much type information you give.  If something's used as a stack for parsing, but stored as an &lt;tt&gt;OrderedCollection&lt;/tt&gt;, it makes sense to call it &lt;tt&gt;stack&lt;/tt&gt;, sometimes.  Other times, programming in an explicitly-typed language, I've felt like it's stupid to give something a name other than it's type: "I want to reheapify the heap.  The only thing in scope that can be reheapified!"  Maybe I should just break down and use the name &lt;tt&gt;the&lt;/tt&gt; in cases like that.  It seems classier than &lt;tt&gt;theHeap&lt;/tt&gt;.  &lt;/li&gt;&lt;li&gt; I'm now learning XQuery at work.  I wonder how much interference there will be between XQuery and Smalltalk, given that they are basically each other's opposites.&lt;/li&gt;&lt;li&gt; I still haven't gotten used to duck typing, and not having to make type relationships explicit.  It's certainly nice to not have to share implementation to share interface — this seems to need to happen more than one would expect.&lt;/li&gt;&lt;li&gt; I have to admit that 1-based arrays aren't as strange as I had feared.  &lt;/li&gt;&lt;li&gt; This ad-hoc approach to writing a compiler seems to be working suprisingly well, 1/16th the way in.  It's suprisingly easy to say "Oh, I can push that functionality up/down a level."  It remains to be seen how I feel when I write the other sides of these kind of jagged interfaces.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-2123066421562825891?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/2123066421562825891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=2123066421562825891' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/2123066421562825891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/2123066421562825891'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/clock-is-ticking-down.html' title='The clock is ticking down...'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-3800635955592395276</id><published>2007-10-14T13:34:00.000-04:00</published><updated>2007-10-14T13:37:16.255-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smalltalk'/><title type='text'></title><content type='html'>&lt;ul&gt;&lt;li&gt; The parser, slightly cleaned-up and bug-fixed, is at &lt;a href='http://16languages.googlecode.com/svn/smalltalk/PParser.st'&gt;http://16languages.googlecode.com/svn/smalltalk/PParser.st&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt; I'm working on a backend code generator for the &lt;a href="http://en.wikipedia.org/wiki/POV-Ray"&gt;POV-Ray&lt;/a&gt; Scene Description Language.  It's kinda a quirky language, with a lot of constructs representing graphical primitives, and the syntax is kinda complicated in weird ways.  It's actually Turing-complete, by virtue of some preprocessing commands, but it's a little bit bulky to use.  That's the reason for this project in the first place.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; I've never really seen this, writing in accessor-full languages like Java and C++, but I guess it really is true that sometimes you want a method that, for most classes, simply returns a class variable, but for some has a "real" implementation.  Dealing with the POV-Ray SDL, there are gray areas between things that should be expressed as subclasses, and things that should be expressed with instance variables.  &lt;/li&gt;&lt;br /&gt;&lt;li&gt; I randomly ran into &lt;tt&gt;allOwners&lt;/tt&gt;, and thought "What a ridiculous method!"  And then I figured out a use for it: a hackish way to decide whether an item of syntax (in the POV-Ray SDL) was frequently-used, and therefore should be given a name and predefined to save space.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-3800635955592395276?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/3800635955592395276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=3800635955592395276' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/3800635955592395276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/3800635955592395276'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/parser-slightly-cleaned-up-and-bug.html' title=''/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-1199969357049735516</id><published>2007-10-10T00:02:00.000-04:00</published><updated>2007-10-12T01:20:35.989-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smalltalk'/><title type='text'>Parser: finally properly working</title><content type='html'>This entry was accumulated over a long time, so it's a mite disjoint.  Also, I'm playing with the syntax, so I've kinda overused italics.  &lt;br /&gt;&lt;ul&gt;&lt;li&gt; The "deeper" method names in Smalltalk make it easier to make more methods that do similar things differently: i.e. &lt;tt&gt;substring:len:&lt;/tt&gt; vs. &lt;tt&gt;substring:until:&lt;/tt&gt;.&lt;br /&gt;&lt;li&gt; Except that there isn't &lt;i&gt;any&lt;/i&gt; substring in GNU Smalltalk!  The choice of methods is a little maddening, especially since I decided not to use regular expressions for the parsing.  (In fact, this is based on a grammar that I had previously which was parsed entirely by Perl regular expression replacements.&lt;br /&gt;&lt;li&gt; I'm utterly flummoxed by the lack of &lt;tt&gt;substring:&lt;/tt&gt;.  I wound up using &lt;tt&gt;indexOfRegex:from:to:&lt;/tt&gt; to do matching, and changing the syntax to not use any  regex metacharacters.  I think I'm missing something big here.&lt;br /&gt;&lt;li&gt; &lt;tt&gt;copyFrom:to:&lt;/tt&gt; on &lt;tt&gt;SequenceableCollection&lt;/tt&gt; is the substring I was looking for. Arggggh!  It took me sooooo long to figure that out.  &lt;b&gt;Argggh!&lt;/b&gt;&lt;br /&gt;&lt;li&gt; I realized that it was easier to use &lt;tt&gt;copyFrom:&lt;/tt&gt; instead, which has even worse performance implications than what I originally tried.  When I saw that even my little test program incurred a garbage collection, I decided to implement a method that only matches against a substring.  (turns out that such a thing exists: &lt;tt&gt;matchSubCollection:startingAt:&lt;/tt&gt; on &lt;tt&gt;SequenceableCollection&lt;/tt&gt;)&lt;br /&gt;&lt;li&gt; Final score: I was frustrated for a long time by the nonexistence of something that existed and I turned out not to want to use!  If one flaw in my abilities as a programmer stands out above all the others, its my myopic obsession with attacking a problem in only one way.&lt;br /&gt;&lt;li&gt; I have one excuse: I was reluctant to tack on a new message to &lt;tt&gt;SequenceableCollection&lt;/tt&gt; or &lt;tt&gt;String&lt;/tt&gt;, out of resistance to namespace pollution.  It's not a good excuse, I know.&lt;br /&gt;&lt;li&gt; Anyways, I'm finally pretty happy with the parser.  In fact, this entry was written in its syntax and converted with it.  &lt;strike&gt;Except for one strange bug: For the items of syntax that consist of three characters in a row.&lt;/strike&gt; Turns out that &lt;tt&gt;matchSubCollection:startingAt:&lt;/tt&gt; wasn't doing quite what I wanted it to, so I had to rewrite it.  Still kinda myterious.  &lt;br /&gt;&lt;li&gt; &lt;strike&gt;Oh, I guess I could have used &lt;tt&gt;indexOf:startingAt:&lt;/tt&gt; also.&lt;/strike&gt;  Oops, no.  That's the index of an element, not a substring.  I hadn't noticed that such dual meanings could occur (&lt;tt&gt;indexOf:matchCase:startingAt:&lt;/tt&gt; &lt;i&gt;does&lt;/i&gt; operate on substrings, though, demonstrating that, sometimes, coming up with a good name for a method is just hard.&lt;br /&gt;&lt;li&gt; The syntax is as follows (I'm using preformatted text to suppress parsing, 'cause I haven't made any syntax for suppressing it yet.):&lt;/li&gt;&lt;br /&gt;&lt;pre&gt;* bulleted&lt;br /&gt;* list&lt;br /&gt;** nested&lt;br /&gt;*** deeper&lt;br /&gt;*# mixed&lt;br /&gt;*# with&lt;br /&gt;*# numbers&lt;br /&gt;///Italic///, ***Bold***, [=teletype=], -s-strikethrough-s-&lt;br /&gt;///Nesting ***is [=allowed=]***///&lt;br /&gt;Link to Wikipedia article: [[Pet eye remover]]&lt;br /&gt; Start lines with a space &lt;br /&gt; to make them preformatted,&lt;br /&gt;^or a '^' to make a blockquote.&lt;br /&gt;mdash:---  arrows:&lt;-- --&gt; &lt;-&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/ul&gt;Becomes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; bulleted&lt;br /&gt;&lt;li&gt; list&lt;br /&gt;&lt;ul&gt;&lt;li&gt; nested&lt;br /&gt;&lt;ul&gt;&lt;li&gt; deeper&lt;br /&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ol&gt;&lt;li&gt; mixed&lt;br /&gt;&lt;li&gt; with&lt;br /&gt;&lt;li&gt; numbers&lt;br /&gt;&lt;/ol&gt;&lt;/ul&gt;&lt;i&gt;Italic&lt;/i&gt;, &lt;b&gt;Bold&lt;/b&gt;, &lt;tt&gt;teletype&lt;/tt&gt;, &lt;strike&gt;strikethrough&lt;/strike&gt;&lt;br /&gt;&lt;i&gt;Nesting &lt;b&gt;is &lt;tt&gt;allowed&lt;/tt&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;Link to Wikipedia article: &lt;a href="http://en.wikipedia.org/wiki/Pet_eye_remover"&gt;Pet eye remover&lt;/a&gt;&lt;br /&gt;&lt;pre&gt;Start lines with a space &lt;br /&gt;to make them preformatted,&lt;br /&gt;&lt;/pre&gt;&lt;blockquote&gt;or a '^' to make a blockquote.&lt;br /&gt;&lt;/blockquote&gt;mdash:&amp;mdash;  arrows:&amp;larr; &amp;rarr; &amp;harr;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I'm pretty happy with the code I've written for this.  It's a little long, but it's pretty nicely-structured; I should easily be able to add more elements, elements that nest with themselves, sanity checks, different kinds of syntax.  I intend to post the code later.  Turns out there are a couple minor flaws in the HTML it emits, still...&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-1199969357049735516?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/1199969357049735516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=1199969357049735516' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1199969357049735516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1199969357049735516'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/parser-finally-properly-working.html' title='Parser: finally properly working'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-8654079537905515909</id><published>2007-10-08T19:32:00.001-04:00</published><updated>2007-10-08T20:23:14.241-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smalltalk'/><title type='text'>Parser partially completed.</title><content type='html'>&lt;ul&gt;&lt;li&gt;I've found myself creating kind of unreadable logical predicates by the process of accretion. I guess I should get more comfortable with temporaries.&lt;/li&gt;&lt;li&gt;Having your own testing code accumulate at the end of your source file is kind of like having unit tests!  Often the hardest thing about deploying something useful is tricking people into using it...&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Working on the command line has definitely improved my productivity.  I'm writing better code, and faster.  Maybe I'm allergic to the mouse?  Actually, it could be because I use a graphics tablet, so it takes extra time to start and stop mousing.&lt;br /&gt;&lt;br /&gt;Here's the parser so far: it does &lt;tt&gt;pre&lt;/tt&gt;, &lt;tt&gt;blockquote&lt;/tt&gt;, and arbitrarily nests &lt;tt&gt;ul&lt;/tt&gt;s and &lt;tt&gt;ol&lt;/tt&gt;s.  Syntax is like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Normal text&lt;br /&gt; two lines of&lt;br /&gt; preformatted text&lt;br /&gt;* bullet&lt;br /&gt;** nested further&lt;br /&gt;**# nested deeper &lt;br /&gt;**# with numbered&lt;br /&gt;**# list&lt;br /&gt;# starting a new ordered list&lt;br /&gt;^quoted text&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The code for the method that does most of the work:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;tt&gt;parseLine: line&lt;/tt&gt;&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;| first inLists charPosition envTag |&lt;br /&gt;first := line at: 1.&lt;br /&gt;&lt;br /&gt;envTag := self environFromMarker: first.&lt;br /&gt;&lt;br /&gt;envTag = nil ifTrue: [&lt;br /&gt;    curEnv = nil ifFalse: [&lt;br /&gt;        Transcript show:'&amp;lt;/pre&amp;gt;'. curEnv := nil.&lt;br /&gt;    ].&lt;br /&gt;] ifFalse: [&lt;br /&gt;    curEnv = nil ifTrue: [&lt;br /&gt;        Transcript show:'&amp;lt;', envTag ,'&amp;gt;'.&lt;br /&gt;    ] ifFalse: [&lt;br /&gt;        curEnv = envTag ifFalse: [&lt;br /&gt;            Transcript show: '&amp;lt/', &lt;br /&gt;              curEnv, '&amp;lt;&amp;gt;', envTag, '&amp;gt;'.&lt;br /&gt;        ]].&lt;br /&gt;    curEnv := envTag.&lt;br /&gt;&lt;br /&gt;    curEnv = 'pre' ifTrue: [ &lt;br /&gt;        "preformatted text is taken literally"&lt;br /&gt;        Transcript showCr: (line allButFirst).&lt;br /&gt;        ^nil&lt;br /&gt;    ].&lt;br /&gt;].&lt;br /&gt;&lt;br /&gt;inLists := true.&lt;br /&gt;charPosition := 1.&lt;br /&gt;line do: [:char |&lt;br /&gt;    inLists ifTrue: [&lt;br /&gt;        | listType |&lt;br /&gt;        listType := self listFromMarker: char.&lt;br /&gt;        inLists := (listType = nil) not.&lt;br /&gt;&lt;br /&gt;        lists size &lt; charPosition&lt;br /&gt;           or: &lt;br /&gt;        [((lists at: charPosition) = listType) not ]&lt;br /&gt;             ifTrue: [&lt;br /&gt;               "The rest of the symbols (if any) &lt;br /&gt;                are no longer relevant"&lt;br /&gt;               self unwindUntil: charPosition.&lt;br /&gt;        ] .&lt;br /&gt;&lt;br /&gt;        (listType = nil) not &amp; &lt;br /&gt;          (lists size &lt; charPosition) ifTrue: [&lt;br /&gt;            lists add: listType.&lt;br /&gt;            Transcript show: '&lt;', &lt;br /&gt;              (self tagFromList: listType), '&gt;'.&lt;br /&gt;        ].&lt;br /&gt;&lt;br /&gt;        "ending the stack of list symbols?"&lt;br /&gt;        inLists not &amp; (lists size &gt; 0) ifTrue: [&lt;br /&gt;            Transcript show: '&amp;lt;li&gt;'.&lt;br /&gt;        ].&lt;br /&gt;    ].&lt;br /&gt;&lt;br /&gt;    charPosition := charPosition + 1.&lt;br /&gt;    Transcript show: char asString.&lt;br /&gt;].&lt;br /&gt;Transcript cr.&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-8654079537905515909?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/8654079537905515909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=8654079537905515909' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/8654079537905515909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/8654079537905515909'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/ive-found-myself-creating-kind-of.html' title='Parser partially completed.'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-5712035100296149409</id><published>2007-10-07T23:00:00.000-04:00</published><updated>2007-10-07T23:28:37.603-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smalltalk'/><title type='text'>Back to the command line</title><content type='html'>Gone are the pretty colors.  I'm back to fixed-width white text on two black windows.&lt;br /&gt;&lt;br /&gt;I don't have syntax-highlighting, a debugger, or access to any of the fancy runtime-modification features I've admitted are pretty nice, but I can finally think this way.  It seems like my whole weekend-long mental block was not caused by my relationship with Smalltalk, but my relationship with the Browser.  I think it might be an attitude problem, but since my goal is to learn the language, rather than learn the environment, I'll keep my bad attitude for now, since my ability to concentrate has gone way up.&lt;br /&gt;&lt;br /&gt;I'm writing code in Emacs and running it in GNU Smalltalk.  Later, I'll see if I can get "file in" to work in one of the environments and start doing proper debugging, and maybe get syntax highlighting to work.  &lt;a href="http://www.gnu.org/software/smalltalk/manual/html_node/Emacs.html"&gt;Ooh, they explain exactly how to do that&lt;/a&gt;.  Nice.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-5712035100296149409?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/5712035100296149409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=5712035100296149409' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/5712035100296149409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/5712035100296149409'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/back-to-command-line.html' title='Back to the command line'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-1597222498276694721</id><published>2007-10-06T10:53:00.000-04:00</published><updated>2007-10-07T21:55:31.748-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smalltalk'/><title type='text'></title><content type='html'>Currently working on a simple parser to take a barebones ASCII markup and emit HTML.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I've found that it takes surprisingly little rewriting to change a design decision, because of the lack of static type declaration.  This is kind of unintuitive, but I've seen it doing C++ at work.  Why does it so often happen that the type of variable changes, but not its use?  I suppose that in statically-typed OO languages, the excuse is that you're supposed to abstract all the way up to type out only what you care about.&lt;/li&gt;&lt;li&gt;Still, I feel like I'm moving slowly.  "Think twice, code once" is a good rule, but I often feel a little disoriented by Smalltalk's organizational scheme.  On the other hand, I think that this feeling is called "learning" in some circles.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Hm.  I feel like I want to have multiple return values.  Or pass-by-reference for the purpose of modification.  I suspect that I need to rethink my strategy slightly to use more encapsulated state, and less of parameters/return values.&lt;/li&gt;&lt;li&gt;There's something just &lt;span style="font-style: italic;"&gt;wrong&lt;/span&gt; about &lt;span style="font-family:courier new;"&gt;public&lt;/span&gt;/&lt;span style="font-family:courier new;"&gt;private&lt;/span&gt;/&lt;span style="font-family:courier new;"&gt;protected&lt;/span&gt;.  Although I've sometimes wished that I could access instance variables from methods on other objects, I feel that the problem is with me, not with Smalltalk.  In Java and C++, those limitations are tacked on to the language, and so there is no way that they can avoid causing trouble sometimes.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;I keep on changing the format of this page.  Sheesh.  I think it's a good thing I got rid of that rectangle on the right side, though.&lt;/li&gt;&lt;li&gt;I need to remember to save before testing something that could loop infinitely.  Good news: Cmd-period interrupts it in Squeak.  Bad news: lagginess in Squeak, or some UI weirdness makes it really hard to regain control afterwards.  Killing an infinite loop in writing to the Transcript seems to have broken it -- now any attempt to write to it hangs on a semaphore.&lt;/li&gt;&lt;li&gt;I don't like switching between source files.  I think I may just "File out" everything and start working in Emacs.  Possibly related to that:  I don't like writing large quantities of code in Smalltalk.  I think that my avoidance of that is counterproductive -- eventually I give up refactoring because I'm not making progress simplifying things, and look at other stuff for a while.&lt;/li&gt;&lt;li&gt;Delaying typechecking until runtime seems to have the effect of making the type system feel more "real", more connected to the Platonic data structures, in a sense.  It also has the effect of causing you to try an awful lot of arithmetic on booleans.  A weakly-typed, dynamically-typed language would be impossible to debug!  I think.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Hm.  It'd be kind of neat to have a symbol-forming operator called "&lt;span style="font-family:courier new;"&gt;the&lt;/span&gt;": you'd say &lt;span style="font-family:courier new;"&gt;elementType = the sodium&lt;/span&gt;.   Maybe you could use it to force interning of strings and such, too?&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-1597222498276694721?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/1597222498276694721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=1597222498276694721' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1597222498276694721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1597222498276694721'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/currently-working-on-simple-parser-to.html' title=''/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-2615711424207621062</id><published>2007-10-06T01:19:00.000-04:00</published><updated>2007-10-06T01:58:27.045-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smalltalk'/><title type='text'></title><content type='html'>I went to a Jonathan Coulton concert tonight [Those of you who know me: yes, I really went to a concert.  See, I'm getting cultured!], which is why I don't really have anything to show tonight.  But I have been doing a little.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;GNU Smalltalk takes some getting used to, as it's missing some features that Squeak has.  In particular, I miss keyboard shortcuts for "do it" and "save".  I think that there may be such things; I just may not have figured them out yet.  And error messages aren't very clear.  I'll try again with version 2.95d, which I'm compiling right now, after running into a &lt;a href="http://www.nabble.com/issue-while-building-gst-2.95d-on-mac-intel-t4516109.html"&gt;known issue&lt;/a&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Nice things: windows that mingle with my "real" environment.  A language shell on the command line.   A basic library that's small enough to navigate and find stuff in.  (The hierarchical organization helps too, though it's not as important.)  Syntax highlighting.  "File out", which emits a plaintext source file.  The absence of a bajillion menu items.  (Though, to be fair, Squeak would occasionally have just the thing that I wanted in them.)&lt;/li&gt;&lt;/ul&gt;&lt;span class="on" style="display: block;" id="formatbar_CreateLink" title="Link" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"&gt;&lt;/span&gt;&lt;br /&gt;Okay, time for bed!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-2615711424207621062?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/2615711424207621062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=2615711424207621062' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/2615711424207621062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/2615711424207621062'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/i-went-to-jonathan-coulton-concert.html' title=''/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-4803976995016153053</id><published>2007-10-04T22:34:00.000-04:00</published><updated>2007-10-04T23:19:05.210-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gfx'/><category scheme='http://www.blogger.com/atom/ns#' term='smalltalk'/><title type='text'>Stupid simulation!</title><content type='html'>I mean that in a good way.  I've been fiddling around with it even more.  The mechanic of balancing water-to-food-to-cities-to-workers in the geometry of a pixel-based simulation has been neat.  It was also made much easier by the format — since red, green, and blue can overlap each other, there are no obstacles in the simulation.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_iipz4kJmBUs/RwWjrswtDMI/AAAAAAAAACE/F1WN7KJZ0gQ/s1600-h/flatearth.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_iipz4kJmBUs/RwWjrswtDMI/AAAAAAAAACE/F1WN7KJZ0gQ/s400/flatearth.png" alt="" id="BLOGGER_PHOTO_ID_5117676522721578178" border="0" /&gt;&lt;/a&gt;(blue = water, green = farm, red = city.  Workers (not visible) carry water from rivers to establish and irrigate farms, and carry food from farms to establish and feed cities.  Cities can produce more workers.  The simulation runs away into increasing population, since nothing dies.)&lt;br /&gt;&lt;br /&gt;However, the mechanics have been distracting me from learning the language itself.  In fact, I've been neglecting to properly abstract out common elements between, e.g. &lt;tt&gt;Water&lt;/tt&gt;, &lt;tt&gt;Farm&lt;/tt&gt;, and &lt;tt&gt;City&lt;/tt&gt; classes.  I'll need to go back and do that, before I take a look at performance, which is kinda terrible.  I suspect that that's because I'm consuming random numbers all over the place.&lt;br /&gt;&lt;br /&gt;I've found myself strangely reluctant to use the reflection features I have available to me.  I'm not sure why I keep restarting the simulation, when I just need to continue it to see if what I've implemented is working.&lt;br /&gt;&lt;br /&gt;However, they're helping me in subtle ways anyways.  In fact, running the simulation from the Workspace means that I can shuffle harness code around without thinking about it.  And when (as just happened now) I accidentally get the syntax for a Transcript command wrong, I don't have to redo all the simulation that's passed already.  Speaking of that, here's a longer run with a larger field:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_iipz4kJmBUs/RwWrm8wtDNI/AAAAAAAAACM/G59yNIZXLPE/s1600-h/fe1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_iipz4kJmBUs/RwWrm8wtDNI/AAAAAAAAACM/G59yNIZXLPE/s400/fe1.png" alt="" id="BLOGGER_PHOTO_ID_5117685237210221778" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_iipz4kJmBUs/RwWrtswtDOI/AAAAAAAAACU/xtw-xaLwW-g/s1600-h/fe2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_iipz4kJmBUs/RwWrtswtDOI/AAAAAAAAACU/xtw-xaLwW-g/s400/fe2.png" alt="" id="BLOGGER_PHOTO_ID_5117685353174338786" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_iipz4kJmBUs/RwWr08wtDPI/AAAAAAAAACc/SzHHsxfhNqY/s1600-h/fe3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_iipz4kJmBUs/RwWr08wtDPI/AAAAAAAAACc/SzHHsxfhNqY/s400/fe3.png" alt="" id="BLOGGER_PHOTO_ID_5117685477728390386" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_iipz4kJmBUs/RwWsMswtDQI/AAAAAAAAACk/FxwdW29BSX4/s1600-h/fe4.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_iipz4kJmBUs/RwWsMswtDQI/AAAAAAAAACk/FxwdW29BSX4/s400/fe4.png" alt="" id="BLOGGER_PHOTO_ID_5117685885750283522" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_iipz4kJmBUs/RwWsUMwtDRI/AAAAAAAAACs/5-8ZmovH9-U/s1600-h/fe5.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_iipz4kJmBUs/RwWsUMwtDRI/AAAAAAAAACs/5-8ZmovH9-U/s400/fe5.png" alt="" id="BLOGGER_PHOTO_ID_5117686014599302418" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;(somehow the last image got blurred.)&lt;br /&gt;&lt;br /&gt;Anyways, instead of fiddling with this any more, I'll go off and play with a new toy:  GNU Smalltalk, now working on my computer thanks to one helpful maintainer who happened to stop by.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-4803976995016153053?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/4803976995016153053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=4803976995016153053' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/4803976995016153053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/4803976995016153053'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/stupid-simulation.html' title='Stupid simulation!'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_iipz4kJmBUs/RwWjrswtDMI/AAAAAAAAACE/F1WN7KJZ0gQ/s72-c/flatearth.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-3588754388363465656</id><published>2007-10-03T22:51:00.001-04:00</published><updated>2007-10-04T00:12:10.333-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smalltalk'/><title type='text'>Fiddling with my simulation.</title><content type='html'>&lt;ul&gt;&lt;li&gt;All this time, I had been reading "Is it okay to &lt;span style="font-style: italic;"&gt;cancel&lt;/span&gt; these changes?" as "Is it okay to &lt;span style="font-style: italic;"&gt;save&lt;/span&gt; these changes?", and wondering why I kept losing work.  Is there a version of Squeak for people who can't read?&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Well, it's getting late, so here's a screenshot of my current work.  It's an abstract simulation: blue is water, green is farm, and red are workers.  The workers carry water to irrigate farms, and then carry food to (not yet implemented) cities.  (The cities will be red, and the workers invisible, as the point is to make a pretty picture.)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_iipz4kJmBUs/RwRitswtDLI/AAAAAAAAAB8/QPfdTtbEmm4/s1600-h/flatearth.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_iipz4kJmBUs/RwRitswtDLI/AAAAAAAAAB8/QPfdTtbEmm4/s400/flatearth.png" alt="" id="BLOGGER_PHOTO_ID_5117323613848800434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I've been gleefully fiddling around with simulation parameters and algorithms.  I feel that I haven't been using inheritance as much as I should have &amp;mdash; I'll have to go back and refactor soon.  &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;step: world&lt;br /&gt;  water := water + (world blueAt: pos).&lt;br /&gt;  world blueAt: pos put: (world blueAt: pos * 0.8).&lt;br /&gt;&lt;br /&gt;  food := food + (world greenAt: pos).&lt;br /&gt;  world greenAt: pos put: (world greenAt: pos * 0.8).&lt;br /&gt;&lt;br /&gt;  world redAt: pos put: 0.0.&lt;br /&gt;  pos := (pos x + dirx)@(pos y + diry).&lt;br /&gt;  world redAt: pos put: 1.0.&lt;br /&gt;  &lt;br /&gt;  world rnd next &lt; 0.3 &lt;br /&gt;    ifTrue: [dirx := 2-(world rnd nextInt:3). diry := 2-(world rnd nextInt:3).].&lt;br /&gt;&lt;br /&gt;  ((world greenAt: pos) &gt; patience) &lt;br /&gt;    ifTrue: [world irrigate: pos by: water.  water := 0.  patience := 0.5.].&lt;br /&gt;  &lt;br /&gt;  "((world redAt: pos) &gt; patience) &lt;br /&gt;    ifTrue: [world feed: pos by: food.  food := 0. patience := 0.5.]."&lt;br /&gt; &lt;br /&gt;  patience := patience * 0.9.&lt;br /&gt; &lt;br /&gt;  (patience &lt; 0.01) ifTrue: [world plantFarm: pos].&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Hm...  I oughta make planting a farm contingent on having some food...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-3588754388363465656?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/3588754388363465656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=3588754388363465656' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/3588754388363465656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/3588754388363465656'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/fiddling-with-my-simulation.html' title='Fiddling with my simulation.'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_iipz4kJmBUs/RwRitswtDLI/AAAAAAAAAB8/QPfdTtbEmm4/s72-c/flatearth.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-2948287958186859949</id><published>2007-10-03T20:33:00.000-04:00</published><updated>2007-10-03T22:30:10.084-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smalltalk'/><title type='text'>Smalltalk: getting comfortable with Squeak</title><content type='html'>&lt;ul&gt;&lt;li&gt;I think that it'll take too much trouble to make the Worm program that I was working on viable.  There's no good way to keep it from getting stuck in dead ends.  I toyed with making it cross its path only when it had to, and thought I had a good plan, but didn't like how much effort it'd take to implement.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;I've been working from &lt;a href="http://www.squeakbyexample.org/"&gt;Squeak by Example&lt;/a&gt;, thanks to a suggestion from the comments.  I may have to take back the bad things that I said about tutorials, because it's really good so far.&lt;/li&gt;&lt;li&gt;The "Method Finder" is an amazing tool, sort of.  I typed in &lt;span style="font-family: courier new;"&gt;'pop'. 'POP'&lt;/span&gt;, and sure enough, it found &lt;span style="font-family: courier new;"&gt;asUppercase&lt;/span&gt; for me.  Then I tried &lt;span style="font-family: courier new;"&gt;1. 2. 3,&lt;/span&gt; which was a mistake because, I suppose, there are a lot of methods that could be applicable.  And some of them might run arbitrarily long.  I'm still really impressed, though, because it's a really good idea.&lt;/li&gt;&lt;li&gt;Actually, I tried some other arithmetical expressions in Method Finder, and they returned instantly.  Am even more impressed.  There's an argument for extensive static analysis here, though -- it'd be neat to restrict your search to things that were known to terminate in O(n^2) or less, for example.  Of course, that would require reflection, which would totally mess up static analysis.  You could always, after all, just kill the methods after a certain period of time.  Maybe that's what Squeak does, and there's a bug.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Creating methods named &lt;span style="font-family: courier new;"&gt;redAt:&lt;/span&gt;, &lt;span style="font-family: courier new;"&gt;blueAt:&lt;/span&gt;, and &lt;span style="font-family: courier new;"&gt;greenAt:&lt;/span&gt; made me realize that copy-and-paste programming is &lt;span style="font-style: italic;"&gt;harder&lt;/span&gt; with a more mouse-oriented interface.  I have no idea whether that's a good thing or not. &lt;br /&gt;&lt;/li&gt;&lt;li&gt;I am very much a static-types programmer.  I'm used to having my compiler enforce method names and types (Squeak does enforce names at compile-time, but against a global list of method names), which helps prevent a large proportion of errors.  I guess that's why I'm internally resistant to test-driven development: I instinctively think it's not worth it for small tasks.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;I can't be sure of this, but I think that the fact that binary operators (well, methods with operator-like syntax, since "operator" means something special in Smalltalk) have precedence between unary named methods and named methods with arguments is tripping me up.  I have one mental category each for "named" and "symbolized" operations, I guess.&lt;/li&gt;&lt;li&gt;I used to think otherwise, but I think that having to make choices about how to lay out code is possibly a good thing.  In C++, e.g., indenting and spacing is more or less mechanizable.  But getting to reshape code allows one to change what aspects are emphasized.&lt;/li&gt;&lt;li&gt;Repairing code while it runs = sweet.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-2948287958186859949?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/2948287958186859949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=2948287958186859949' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/2948287958186859949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/2948287958186859949'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/smalltalk-getting-comfortable-with.html' title='Smalltalk: getting comfortable with Squeak'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-4973662552981469597</id><published>2007-10-03T09:36:00.000-04:00</published><updated>2007-10-03T22:31:16.484-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smalltalk'/><title type='text'></title><content type='html'>I didn't have much time for Smalltalk last night, but I spent more than I really should have before work this morning.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_iipz4kJmBUs/RwObE8wtDKI/AAAAAAAAAB0/l6J7l71AjYQ/s1600-h/worm1.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; cursor: pointer;" src="http://bp1.blogger.com/_iipz4kJmBUs/RwObE8wtDKI/AAAAAAAAAB0/l6J7l71AjYQ/s320/worm1.png" alt="" id="BLOGGER_PHOTO_ID_5117104110955203746" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I guess that's a good sign.  Code to follow.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-4973662552981469597?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/4973662552981469597/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=4973662552981469597' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/4973662552981469597'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/4973662552981469597'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/i-didnt-have-much-time-for-smalltalk.html' title=''/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_iipz4kJmBUs/RwObE8wtDKI/AAAAAAAAAB0/l6J7l71AjYQ/s72-c/worm1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-4879981010765201030</id><published>2007-10-01T23:33:00.000-04:00</published><updated>2007-10-02T00:11:23.471-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smalltalk'/><title type='text'></title><content type='html'>I searched the Web for an implementation of TPK in Smalltalk.  Results: everybody else has more sense than me, and hasn't done it.  I feel a little bit better about my version now, even though I haven't found a way to substantively improve it.&lt;br /&gt;&lt;br /&gt;Working from &lt;a href='http://squeak.preeminent.org/tut2007/html/index.html'&gt;A Development Example for Squeak 3.9&lt;/a&gt;, I've started in on little graphics project, this time, properly creating methods in the Browser.  Outline of the project: a worm moves forward, turning more and more tightly, until it it's about to collide with itself, when it starts to follow itself for a while more before turning.  Continue until stuck in a dead end.&lt;br /&gt;&lt;br /&gt;There are still a few things I have no idea about, like how to create a constructor (it's a class method, I think, but the browser warns me against overwriting the existing &lt;tt&gt;new&lt;/tt&gt;).&lt;br /&gt;&lt;br /&gt;I'm also learning about the benefits of face-to-face teaching here.  In a classroom, the students can deliver subtle cues about how fast the material is going, and ask questions to fill in the gaps.  Without any kind of feedback, the author of a tutorial has to decide whether to cover everything, and move really slowly, or to move at a normal pace, and leave people confused.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-4879981010765201030?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/4879981010765201030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=4879981010765201030' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/4879981010765201030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/4879981010765201030'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/i-searched-web-for-implementation-of.html' title=''/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-1512945144638421432</id><published>2007-10-01T18:50:00.000-04:00</published><updated>2007-10-01T21:23:06.618-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smalltalk'/><category scheme='http://www.blogger.com/atom/ns#' term='tpk'/><title type='text'>Smalltalk: TPK, round 2</title><content type='html'>&lt;ul&gt;&lt;li&gt;Reading deeper into "Smalltalk: Getting the Message", which gets more exciting later on, I discovered that, without side-effects, you usually use &lt;tt&gt;map&lt;/tt&gt; to edit collections, or, as Smalltalk calls it, &lt;tt&gt;collect&lt;/tt&gt;.&lt;/li&gt;&lt;li&gt;The same source has a very important point that explains why I was having such trouble defining &lt;tt&gt;f&lt;/tt&gt;:  &lt;blockquote&gt;Each &lt;i&gt;method declaration&lt;/i&gt; is an independent compilation unit; there is no standard syntax for declaring a sequence of methods, so that the text of one method may be syntactically distinguished from that of one that precedes or follows it. Above the level of individual methods, Smalltalk programs are defined by dynamic, &lt;i&gt;living&lt;/i&gt; objects—and not by static statements residing in flat text files.&lt;/blockquote&gt;&lt;br /&gt;Now, graphical languages are just bad.  But Smalltalk isn't bad.  Therefore, it's not the ability to use &lt;tt&gt;grep&lt;/tt&gt; to search source files, or the filesystem to organize them that's important.  Maybe it's got something to do with the power of text to represent (in an easily editable form) hierarchical structures.  Possibly it has something to do with the brain's amazing ability to deal with that kind of structure in a linear form.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Smalltalk shows some of the TPK algorithm's bias:  since &lt;tt&gt;f&lt;/tt&gt; is really just arbitrary, it's not meaningful to attach it to Number.  Smalltalk encourages you to carefully contemplate the context in which a method is meaningful.  On the other hand, there are some times when the system seems to break down — &lt;tt&gt;timesRepeat&lt;/tt&gt; seems to be attached to &lt;tt&gt;Integer&lt;/tt&gt; rather than &lt;tt&gt;BlockContext&lt;/tt&gt; because it's more natural to write it that way.&lt;/li&gt;&lt;li&gt;The Blogger editor is a pain to use if you want a lot of fixed-width or preformatted text, or em dashes, a favorite punctuation of mine.  Project for the future: write a wiki-like-markup-to-HTML converter.  Yeah, such things exist already.&lt;/li&gt;&lt;li&gt;The inline error-as-selected-text thing that Squeak does is neat and easy-to-use.  Also, it works inside the string passed to &lt;tt&gt;compile:&lt;/tt&gt;!.  Disconcerting, though, and it might become problematic when one needs to keep the error around while editing.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Alright, here's another TPK:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;TPK compile:&lt;br /&gt;'f: x  "answer an arbitrary demo function"&lt;br /&gt;  ^ x abs sqrt + (5 * (x raisedToInteger: 3))'&lt;br /&gt;classified: #math.&lt;br /&gt;&lt;br /&gt;TPK compile:&lt;br /&gt;'go  "execute the TPK algorithm"&lt;br /&gt;|inp result|&lt;br /&gt;11 timesRepeat: [&lt;br /&gt;  self add: ((FillInTheBlank request: ''Number:'')&lt;br /&gt;               asNumber).].&lt;br /&gt;11 to: 1 by: -1 do:&lt;br /&gt;  [:idx |&lt;br /&gt;    inp := self at: idx.&lt;br /&gt;    result := self f: inp.&lt;br /&gt;    Transcript cr; show: inp; show: $ .&lt;br /&gt;    result &gt; 400&lt;br /&gt;      ifTrue: [Transcript show: ''TOO LARGE''.]&lt;br /&gt;      ifFalse: [Transcript show: result.].&lt;br /&gt;  ].'&lt;br /&gt;classified: #demo.&lt;br /&gt;&lt;br /&gt;TPK new go.&lt;br /&gt;&lt;/pre&gt;It's all in strings, 'cause I still haven't figured out the proper way to add methods to a class.  Of course, I forgot about escaping the inner strings, and that was most of my troubles.  I feel like this solution is a bit Java-y.  I'll try to do better after dinner.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-1512945144638421432?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/1512945144638421432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=1512945144638421432' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1512945144638421432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/1512945144638421432'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/10/smalltalk-tpk-round-2.html' title='Smalltalk: TPK, round 2'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-2122070246581866578</id><published>2007-09-30T20:32:00.000-04:00</published><updated>2007-10-01T00:08:13.819-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smalltalk'/><category scheme='http://www.blogger.com/atom/ns#' term='tpk'/><category scheme='http://www.blogger.com/atom/ns#' term='helloworld'/><title type='text'>Smalltalk begins</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Smalltalk: &lt;/span&gt;&lt;span&gt;9:13 PM &lt;/span&gt;&lt;span&gt;September 30th, 2007  through 9:13 PM October 16th, 2007&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_iipz4kJmBUs/RwBtMcwtDJI/AAAAAAAAABs/d3Tcdxd28vo/s1600-h/smalltalk.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp0.blogger.com/_iipz4kJmBUs/RwBtMcwtDJI/AAAAAAAAABs/d3Tcdxd28vo/s320/smalltalk.png" alt="" id="BLOGGER_PHOTO_ID_5116209237339212946" border="0" /&gt;&lt;/a&gt;&lt;pre&gt;Transcript show:'hello world'.&lt;br /&gt;Transcript cr.&lt;br /&gt;&lt;/pre&gt;Smalltalk's Hello World is unique.  In most languages, the task is to emit the string "hello, world" on standard output.  In most Smalltalk implementations, there is no such thing, because Smalltalk is not intended for interoperability with the Unix shell or with other programming languages.  Traditional Smalltalk programs are GUI applications, embedded in a complete environment.  Although this is kinda a pain, it also is related to the very powerful reflection features Smalltalk has: it's incredibly simple to tear off the covers of a running Smalltalk program and start tinkering.&lt;br /&gt;&lt;br /&gt;I've had some experience with Smalltalk, but I've forgotten most of it.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Having a read-eval-print loop is great if you're trying to puzzle out syntax stuff.  Also, "inspect" is neat, and a good sanity check sometimes.&lt;/li&gt;&lt;li&gt;There's arbitrary-precision math by default.  There's a surprising downside to this: I can't (easily) use the REPL as a calculator, because &lt;tt&gt;Transcript show:16/7&lt;/tt&gt; emits &lt;tt&gt;(16/7)&lt;/tt&gt;.  Of course, it's possible just to change the default textual form.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;There isn't font antialiasing.  My beginner mess in the "Workspace" window is all the sadder-looking, and harder to read.&lt;/li&gt;&lt;li&gt;The concept of a "symbol" is still rolling off my head.  It appears to be similar to, but more complicated than a symbol in Lisp.  I created an array, and printed it, and it came out with a &lt;tt&gt;#&lt;/tt&gt; in front of it.  Does that mean something?&lt;/li&gt;&lt;li&gt;I keep on messing up the syntax.  I guess it's just my C++ training that puts punctuation in different parts of a method call.  I guess it's the absence of any symbol between the recipient and the method selector that trips me up.&lt;/li&gt;&lt;li&gt;Iteration is called "do".  It strikes me as a little weak for a name, but it &lt;span style="font-style: italic;"&gt;is&lt;/span&gt; a really basic operation.&lt;/li&gt;&lt;li&gt;Dang.  The block in-parameter created in iteration is an l-value, but not for the actual array element.  I guess that you can't do that in Smalltalk.  Hm.  That's a useful idiom, but how does one make it work in side-effect-skimpy languages?&lt;/li&gt;&lt;li&gt;I &lt;span style="font-style: italic;"&gt;watched&lt;/span&gt; Squeak progress over an 11 element array, writing out each element.  That's slow.  I suppose it must be an I/O refresh thing, because the user interface would be molasses otherwise.&lt;/li&gt;&lt;li&gt;It's strange to have the methods like &lt;tt&gt;String decodeMimeHeader.&lt;/tt&gt;  It makes sense, though, because Smalltalk doesn't really have source code files corresponding to the methods in a class.&lt;/li&gt;&lt;li&gt;Wait, Smalltalk &lt;span style="font-style: italic;"&gt;doesn't have source code files&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;"Workspace" is a text editor, in which you can select lines, and tell Squeak to execute them.  The natural thing to do, usually, is to keep on entering commands, and keep it as a log, but you can get revisionist real fast.  This is good and bad.&lt;/li&gt;&lt;li&gt;I have a hard time anticipating where parens are going to be needed.  I wonder whether that ever becomes natural.  I can believe that Lisp gets easier, but Smalltalk syntax rules?  That's crazy.&lt;/li&gt;&lt;li&gt;I had joked to my brother that there was such a thing as dynamic explicit typing: whenever the runtime needs to know the type of something, it emails the programmer.  Well, when Squeak gets a runtime error, it asks the user if they'd like to fix the problem.  All programs are dynamically correct, even if they are statically incorrect!  For certain values of "user".&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Developing code, it's really nice to select a block of text and see what happens when you execute it.&lt;/li&gt;&lt;li&gt;Dude, my dad's page is the first hit in Google for "TPK algorithm".&lt;/li&gt;&lt;li&gt;You can create an anonymous block with one parameter, but how do you use it?  Is it necessary to attach it to the class hierarchy?&lt;/li&gt;&lt;li&gt;"Exit Music (For A Film)" is such a good track.&lt;/li&gt;&lt;li&gt;Got it.  The block (a &lt;tt&gt;BlockContext&lt;/tt&gt;) needs to be sent the message value in order to get it to evaluate.  There are versions of it value for up to four arguments.  Ugh!  This is what I get for not making it part of the class hierarchy.&lt;/li&gt;&lt;li&gt;Dang.  Got burned by lack of operator precedence already.  That's a feature that's easy to attempt to use without realizing it.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Thank goodness.  It's possible to copy/paste out of Squeak.  I'm done with TPK.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;f := [:x | (x abs sqrt) + (5 * (x raisedToInteger: 3))].&lt;br /&gt;&lt;br /&gt;ar := Array new: 11.&lt;br /&gt;1 to: 11 do: [:i |&lt;br /&gt;  ar at: i put: ((FillInTheBlank request:'Number:') asNumber).].&lt;br /&gt;11 to: 1 by: -1 do: [:i |&lt;br /&gt;  val := f value: (ar at: i).&lt;br /&gt;  val &gt; 400&lt;br /&gt;  ifTrue: [ Transcript show: (ar at: i); show: ' TOO LARGE'; cr.]&lt;br /&gt;  ifFalse: [ Transcript show: (ar at: i); show: $ ; show: val; cr.]&lt;br /&gt;]&lt;br /&gt;&lt;/pre&gt;It's really unidiomatic.  I made the usual mistakes regarding array indices as a result.  There's also got to be a better way to define &lt;tt&gt;f&lt;/tt&gt;.  I'm not sure what the &lt;span style="font-style: italic;"&gt;right&lt;/span&gt; approach is — should it be attached to &lt;tt&gt;Number&lt;/tt&gt;?  Thanks to the "inspect" command, I think it's possible to just compile it and tack it onto the method dictionary, but that's just ugly, even ignoring the namespace pollution.&lt;br /&gt;&lt;br /&gt;Bedtime now.  A better TPK tomorrow, hopefully.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Resources consulted:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.chronos-st.org/Smalltalk-Getting-the-Message.html"&gt;Smalltalk: Getting the Message&lt;/a&gt; (Rather slow-moving and involved, going too deep into history too early for my tastes.)&lt;/li&gt;&lt;li&gt;&lt;a href="http://daitanmarks.sourceforge.net/or/squeak/squeak_tutorial.html"&gt;SmallTalk Tutorial for Java Programmers&lt;/a&gt; (About as amateurish as it sounds: among other things, it claims that Smalltalk doesn't have types.  Still useful, though.)&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cs.oswego.edu/%7Eodendahl/manuals/smalltalk/tutorial/"&gt;GNU Smalltalk Tutorial&lt;/a&gt; (Sadly, I can't get GNU Smalltalk to build, so I don't get to use standard in and standard out.)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-2122070246581866578?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/2122070246581866578/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=2122070246581866578' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/2122070246581866578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/2122070246581866578'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/09/smalltalk-begins.html' title='Smalltalk begins'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_iipz4kJmBUs/RwBtMcwtDJI/AAAAAAAAABs/d3Tcdxd28vo/s72-c/smalltalk.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8981740280837861615.post-145531694743510738</id><published>2007-09-25T23:41:00.000-04:00</published><updated>2007-09-28T22:56:33.613-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='meta'/><title type='text'>The rules</title><content type='html'>The purpose of this journal is mainly to record my thoughts and keep myself honest.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; Languages&lt;/span&gt;&lt;br /&gt;I've chosen a set of 16 programming languages. Most are general-purpose languages which are well-liked by their respective communities. Some are more specialized, restrictive, or disliked. Two are abstract esoteric languages, impractical for ... well, anything.&lt;br /&gt;&lt;br /&gt;In the partially-random order I will visit them, the languages are: Smalltalk, FP, Ada, Python, OCaml, BrainF***, i86 assembly, Prolog, Erlang, Forth, D, Lazy K, Haskell, FORTRAN, Lua, and Scheme.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Time&lt;/span&gt;&lt;br /&gt;For each language: 16 days&lt;br /&gt;Break between languages: 7 days&lt;br /&gt;Total time: 361 days&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Learning&lt;/span&gt;&lt;br /&gt;Learning a language, (or learning almost anything, really) is a continuous process. In 16 days, it'll be hard for me to say that I really &lt;span style="font-style: italic;"&gt;know&lt;/span&gt; most of the languages in question. And what counts as the language is itself debatable -- it's possible to learn all the syntax and semantics of Scheme in one day, but that doesn't really seem to count. And on the other end of things, I'm not sure if &lt;span style="font-style: italic;"&gt;anyone&lt;/span&gt; really knows all of C++. So my goal is to be familiar enough with the language that it is no longer alien to me. I want to visit, see the sights, and do as the natives do for long enough that I can sympathize with their point of view.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Tasks&lt;/span&gt;&lt;br /&gt;For each language, I have to write a Hello, World program, implement the TPK algorithm, and do some kind of graphics hack. For a couple of the languages, that alone might take a significant portion of the 16 days, and require exploration of deep concepts and idioms. Others will require more motivating tasks. I've collected a list of tasks, mostly games of some form or another, which I think could be suitable. There are two large projects, a compiler to the POV-Ray Scene Description Language and some kind of game, that I hope to write at least one part of in each language.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8981740280837861615-145531694743510738?l=16languages.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://16languages.blogspot.com/feeds/145531694743510738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8981740280837861615&amp;postID=145531694743510738' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/145531694743510738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8981740280837861615/posts/default/145531694743510738'/><link rel='alternate' type='text/html' href='http://16languages.blogspot.com/2007/09/rules.html' title='The rules'/><author><name>Paul Stansifer</name><uri>http://www.blogger.com/profile/08758966392032593168</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://paul.stansifer.googlepages.com/idicon_100.png'/></author><thr:total>1</thr:total></entry></feed>
