<?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-6585710939668328688</id><updated>2011-08-12T14:33:13.360-04:00</updated><category term='embedded DSL'/><category term='adventure'/><category term='Information theory'/><category term='programming languages'/><category term='lexer'/><category term='cass-mt'/><category term='pnnl'/><category term='coroutines scheme'/><category term='books'/><category term='antlr'/><title type='text'>Two Crocodiles</title><subtitle type='html'>Diving headlong into whatever the future may bring.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://twocrocodiles.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://twocrocodiles.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Bob Adolf</name><uri>http://www.blogger.com/profile/07661292650825672977</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-X4uhCyfsgHI/Tjc6s8ux8vI/AAAAAAAAAGA/2KhZe0PV-V4/s220/Small.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6585710939668328688.post-7529670554798978088</id><published>2010-07-02T23:52:00.002-04:00</published><updated>2010-07-02T23:56:09.629-04:00</updated><title type='text'>Zen and the Art of Text Editor Programming</title><content type='html'>I like technology. I surround myself with computers and electronics, I put a lot of faith in the scientific method as a general solution to life's daily problems, and I believe the pursuit of knowledge is one of the purest aspirations one can have.&lt;br /&gt;&lt;br /&gt;I also realize that it can go horribly wrong, which is why when I was idly wandering through the vast information jungle that is the Internet, I was so pleased to stumble across this gem of a program:&lt;br /&gt;&lt;br /&gt;    &lt;a href="http://www.ommwriter.com/"&gt;OmmWriter&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It's a text editor. What distinguishes it from a lot of other software is that it takes such a focused approach to solving one particular problem: providing a peaceful, distraction-free environment so that a writer can focus on writing.&lt;br /&gt;&lt;br /&gt;Now you're probably thinking, "I thought you were a vi bigot. What gives? Have you renounced your faith and joined the mindless horde of infidels?" The answer is, of course, no – I will probably use vi for code until the day my fingers fall off. Still, I don't always write code. Sometimes I write words (real ones, with punctuation and everything!), like the ones you're reading now. When I write prose, all the little tricks that make vi a great programming editor are somewhat distracting. I want to write. Just me and the words.&lt;br /&gt;&lt;br /&gt;This is where OmmWriter excels. It's a full-screen editor with rudimentary features. You can load files and save files. You can choose one of three fonts and one of three font sizes. It only edits text files, so you cannot format anything. You can adjust the writing area, and you can scroll up and down if necessary. Finally, you can change the background image and sound effects. Now there are probably two questions in your head: "why is he listing features?" and "sound effects!?" To answer the first, it's because I just enumerated ALL of the features. All of them. It is a wonderfully minimalist editor. To answer your second question, don't knock it until you've tried it. I really thought that the sound/background thing was just a huge art gimmick to get publicity for their program, but I've been writing on it all day, and I actually find it really effective. It doesn't distract, and it puts me in a great, relaxed frame of mind.&lt;br /&gt;&lt;br /&gt;So in conclusion, here's to you, artists. The unlikely combination of a bit of programming skill, a light brush, and a very focused vision for the right way to write has produced a wonderful little tool and won me over completely.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;...oh, and I should probably also mention that because I am an unabashed terminal fanatic, I couldn't stand not being able to run OmmWriter as a command-line tool. So I fixed that little oversight: &lt;a href="http://www.rdadolf.com/code/omm_script/omm"&gt;omm&lt;/a&gt;. You're welcome!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6585710939668328688-7529670554798978088?l=twocrocodiles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://twocrocodiles.blogspot.com/feeds/7529670554798978088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6585710939668328688&amp;postID=7529670554798978088' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/7529670554798978088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/7529670554798978088'/><link rel='alternate' type='text/html' href='http://twocrocodiles.blogspot.com/2010/07/zen-and-art-of-text-editor-programming.html' title='Zen and the Art of Text Editor Programming'/><author><name>Bob Adolf</name><uri>http://www.blogger.com/profile/07661292650825672977</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-X4uhCyfsgHI/Tjc6s8ux8vI/AAAAAAAAAGA/2KhZe0PV-V4/s220/Small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6585710939668328688.post-3228185980227075918</id><published>2010-06-03T00:26:00.005-04:00</published><updated>2010-06-03T01:43:48.991-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lexer'/><category scheme='http://www.blogger.com/atom/ns#' term='embedded DSL'/><category scheme='http://www.blogger.com/atom/ns#' term='antlr'/><title type='text'>Stupid Parser Tricks, Part 1: Two Lexers, One Token Stream</title><content type='html'>So lately I’ve been working with &lt;a href="http://www.antlr.org/"&gt;ANTLR&lt;/a&gt;, a lexer/parser generator by Terrence Parr at UCSF. It’s been pretty enjoyable, for the most part. There have been a couple of times where I wanted to pull my hair out, but overall, it has really saved me a lot of time and effort in my attempt to write a DSL for some folks at work.&lt;br /&gt;&lt;br /&gt;Anyways, in the course of working with it, I stumbled across a couple of neat hacks that I thought I’d share. The first is how to write a hybrid lexer for an embedded DSL. I’m not the first to try something like this: Parr’s &lt;a href="http://www.antlr.org/download/"&gt;&lt;/a&gt;&lt;a href="http://www.antlr.org/download/"&gt;island-grammar example&lt;/a&gt; (examples-v3.tar.gz) shows how to traverse a hybrid grammar but stops short of merging the ASTs, and there’s a pretty hairy discussion of a &lt;a href="http://www.antlr.org/wiki/display/ANTLR3/Island+Grammars+Under+Parser+Control"&gt;more complicated scenario&lt;/a&gt; on the ANTLR wiki, but neither of these enable us to make two lexers transparently behave like one (which makes the programmer’s life easier and the downstream code cleaner, if you can get away with it).&lt;br /&gt;&lt;br /&gt;Basically, the recognizer classes that ANTLR builds for a grammar are self-contained enough to be called recursively without exploding. The island-grammar example I linked above does this, and it’s a very clever feature. What it doesn’t show you is that it’s possible to splice together the two token streams. The only tricky part is that by default, ANTLR is not written to handle recording multiple tokens for a single lexer rule (ostensibly for efficiency reasons). This means that when the lexer for the embedded language is invoked, we need to modify the base recognizer to handle the deluge of tokens that is produced. It’s not a difficult fix -- we just add a token buffer in-line with the function responsible for passing tokens up the chain and modify the emit function to feed the buffer instead. Once that plumbing is in place, we drop the embedded lexer in, collect the tokens, and feed them one by one to the outer lexer. The driver simply calls the outer lexer and the parser never knows the difference.&lt;br /&gt;&lt;br /&gt;There’s not enough space to walk through the code, but I’ve provided a python implementation below. Enjoy!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.rdadolf.com/code/stupid_parser_tricks.tgz"&gt;stupid_parser_tricks.tgz&lt;/a&gt; (tarball)&lt;br /&gt;  -or-&lt;br /&gt;&lt;a href="http://www.rdadolf.com/code/stupid_parser_tricks/"&gt;stupid_parser_tricks&lt;/a&gt; (individual files)&lt;br /&gt;&lt;br /&gt;(caveat emptor: if you don’t have lexer-level syntax for delineating the embedded language, you’re out of luck with this method. That’s where the more complicated scenario I mentioned arises.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6585710939668328688-3228185980227075918?l=twocrocodiles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://twocrocodiles.blogspot.com/feeds/3228185980227075918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6585710939668328688&amp;postID=3228185980227075918' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/3228185980227075918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/3228185980227075918'/><link rel='alternate' type='text/html' href='http://twocrocodiles.blogspot.com/2010/06/stupid-parser-tricks-part-1-two-lexers.html' title='Stupid Parser Tricks, Part 1: Two Lexers, One Token Stream'/><author><name>Bob Adolf</name><uri>http://www.blogger.com/profile/07661292650825672977</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-X4uhCyfsgHI/Tjc6s8ux8vI/AAAAAAAAAGA/2KhZe0PV-V4/s220/Small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6585710939668328688.post-4550418165568620337</id><published>2009-11-14T19:07:00.004-05:00</published><updated>2009-11-14T19:22:08.207-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pnnl'/><category scheme='http://www.blogger.com/atom/ns#' term='cass-mt'/><category scheme='http://www.blogger.com/atom/ns#' term='adventure'/><title type='text'>Out with the old, in with the new</title><content type='html'>Well, it's official. I've quit my job and shipped my things out west. In a week or two, I'll be starting my new job in the &lt;a href="http://cass-mt.pnl.gov/"&gt;CASS-MT&lt;/a&gt; group at &lt;a href="http://www.pnl.gov/"&gt;PNNL&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Here's to the start of a new adventure! Wish me luck.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6585710939668328688-4550418165568620337?l=twocrocodiles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://twocrocodiles.blogspot.com/feeds/4550418165568620337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6585710939668328688&amp;postID=4550418165568620337' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/4550418165568620337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/4550418165568620337'/><link rel='alternate' type='text/html' href='http://twocrocodiles.blogspot.com/2009/11/out-with-old-in-with-new.html' title='Out with the old, in with the new'/><author><name>Bob Adolf</name><uri>http://www.blogger.com/profile/07661292650825672977</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-X4uhCyfsgHI/Tjc6s8ux8vI/AAAAAAAAAGA/2KhZe0PV-V4/s220/Small.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6585710939668328688.post-2272817517754289159</id><published>2009-03-28T19:01:00.003-04:00</published><updated>2009-03-28T20:44:25.193-04:00</updated><title type='text'>Learning a language by writing another</title><content type='html'>Not too long ago, I was labeled an anachronist during a debate over trends in modern languages. At the time, I was rather amused, given how much time I spend in my professional life fighting to push research techniques into practical use. In reflection, though, his point did have one valid facet: many of the language techniques I bring up often come from variants of older languages  even if the languages themselves are much newer (e.g.- multilisp, Cilk, UPC). So, under the auspices of broadening my horizons, I decided to learn Haskell.&lt;br /&gt;&lt;br /&gt;I hit google, and after trying out several of tutorials on the language, I found myself extremely frustrated with writers who constantly tried to ignore half of Haskell's features in the name of providing a "simple" picture to the reader. I understand that some of the intended audience doesn't have a programming background, but when the examples are so simplistic that they actually fail to acknowledge that Haskell's type system even &lt;span style="font-style: italic;"&gt;exists&lt;/span&gt;, I draw the line.&lt;br /&gt;&lt;br /&gt;Thankfully, there was an alternative, in the form of a Wikibooks document called "&lt;a href="http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours"&gt;Write Yourself a Scheme in 48 Hours&lt;/a&gt;." Naturally, I didn't actually expect it to take 48 hours (though such things &lt;a href="http://s48.org/"&gt;have been done&lt;/a&gt;), but I'm a big fan of using a non-trivial example program as a learning tool. My history of working in and on various scheme implementations certainly doesn't hurt either; the territory is pretty well-traveled.&lt;br /&gt;&lt;br /&gt;As I work my way through the PDF and all of its exercises, I am certainly accumulating my share of quips with Haskell, but what would a real language be without that familiar love-hate relationship? Something tells me that I'll be happy I went through the motions in about 3-6 months. Here's to you, future-me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6585710939668328688-2272817517754289159?l=twocrocodiles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://twocrocodiles.blogspot.com/feeds/2272817517754289159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6585710939668328688&amp;postID=2272817517754289159' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/2272817517754289159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/2272817517754289159'/><link rel='alternate' type='text/html' href='http://twocrocodiles.blogspot.com/2009/03/learning-language-by-writing-another.html' title='Learning a language by writing another'/><author><name>Bob Adolf</name><uri>http://www.blogger.com/profile/07661292650825672977</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-X4uhCyfsgHI/Tjc6s8ux8vI/AAAAAAAAAGA/2KhZe0PV-V4/s220/Small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6585710939668328688.post-1347842663196044285</id><published>2009-01-28T08:13:00.004-05:00</published><updated>2009-01-28T09:57:04.053-05:00</updated><title type='text'>Putting the "tool" back in "social tool"</title><content type='html'>The best part about my job is the people. They are smart. Not your everyday "hey that guy is pretty sharp" smart; we're talking "someone could start a research journal entirely consisting of that guy's whiteboard doodles" smart. Anyways, every once in a while, I happen to be around when two of them get caught up in a conversation, and it's like getting thrown into a lake wearing concrete boots. The sheer volume of knowledge that gets funneled through the air is overwhelming. Sometimes it would be nice just to be able to chase down all of those pieces of information and really understand it all.&lt;br /&gt;&lt;br /&gt;A couple of days ago, I read a &lt;a href="http://blogs.azulsystems.com/cliff/2008/11/a-brief-conversation-with-david-moon.html"&gt;blog post&lt;/a&gt; by Cliff Click, a compiler guy famous for the Java HotSpot compiler whom I had the pleasure of meeting a while back. It's one of those conversations. Both Cliff and Dave Moon fall into the "scary smart" category, and while I can keep up with most of the conversation, they clearly have several decades of experience on me, and many of the references they make fly over my head. So I thought to myself, wouldn't it be nice to be able to annotate the discussion with links and references to the things they discuss?&lt;br /&gt;&lt;br /&gt;It seems to be something right up the alley of the social computing folks; I want to comment on someone else's web content and share them. I was inspired when google found me dozens of web tools that promised to let me do just that. So I started hunting them down, one by one...&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.diigo.com/"&gt;Diigo&lt;/a&gt; - Seems like the kind of tool I'm looking for, except annotations are only viewable if you're registered with Diigo. There's a "publish-to-blog" feature, but it only applies to bookmarks. I'm just not interested in yet another meaningless web account to keep track of, and I'm especially not fond of mandating that everyone else create one, too.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://fleck.com/"&gt;Fleck&lt;/a&gt; - The most bizarre of the bunch. Firefox actually blocked me from viewing the homepage, declaring it a "dangerous" site. After a little google work, fleck turns out to have some association with a European identity-mining organization. I think I'll pass.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://stickis.com/"&gt;Stickis&lt;/a&gt; - Allows you to place small, collapsible text boxes on any web page, but again, the results are only viewable from a stickis account.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://trailfire.com/"&gt;TrailFire&lt;/a&gt; - To be honest? I still don't really know. It's something to do with bookmarks. And &lt;a href="http://trailfire.com/pages/form.php?aid=explore-trails"&gt;webpages filled from top to bottom with random words&lt;/a&gt;. Your guess is as good as mine.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://reframeit.com/"&gt;Reframe It&lt;/a&gt; - A browser plug-in that lets you highlight and tag sections of text on a web page. Yes, it requires the same browser plug-in to view these comments. No, I'm still not interested in requiring everyone who visits my page to install some random tool.&lt;/li&gt;&lt;li&gt;&lt;a href="http://shiftspace.org/"&gt;ShiftSpace&lt;/a&gt; -Slightly more featureful than Reframe It, but still mandates you install the plug-in to view any additions.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://sharedcopy.com/"&gt;SharedCopy&lt;/a&gt; - This one actually let me demo without even giving so much as my name. Great! Except that there's no real annotation. I can highlight text (but not write a note), or I can add a note (except it has no connection to a specific portion of the page). Doesn't look so hot for adding in-line comments to a long discussion.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://drawhere.com/"&gt;DrawHere&lt;/a&gt; - The other site that let me get started right away. I love the interface, and if I were looking to paint moustaches on famous politicians or outrageous hair-dos on celebrities, I'd be all set. They only support MSPaint-style scribbling, no text whatsoever. Swing and a miss.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;There may have been more, but I think I've made my point. All of these authors seem to think that simply labelling their software "social" somehow automatically grants them a free ticket on the blog bandwagon (don't look at me like that, I have no qualms about my bandwagon-ing) and garner them big money in the process. The problem is, there's very little "tool" to be had. Most of these applications have a very thin veneer of actual functionality over a large chunk of "please make an account with us, our business model tells us this is important".&lt;br /&gt;&lt;br /&gt;It's all well and good to extol the free speech virtues of blogging and the cornucopia of user-created information that is Wikipedia, but let's face it, these are &lt;span style="font-style: italic;"&gt;social&lt;/span&gt; advances, not technological. The Internet revolution ended a while ago; the whole "web programming" thing just isn't producing a lot of groundbreaking work.&lt;br /&gt;&lt;br /&gt;So where does that leave me? Expect an annotated version of Cliff and Dave's conversation at some point....in plain text. Some "tools" just don't go out of style.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6585710939668328688-1347842663196044285?l=twocrocodiles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://twocrocodiles.blogspot.com/feeds/1347842663196044285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6585710939668328688&amp;postID=1347842663196044285' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/1347842663196044285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/1347842663196044285'/><link rel='alternate' type='text/html' href='http://twocrocodiles.blogspot.com/2009/01/putting-tool-back-in-social-tool.html' title='Putting the &quot;tool&quot; back in &quot;social tool&quot;'/><author><name>Bob Adolf</name><uri>http://www.blogger.com/profile/07661292650825672977</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-X4uhCyfsgHI/Tjc6s8ux8vI/AAAAAAAAAGA/2KhZe0PV-V4/s220/Small.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6585710939668328688.post-5442749195697868491</id><published>2009-01-23T06:51:00.002-05:00</published><updated>2009-01-23T08:29:16.706-05:00</updated><title type='text'>Reboot 2009</title><content type='html'>It's been a while since I last visited the land of rambling posts and thrice-shared hyperlinks, but with the passing of another 2^25 seconds or so, it seemed like a good opportunity to reclaim my virtual presence on the Grand Series of Tubes. Thanks to a certain&lt;a href="http://www.cs.stanford.edu/"&gt;&lt;/a&gt; pair of &lt;a href="http://cs.stanford.edu/"&gt;ivory&lt;/a&gt; &lt;a href="http://eecs.berkeley.edu/"&gt;towers&lt;/a&gt;, I spent a great deal of time writing about the things I have done, and although I won't say that the paperwork was my favorite activity in recent months, it did force me to sit down and apply a healthy amount of scrutiny to some work that had been lying in cobwebs. There's something cleansing about sharing ideas in public. It's easy to convince yourself of any number of rosy half-truths about some personal project that will never see the light of day, but it's much harder to keep those delusions when faced with the prospect of an audience of millions. Sure, it's vastly more likely that not a single soul will ever stumble across your work, but the fact remains that you've put a piece of yourself out there for everyone to see.&lt;br /&gt;&lt;br /&gt;So I suppose that's why I've come back. I found it tremendously useful to be forced to write something coherent that relates an idea to the protean communal eye. It seems only fitting, given the &lt;a href="http://www.whitehouse.gov/the_press_office/FreedomofInformationAct/"&gt;recent climate&lt;/a&gt; in the city to the south. I only wish I were so eloquent with my choice of words.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Oh, and I suppose since this &lt;span style="font-style: italic;"&gt;is&lt;/span&gt; the Internet, let's &lt;a href="http://en.wikipedia.org/wiki/Louis_Brandeis"&gt;flesh out&lt;/a&gt; the &lt;a href="http://en.wikipedia.org/wiki/Other_People%27s_Money_and_How_the_Bankers_Use_It"&gt;history&lt;/a&gt; of those &lt;a href="http://www.law.louisville.edu/library/collections/brandeis/node/196"&gt;words&lt;/a&gt;....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6585710939668328688-5442749195697868491?l=twocrocodiles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://twocrocodiles.blogspot.com/feeds/5442749195697868491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6585710939668328688&amp;postID=5442749195697868491' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/5442749195697868491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/5442749195697868491'/><link rel='alternate' type='text/html' href='http://twocrocodiles.blogspot.com/2009/01/reboot-2009.html' title='Reboot 2009'/><author><name>Bob Adolf</name><uri>http://www.blogger.com/profile/07661292650825672977</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-X4uhCyfsgHI/Tjc6s8ux8vI/AAAAAAAAAGA/2KhZe0PV-V4/s220/Small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6585710939668328688.post-5109633902920237404</id><published>2008-07-15T21:52:00.004-04:00</published><updated>2008-07-16T02:10:48.743-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='books'/><category scheme='http://www.blogger.com/atom/ns#' term='programming languages'/><title type='text'>Backwards Thinking</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_1jdgb2B0FX8/SH1VenHOnlI/AAAAAAAAAAY/j_30krWy-OM/s1600-h/SPoCL.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://bp3.blogger.com/_1jdgb2B0FX8/SH1VenHOnlI/AAAAAAAAAAY/j_30krWy-OM/s200/SPoCL.jpg" alt="" id="BLOGGER_PHOTO_ID_5223425127203380818" border="0" /&gt;&lt;/a&gt;When I think about it, it strikes me as odd that someone who thinks &lt;a href="http://www.eink.com/technology/howitworks.html"&gt;E-Ink&lt;/a&gt; and &lt;a href="http://mitpress.mit.edu/sicp/sicp.html"&gt;&lt;span style="text-decoration: underline;"&gt;modern&lt;/span&gt;&lt;/a&gt;&lt;a href="http://mitpress.mit.edu/sicp/sicp.html"&gt; languages&lt;/a&gt; are the best thing since transistors would enjoy a paperback on antiquated compiler techniques. Of course, it's hard to argue when I haven't been able to put the thing aside for the last week. Simply put, Knuth's &lt;a href="http://www-cs-faculty.stanford.edu/%7Eknuth/cl.html"&gt;"Selected Papers on Computer Languages"&lt;/a&gt; reads like a novel and is, in my humble opinion, better than his other books. The real difference is in flow (also, I find algorithm complexity immensely dull, but I digress). While TAoCP holds an overwhelming amount of information, the task of documenting that amount of material is simply too much; it just feels rushed. This collection, however, is Knuth in his element. Many of the papers were never formally presented; some are letters, others are just tidied-up notes. It's a very honest writing style and a real pleasure to read because of it. I find myself forgetting that some of the work I'm reading fundamentally changed the world of compilers when it was originally published. Here's to my favorite dead tree in the last several years.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6585710939668328688-5109633902920237404?l=twocrocodiles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://twocrocodiles.blogspot.com/feeds/5109633902920237404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6585710939668328688&amp;postID=5109633902920237404' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/5109633902920237404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/5109633902920237404'/><link rel='alternate' type='text/html' href='http://twocrocodiles.blogspot.com/2008/07/backwards-thinking.html' title='Backwards Thinking'/><author><name>Bob Adolf</name><uri>http://www.blogger.com/profile/07661292650825672977</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-X4uhCyfsgHI/Tjc6s8ux8vI/AAAAAAAAAGA/2KhZe0PV-V4/s220/Small.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_1jdgb2B0FX8/SH1VenHOnlI/AAAAAAAAAAY/j_30krWy-OM/s72-c/SPoCL.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6585710939668328688.post-8867116434576406804</id><published>2008-07-04T15:42:00.005-04:00</published><updated>2008-07-04T17:14:39.210-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Information theory'/><title type='text'>Boilerplate is basically bad</title><content type='html'>or &lt;span style="font-weight: bold;"&gt;"How Huffman should help my hurting hands"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Typing breaks make me irritable. Usually, I occupy myself by finding someone to bother and striking up a conversation, but this week it seems I was alone in deciding not to vacation for the entire work week. Yesterday, this confluence came to a head and produced a brain-tangent concerning the volume of text that programming demands (I.E.- way too freaking much). Not being one to let things go even when I should, I spent the evening creating tools to shortcut some of the common things I do. In the end, I met with only moderate success, and I doubt I will actually adopt any of them during my day-to-day tasks, but I did come out with a better understanding of why I am so annoyed by the status quo.&lt;br /&gt;&lt;br /&gt;A programs does two things: 1) it tells a computer what to do, and 2) it tells a reader what you told the computer to do. An &lt;span style="font-style: italic;"&gt;efficient&lt;/span&gt; program does both as concisely as possible. The phrase "as X as possible" should tip you off to the fact that this is an optimization problem. More specifically, it has become an information theory optimization problem in the vein of &lt;a href="http://en.wikipedia.org/wiki/Kolmogorov_complexity"&gt;Kolmogorov Complexity&lt;/a&gt;. Of course, it's not computable because the latter evaluation criterion requires modeling the human brain, but the point remains. Why should I write this:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;#include &lt;stdio.h&gt;&amp;lt;stdio.h&amp;gt;&lt;br /&gt;int main( int argc, char **argv ) {&lt;br /&gt;&lt;br /&gt;return 0;&lt;br /&gt;}&lt;/stdio.h&gt;&lt;/code&gt;&lt;/blockquote&gt;When 99% of my code uses that same text? If we were to shove 100 C programs through a Huffman-esque meat grinder, that entire quote (and probably more!) would condense down to a single bit. Of course, it would be unreadable, but I believe I've made it clear that the middle-ground for optimizing our problem is much closer to a single bit than it is to that horrible monstrosity. (For the record, yes, I realize C is guilty of this far more than other languages, but I'm trying to make a point.)&lt;br /&gt;&lt;br /&gt;I'll spare you the rest of my ravings on simplicity and coding, but suffice to say, I'll be digging out an information theory textbook and giving this a second look at some point. There's too much code out there, and something needs to be done about it all.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6585710939668328688-8867116434576406804?l=twocrocodiles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://twocrocodiles.blogspot.com/feeds/8867116434576406804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6585710939668328688&amp;postID=8867116434576406804' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/8867116434576406804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/8867116434576406804'/><link rel='alternate' type='text/html' href='http://twocrocodiles.blogspot.com/2008/07/boilerplate-is-basically-bad.html' title='Boilerplate is basically bad'/><author><name>Bob Adolf</name><uri>http://www.blogger.com/profile/07661292650825672977</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-X4uhCyfsgHI/Tjc6s8ux8vI/AAAAAAAAAGA/2KhZe0PV-V4/s220/Small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6585710939668328688.post-7971053649053437126</id><published>2008-06-26T23:06:00.009-04:00</published><updated>2008-06-27T06:28:09.102-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='coroutines scheme'/><title type='text'>Coroutines, continuations, and call/cc</title><content type='html'>I'll try and set a precedent for myself by starting out with something that's not full of fluff. The other day, I was doing some reading on parallel languages when I came across &lt;a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.58.4017"&gt;a paper&lt;/a&gt; extolling the benefits of programming with &lt;a href="http://en.wikipedia.org/wiki/Coroutine"&gt;coroutines&lt;/a&gt;. I didn't think the paper was particularly well-written, but it did make it quite clear that I had a hazy conception of what they were. So I resolved to correct this -- by implementing them.&lt;br /&gt;&lt;br /&gt;For the uninitiated, coroutines are functions that have stateful control flow and, as a corollary, can have multiple entry and exit points. An example:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;&lt;span style="font-size:100%;"&gt;(define-coroutine (prefixes)&lt;br /&gt;(display "pre") (yield)&lt;br /&gt;(display "over") (yield)&lt;br /&gt;(display "co") (yield)&lt;br /&gt;(escape))&lt;br /&gt;&lt;br /&gt;(define-coroutine (stems)&lt;br /&gt;(display "fix ") (yield)&lt;br /&gt;(display "whelm ") (yield)&lt;br /&gt;(display "routine ") (yield)&lt;br /&gt;(escape))&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;  Assume for the moment that "yield" is essentially like "return" in C. The difference is that when a coroutine returns, it doesn't lose its place. It keeps a continuation to where it left off. This essentially gives it an exit point wherever yield is called and a possible entry point immediately after. So when we run this, we get:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;(cobegin prefixes stems)&lt;br /&gt;prefix overwhelm coroutine ...&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;  The coroutines pick up right where they left off. It turns out there are some useful situations for this idiom (think producer/consumer semantics or pipes), and the whole thing struck me as a neat way to make some inroads into playing with dataflow models. So off I went.&lt;br /&gt;&lt;br /&gt;I'll spare all of the gritty details, but suffice to say that I went through a handful of iterations, each with their various benefits and drawbacks, but in the end, the example above works flawlessly. I threw all of the code up on &lt;a href="http://homepage.mac.com/rdadolf/coroutines/"&gt;my homepage&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6585710939668328688-7971053649053437126?l=twocrocodiles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://twocrocodiles.blogspot.com/feeds/7971053649053437126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6585710939668328688&amp;postID=7971053649053437126' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/7971053649053437126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/7971053649053437126'/><link rel='alternate' type='text/html' href='http://twocrocodiles.blogspot.com/2008/06/coroutines-continuations-and-callcc.html' title='Coroutines, continuations, and call/cc'/><author><name>Bob Adolf</name><uri>http://www.blogger.com/profile/07661292650825672977</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-X4uhCyfsgHI/Tjc6s8ux8vI/AAAAAAAAAGA/2KhZe0PV-V4/s220/Small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6585710939668328688.post-5745119642420977108</id><published>2008-06-23T07:10:00.002-04:00</published><updated>2008-06-23T07:29:57.941-04:00</updated><title type='text'>So it begins</title><content type='html'>I suppose this would be the time to spout off some high-brow tirade about my divine purpose in starting this, but in all honesty, I'm still not entirely sure what my reasons were for creating a blog. The format intrigues me, and I've been quite the fan of the ones I've read, so maybe the real drive is to officially join the community at large. In that case, I'll send a greeting to anyone who happened to land their browser in my corner of the web and offer this piece of advice:&lt;br /&gt;&lt;blockquote style="font-style: italic;"&gt;No matter what the world has in store for you, you have two crocodiles on your side.&lt;/blockquote&gt;But the long story behind that will have to wait for another day.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6585710939668328688-5745119642420977108?l=twocrocodiles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://twocrocodiles.blogspot.com/feeds/5745119642420977108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6585710939668328688&amp;postID=5745119642420977108' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/5745119642420977108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6585710939668328688/posts/default/5745119642420977108'/><link rel='alternate' type='text/html' href='http://twocrocodiles.blogspot.com/2008/06/so-it-begins.html' title='So it begins'/><author><name>Bob Adolf</name><uri>http://www.blogger.com/profile/07661292650825672977</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-X4uhCyfsgHI/Tjc6s8ux8vI/AAAAAAAAAGA/2KhZe0PV-V4/s220/Small.jpg'/></author><thr:total>2</thr:total></entry></feed>
