What
 · Technology
 · · Ruby

Cloud Lifesaving and Fear · Last year I built (and of course blogged) this nifty lit­tle An­droid app called LifeSaver, which would copy your telephone-call and SMS logs on­to an SD card, so you could move the SD card to an­oth­er phone, run LifeSaver again, and get ’em all back. Calls and texts aren’t mi­grat­ed by the ex­cel­lent An­droid back­up sys­tem ...
[26 comments]  
Late Summer Tech Tab Sweep · Some of these pup­pies have been keep­ing a brows­er tab open since April. No the­me; rang­ing on the geek­i­ness scale from ex­treme to mostly-sociology ...
[2 comments]  
Ruby in Edinburgh · Here­with some words and pic­tures from the Scot­tish Ru­by Con­fer­ence, which I at­tend­ed last Fri­day and Satur­day ...
[3 comments]  
RubyConf 2009 · The con­fer­ence was in an Em­bassy Suites right there by San Fran air­port, thus for the first time in years I found my­self in The Val­ley but with­out a car; felt weird. As usu­al, a brac­ing blend of geek love and mind food, plus this time with mu­si­cal and ath­let­ic side-trips ...
[3 comments]  
Upcoming Gig — Scottish Ruby · Next March, I’ll vis­it Ed­in­burgh (for the first time!) to keynote the Scot­tish Ru­by Con­fer­ence, along with the ex­cel­lent Jim Weirich. In­ter­est­ing­ly, this is the for­mer Scot­land On Rail­s; they’ve de­cid­ed to broad­en their spec­trum.
[2 comments]  
島根 September — Canal Farewell · I sup­pose that’s about enough words & pic­tures from around Shi­mane pre­fec­ture. Here are a few farewell shots from the Mat­sue city canal-boat tour ...
 
島根 September — Washi in Yakumo · In 1902 a boy named Eishi­rou Abe was born in Yaku­mo, a vil­lage in Shi­mane; he took up the lo­cal trade, mak­ing Washi pa­per, and ex­celled; in 1968 he was des­ig­nat­ed a Liv­ing Na­tion­al Trea­sure. He died in 1985, but his work­shop is still there; you can vis­it it, look at lots of beau­ti­ful pa­per, and make it your­self. Our Ru­by road trip stopped there and we did those things ...
 
島根 September — Garden and Museum · That’s the Adachi Mu­se­um of Art, and es­pe­cial­ly its as­so­ci­at­ed gar­den which has been vot­ed (by an authoritative-sounding gar­den­ing mag­a­zine) the best in Ja­pan for a half-dozen years now. Our road trip stopped there, alas for on­ly an hour, and I took pic­tures ...
[3 comments]  
島根 September — Ruby Road Trip · Our sto­ry thus far: a gag­gle of gai­jin are in­vit­ed to hold forth at RubyWorld 2009 in a little-noticed cor­ner of Ja­pan. The con­fer­ence was on Mon­day and Tues­day; Wed­nes­day they took us on a scenic Shi­mane tour. Matz and Ko1 and Prof. Takeuchi came along, and I got pic­tures so you can too ...
[2 comments]  
島根 September — Liking Matsue · I’ve writ­ten a lot about Tokyo and ear­ly on, I said “Tokyo doesn’t need you to like it”. Wel­l, Mat­sue wants you to like it. Al­so, Tokyo is, by and large, butt-ugly while Mat­sue, by and large, isn’t ...
 
島根 September — Kunibiki Messe · The RubyWorld 2009 con­fer­ence was held at Matsue’s own con­fer­ence cen­ter, Ku­nibi­ki Messe. It’s a cool place and I couldn’t re­sist tak­ing a bunch of pic­tures ...
 
島根 September — RubyWorld · The rea­son I went to Ja­pan was to at­tend RubyWorld 2009, a con­fer­ence cen­ter­ing around the Ru­by pro­gram­ming lan­guage. The rea­son the con­fer­ence was in this rather re­mote cor­ner of Ja­pan is that Mat­sumo­to Yuk­i­hi­ro (known to geeks as “Matz”), the in­ven­tor of Ruby, choos­es to live and work in Mat­sue, and the city and pre­fec­ture gov­ern­ments are try­ing to use his pres­ence as lever­age in di­ver­si­fy­ing the lo­cal econ­o­my in­to Open-Source soft­ware. While the con­fer­ence was rea­son­ably well-covered in the Ja­panese me­di­a, I’ve seen noth­ing in English, so I’ll try to rec­ti­fy that here. With pic­tures ...
[2 comments]  
島根 September — The Castle · Matsue’s number-one tourist at­trac­tion is its cas­tle (松江城), which is ab­so­lute­ly worth a vis­it. Here are eight pho­tograph­s, with di­ver­sions in­to nin­ja and pro­gram­ming cul­ture. (For pre­vi­ous con­tex­t, see 島根 Septem­ber — Mat­sue Morn­ing.) ...
[2 comments]  
島根 September — Matsue Morning · I re­turned to­day from four days in Shi­mane pre­fec­ture (島根県); the oc­ca­sion was RubyWorld Con­fer­ence 2009. I came back with a few sto­ries and a ton of pic­tures, so I’ll wrap the for­mer around the lat­ter for the next few days ...
[2 comments]  
Ravelry · Pos­si­bly you’ve nev­er heard of it. But if you know any­one who knits or cro­chet­s, ask him or (more like­ly) her about Ravel­ry and chances are you’re talk­ing to an ac­tive mem­ber. It’s big. This is an in­ter­view with Casey Forbes, who con­sti­tutes the whole en­gi­neer­ing staff ...
[6 comments]  
NetBeans 6.7 · Who knows how many more chances I’ll have to talk about Sun tech that I like? In the five years I’ve been here I’ve been pleased by OpenSo­laris and Fish­works and HotSpot and GlassFish and oth­er­s, but NetBeans is #1 in my heart. I just down­load­ed 6.7 RC3 a cou­ple of days ago to try to fix a prob­lem (it didn’t, but the prob­lem was amus­ing) and it’s re­al­ly good stuff. Gen­er­al­ly nice, and with one ab­so­lute­ly life-changing new fea­ture ...
[6 comments]  
Nastiness · This is sad­den­ing stuff. At a re­cent Ru­by con­fer­ence (that I’m not go­ing to name be­cause it wasn’t their fault­), a speak­er (whom I’m not go­ing to name for rea­sons of taste) had porn-flavored slides in his pre­sen­ta­tion; peo­ple were of­fend­ed and said so. Some in the Rails com­mu­ni­ty, in­clud­ing its lead­er, pushed back hard, in a way that of­fend­ed many more peo­ple. If you haven’t been fol­low­ing the sto­ry, I think Martin Fowler’s SmutOnRails has a good ag­gre­ga­tion of links, and al­so I agree with most of his com­men­tary. I’m go­ing to add two ob­ser­va­tion­s, one link, and some rec­om­men­da­tion­s ...
[16 comments]  
Minimal Rack + JRuby + GlassFish Recipe · I’ve been work­ing on a lit­tle piece of Ruby-and-Rack-based Web in­te­gra­tion goo, and it’s done enough that we have to fig­ure out de­ploy­men­t. One rea­son I picked Rack is that it’s ad­ver­tised as de­ploy­ing on any­thing. The en­vi­ron­ment where this will live has some of this and some of that, and we’re us­ing GlassFish to tie it all to­geth­er, which seems like an ap­pro­pri­ate choice. So, the prob­lem is: How to plug a sim­ple Rack ap­pli­ca­tion in­to GlassFish? ...
[2 comments]  
On Rack · I’m re­fer­ring not to an in­stru­ment of tor­ture, nor in­dus­tri­al fur­ni­ture for com­put­er­s, but to the in­creas­ing­ly pop­u­lar Rack Web serv­er in­ter­face. I’ve found, first, that the ex­pla­na­tions of what it does aren’t that great, and sec­ond, that it’s ide­al for my cur­rent at-work pro­jec­t. I bet it’d be use­ful for lots of oth­ers too, so here’s my shot at an in­tro­duc­tion ...
[16 comments]  
Ruby I18n · Be­ing a brief code frag­ment that makes me hap­py ...
[5 comments]  
Testing REST · I’ve been us­ing RSpec in a way that’s prob­a­bly in­ap­pro­pri­ate, but has got me think­ing about Test-Driven Devel­op­ment and REST ...
[13 comments]  
Dangerous Gems · Maybe I’m just be­ing para­noid here, but I’m start­ing to get a lit­tle wor­ried that RubyGems could be a nasty at­tack vec­tor, giv­en cer­tain com­bi­na­tions of mal­ice and stu­pid­i­ty ...
[19 comments]  
Tab Sweep — Technology · I’d kind of got­ten out of the habit of do­ing tab sweep­s, large­ly be­cause my Twit­ter feed is such a se­duc­tive place to drop in­ter­est­ing links. But as of now there are around 30 tabs open on my browser, each rep­re­sent­ing some­thing I thought was im­por­tant enough to think about and maybe write about. Some are over a month old. Some of them have been well-covered else­where. All I as­sert is that af­ter I read each one of the­se, I didn’t want to hit command-W to make that win­dow go away. Uni­fy­ing the­me? Sure­ly you jest ...
[1 comment]  
Tasty Rails ETags · This piece is pro­voked by Ryan Daigle’s What’s New in Edge Rail­s: Sim­pler Con­di­tion­al Get Sup­port (ETags). I think it’s an im­por­tant sub­jec­t. I re­al­ize that many read­ers here un­der­stand what ETags are and why they mat­ter, and will see right away how the API Ryan de­scribes fits in­to the pic­ture. If you don’t, and you build Web app­s, it’s prob­a­bly worth read­ing this and fol­low­ing some links ...
[6 comments]  
RX and 1.9 and Pain · This frag­ment is most­ly a note to my­self and place­hold­er and might prove use­ful to some­one slash­ing through the XML un­der­growth with bleeding-edge Ruby. Briefly: I re­vived my “RX” Ru­by to­k­eniz­er (see here, here, and here) to con­tribute to An­to­nio Cangiano’s pro­posed Ru­by bench­mark suite, which I think is a Real­ly Good Idea. I had a bit of pain get­ting the code to run on both Ru­by 1.8 and 1.9, and then when I tried sanity-checking the out­put by com­par­ing it to REXML on 1.9, REXML blew chunks. There are, ap­par­ent­ly, is­sues about REXML and 1.9. Read on for de­tails in the un­like­ly event that you care about any of this ...
[3 comments]  
Ruby 1.9 I18n and Mashup Testing · A cou­ple of points on that PDML + Twit­ter mashup. First, yet an­oth­er homi­ly say­ing “Please unit test”. Se­cond, some com­menters want­ed to see the code even though it’s triv­ial, and I found a rea­son to agree ...
[1 comment]  
Ruby News · This re­al­ly isn’t the place to come for Ru­by news. But that’s OK, be­cause I have the point­ers to where you should go. Plus, one of the news sto­ries is mak­ing me think “Smells like Erlang.” ...
[4 comments]  
JRuby 1.1 · I see the JRuby­ists have shipped JRu­by 1.1. I in­creas­ing­ly think JRu­by is in­ter­est­ing and im­por­tant as a test case, even if you don’t hap­pen to care in the slight­est about Ru­by or Rail­s ...
[7 comments]  
Ruby News: Honey Pie · I’ve been build­ing up bits & pieces of Ru­by news for weeks and week­s, so this is a pret­ty siz­able bright-red glob ...
[2 comments]  
Upcoming Gig: Silly Valley Ruby · This is right in the mid­dle of San Jose, April 18 and 19. To be pre­cise, SDForum’s Third An­nu­al Sil­i­con Val­ley Ru­by Con­fer­ence. SDFo­rum seems like a good or­ga­ni­za­tion. I ac­tu­al­ly have nev­er been to any kind of Ru­by gath­er­ing in the Bay Area, so have no feel for the lo­cal cul­ture; I’m look­ing for­ward to this.
[2 comments]  
Bejeweled Ape · I am de­light­ed to an­nounce that my col­lab­o­ra­tors (now in­clud­ing Bran­don Mitchell) have been wran­gling the Ape and it is now a Ru­by Gem. Wow.
 
Tab Sweep—Ruby · I was do­ing a gen­er­al Tech Tab Sweep and I no­ticed that I had a ton of Ruby-related stuff, so it gets its own frag­men­t ...
[2 comments]  
The Ruby News · I keep putting off this Ru­by News Sur­vey piece be­cause there keeps be­ing more news, but hey, you have to pull the trig­ger some­time ...
[1 comment]  
2008 Prediction 3: Rails Rules · This is the third of five pre­dic­tions for 2008, ex­pand­ed from the short form gen­er­at­ed on short no­tice as de­scribed here ...
[10 comments]  
Now That’s a Patch · I re­fer to Sam Ruby’s mas­sive patch to make REXML work prop­er­ly with the lat­est Ruby. I’ve long dis­liked REXML (see here and here), but it’s here and it work­s. On­ly the way it works changed in 1.9, and there were some hor­ri­ble re­gres­sion­s, and it gets patched very slow­ly. (I’m ac­tu­al­ly won­der­ing why Ru­by needs to have a weird regex-based pars­er when Ex­pat is plen­ty good enough for Perl and Python, and in fact if you look at xml­parser.rb, you can switch parser­s, just as Nick Sieger has done for JRu­by with JREXML. But I di­gress.) In the short ter­m, we need to see if the REXML main­tain­ers are re­spon­sive to Sam’s patch.
[1 comment]  
Year-End Sweep — Tech · Over the course of the year, in brows­er tab­s, book­mark­s, and del.i­cio.us, I’ve built up a huge list of things that I felt I should write about, at least at the time I saw them. Wel­l, dammit, I’m not gonna let 2007 end with­out at least mak­ing a try. Here goes. Cat­e­go­rized, even ...
[7 comments]  
Ruby Performance Snapshot · What hap­pened was, I got a note from Matt (who runs the on­go­ing server), say­ing my traf­fic had sud­den­ly jumped (to like 230G/­mon­th) and won­der­ing why. I had no idea, so I whipped up a lit­tle Ru­by script to break down traf­fic by re­source and host and time-of-day and so on. Then I won­dered which ver­sion of Ru­by would run it fastest? ...
[1 comment]  
On Closures · I start­ed out ner­vous with the idea of adding clo­sures to Java, and I think I’ve slid firm­ly in­to the “contra” cam­p. One rea­son is that it seems in­creas­ing­ly a bad idea to add any­thing to the Ja­va lan­guage. On a re­lat­ed sub­jec­t, my brief so­journ in Ruby-land has changed my think­ing about clo­sures en­tire­ly ...
[19 comments]  
Ruby News · Check out An­to­nio Cangiano’s The Great Ru­by Shootout, which ad­dress­es the vexed ques­tion of Ru­by per­for­mance, takes names and hands out num­ber­s. Damn in­ter­est­ing num­ber­s, too, if not ter­ri­bly sur­pris­ing. You want sur­pris­ing? Engine Yard, which al­ready em­ploys Ru­binius Guy Evan Phoenix, has just hired Ryan Davis and Eric Hodel to work on Ru­binius. Holy crap. That makes four Ruby-implementor teams with mul­ti­ple peo­ple grind­ing away at the prob­lem full time. This is what they call good news. Mean­while, the Mac cor­ner of the Ru­by World is glow­ing with scar­let Ru­by love.
 
Ruby Survey Results · High­light­s: 1,000 re­spon­der­s, of which 470 Rails and 530 Ruby; Tex­tMate is the most pop­u­lar tool glob­al­ly, but the Vi fam­i­ly is slight­ly pre­ferred on the Ru­by side. Thanks, ev­ery­one, for pitch­ing in! ...
 
Ruby Tool Survey · At Sun, I’m in the Devel­op­er Tools group. Some­one asked “Which tools does the Ru­by gang use, anyhow?” I said “Hmm, Tex­tMate, Emac­s, Vi, re­cent­ly some Eclipse and NetBeans.” They said “How do you know?” I said “Uh.” They said “Why don’t you ask?” So I did. Here’s the write-up, in an­oth­er frag­men­t, which is more commenter-friendly I think.
[15 comments]  
Bytecodes! · Way back in 2004, when we had the first Java/DynLangs sum­mit, one of the DynLangs guys’ gripes was that byte­codes were too hard to gen­er­ate. They still are; but check out Charles Nutter’s Byte­code Tools in Ruby: A Low-level DSL; is it just me, or is that re­mark­able? I have tend­ed to be a bit less im­pressed than your av­er­age Ru­by fan­boy at a bunch of method calls sans paren­the­ses claim­ing to be a “DSL”. But man, that looks slick.
 
Bad Ruby · I en­joyed at­tend­ing RubyConf im­mense­ly, but I al­so re­gret­ted it. Not all is well in my per­son­al fa­vorite open-source com­mu­ni­ty. (This ar­ti­cle is full of com­plaints; for my love-letter on the same sub­ject see here.) [Ouch, check the com­ments. My po­si­tion on week­ends is, um, not uni­ver­sal­ly held.] ...
[16 comments]  
Good Ruby · I was at RubyConf ten days ago and just now catch­ing up, been over­load­ed. This was my sec­ond RubyConf and, like last time, I came away in­spired. This is an il­lus­trat­ed fan let­ter; but there are prob­lems in the com­mu­ni­ty and at the con­fer­ence; I’ve writ­ten about them sep­a­rate­ly ...
[2 comments]  
The Plot Thickens · Ah, I see the RubyForg­ers have the new serv­er on the air. That 4200 should do quite a bit bet­ter than the very ba­sic Xeon it’s re­plac­ing, par­tic­u­lar­ly since they were maxed out on I/O ...
 
The Rubinius Sprint · Last week in Den­ver, the Ru­binius guys had a cod­ing sprint; read about it in Bri­an Ford’s Ru­binius sprint ret­ro­spec­tive and Wil­son Bilkovich’s Im­ple­ment­ing de­fine_method. We at Sun sup­port­ed it by cov­er­ing the trav­el costs (well, we will as soon as I get the pa­per­work, guys) and by send­ing Charles Nut­ter along for a day. Looks like they got some good stuff done. Ru­binius is an at­tempt to build the next-gen Ru­by im­ple­men­ta­tion. Which is hap­pen­ing in par­al­lel with the “official” Ru­by 1.9 work in Ja­pan and the JRu­by pro­jec­t. [Up­date: Pat Eyler in­ter­views the sprint­ers.] ...
[3 comments]  
Tab Sweep — Tech · There were a few here that I want­ed to do a whole piece about, but I just got­ta clear some space on these deck­s. To­day we have push­ing and pulling and queue­ing and Ruby.next and Ja­va hate and PHP-vs.-Rails. What’s not to like? ...
[9 comments]  
Ruby Glee · Now, this would be a red-letter day. I was chas­ing a weird Ape bug, and I found the prob­lem: atom­URI#ab­so­l­u­tize was re­turn­ing a URI not a string (and by the way, why doesn’t URI of­fer String meth­ods like in­dex and =~!?! But I di­gress.) Any­how, I moaned, think­ing “Crap, that’s used ev­ery­where, what am I gonna break?” What I need­ed was “Find Usages”... Hah! I’d re­cent­ly grabbed a new NetBeans 6 pre-release (the 070810 build of M10) and Tor’s been do­ing some heavy chest-beating re­cent­ly. Here goes with the right-click ...
[9 comments]  
Tab Sweep — Tech · Au­gust is sup­posed to be the slow time of year. Not! Is there ev­er a lot of in­ter­est­ing stuff out there. To­day we have WS-funnies, OOXML Pur­dah, Web names, In­ter­net Registry struc­tures, and Ru­by metapro­gram­ming crazi­ness ...
[8 comments]  
Ape Rev · I just post­ed a rev for the Ape (runnable, source), as fol­lows: ...
[6 comments]  
Ruby News · And is there ev­er a lot of it. I was go­ing to break this in­to a hand­ful of tar­get­ed snip­pet­s, but any­one who cares about the lan­guage would read ’em all any­how. Thus, an il­lus­trat­ed tour through Tokyo con­fer­ences, JRu­by 1.0, Re­fac­tor­ing, and M17n ...
[3 comments]  
JRuby IRC Koan · On the #jru­by IRC chan­nel, a well-known JRu­by com­mit­ter was heard to ut­ter the fol­low­ing: this is the in­stance of place which har­bors the method we are in­vok­ing which may not re­al­ly be self at point it is call­ing. And it was in the mid­dle of the day, too.
[3 comments]  
RailsConf Take-Aways · Here’s the nice one: PragDave a.k.a. Dave Thomas launched an ef­fort to get the Rail­sConf at­ten­dees to give some­thing back; some­thing as in hard cold cash do­na­tions to char­i­ty. I plugged it dur­ing my keynote, as did sev­er­al oth­er­s, and Chad Fowler re­al­ly got be­hind it. It came out pret­ty well. And on a lighter note, Big Jim­my Kane of­fers co­gent in­sight on my ap­pear­ance wav­ing a Sun ban­ner in Ruby­land.
 
RailsConf Day Two · The first hour and fif­teen of the day was Cyn­di Mitchell of ThoughtWorks and me in keynote mod­e. The in­ter­est­ing part, though, was the hall­ways and lunch ...
[15 comments]  
RailsConf Day One · [Thurs­day] Sit­ting in the air­port get­ting ready to head out; it’s been a while since I’ve spo­ken to over a thou­sand peo­ple (well, I do ev­ery day here, but that’s dif­fer­en­t) so I’m ner­vous. Hap­py, too; I’ve man­aged to sched­ule my Sun-related work so I can get to a few ses­sions that sound super-interesting; I ex­pect to get my brain up­grad­ed. [Fri­day] I’m fill­ing in con­fer­ence notes and pic­tures as the days go by ...
[3 comments]  
Another Defeat for XML · <Snicker> I’m talk­ing about Buil­dr, a drop-in re­place­ment for Maven; I’ve nev­er used Maven but boy do peo­ple ev­er hate it. Buil­dr is writ­ten in Ru­by not Java, it us­es a DSL-ish Ru­by di­alect for build files in­stead of XML, and it’s way faster.
[6 comments]  
Ruby Servlet Dispatching · I’m wiring the Ape up so I can run it with JRu­by in a servlet in a re­al Ja­va App Server, and while Marcin Mielżyński’s first-cut RubyServlet works fine, I sus­pect it’s not the on­ly ap­proach to dis­patch­ing. So I’m do­ing some re­search and think­ing, and I’ve col­lect­ed it here for any­one who cares ...
[4 comments]  
Hotness · Ruby-related sto­ries go­ing across my radar keep mak­ing me say “ooh, that looks hot.” ...
[4 comments]  
JRuby Servlets · I got the Ape run­ning on JRu­by and wired Jing back in, which is re­al­ly use­ful (some of the so-called Ser­vice Docs out there are ca­nine fe­cal mat­ter). I was pret­ty damn im­pressed when the now-2400+ lines of Ape code to­tal­ly just worked in JRuby. Then, I was ir­ri­tat­ed by the re­al­iza­tion that my prim­i­tive CGI set­up for run­ning the Ape is just not gonna fly if I have to start up a JVM and JRu­by for each re­quest. So I thought “this is what servlets are for, right?” and the good news is that It Can Be Done ...
[3 comments]  
Aping · To­day Joe Gre­go­rio point­ed the Ape at his “apptestsite” and found some prob­lem­s. And the Ape found some prob­lems with his stuff too. So we both fixed ’em and the Ape’s much hap­pier. This is fun! ...
[14 comments]  
Upcoming Gig: RubyKaigi 2007 · The week of June 10 will find me in Tokyo for RubyKaigi2007, where my ti­tle is The World in 30 Min­utes. For­tu­nate­ly, they’ve pro­vid­ed this map. Wish me luck; I’ll need it.
[1 comment]  
Another Blow to Emacs · I’ve been watch­ing Tor Nor­bye grind­ing away on NetBeans 6, and couldn’t wait any more, so I went and down­load­ed a dai­ly build, and it seems to kin­da work. Up till now, all my Ru­by work has been in Emac­s, but the NB6 pre-pre-alpha trumps it ...
[15 comments]  
Tab Sweep · As usu­al, there isn’t a uni­fy­ing the­me. In this is­sue: lumpi­ness, stuff, mi­cro­for­mat­s, eye can­dy, metapro­gram­ming, beard­s, and psy­chol­o­gy ...
[1 comment]  
Rails and Joyent · Last week, I read about Joyent run­ning four thou­sand Rails re­quests per sec­ond with a hard­ware load bal­ancer fronting six of their Ac­cel­er­a­tor thingies. Then yes­ter­day it turned out that svn.ruby­on­rail­s.org/rails, the new Rails de­vel­op­ment clus­ter, is at Tex­tDrive too. Un­der my Sun hat I’m hap­py that So­laris is ap­par­ent­ly be­hind the world’s highest-performance Rails in­stal­la­tion and is sup­port­ing both Ru­by 1.9 and Rails de­vel­op­men­t. My take-away, though, is that the more I hear about Joyen­t, the more in­ter­est­ing they look.
 
Matsue, Shimane · What hap­pened was, I got an email from a Ja­panese col­league ask­ing if I could come to an all-day meet­ing at the Sun EBC with the Open Source Soft­ware So­ci­ety Shi­mane. I wrote back say­ing “Huh?” and he wrote back ex­plain­ing that Shi­mane is a pre­fec­ture in Ja­pan and that the del­e­ga­tion would in­clude Yuk­i­hi­ro Mat­sumo­to, al­so known as “Matz”, the de­sign­er of Ruby, who lives there, and that I’d been asked for. I wrote back say­ing “OK”, and now I want to go and vis­it Mat­sue, the cap­i­tal city of Shi­mane, an hour’s flight from Toky­o ...
[4 comments]  
JRuby January · In this month’s JRu­by news, Ryan To­mayko goes all vi­sion­ary, Charles Nut­ter pon­ders In­vokeDy­nam­ic, and Nick Sieger’s a com­mit­ter. I par­tial­ly dis­agree with Ryan’s point #3. My im­pres­sion has been that the av­er­age Ja­va pack­age is at least as well-maintained as in any oth­er lan­guage you care to name, and bet­ter than some (but he’s right, of course, that the main­te­nance ac­tiv­i­ty needs start man­i­fest­ing quick­ly via your lo­cal apt or yum or what­ev­er). Al­so, Ryan rec­om­mends Ru­by when “where read­abil­i­ty and main­tain­abil­i­ty are more im­por­tant than per­for­mance and reuse”. Uh, isn’t read­abil­i­ty a re­al­ly im­por­tant fac­to­ry in re-usability? Which means that Charles should be (and prob­a­bly is) wor­ry­ing about call­ing Ru­by code from Java, not just the oth­er way. Any­how, JRuby’s a hot­ter and hot­ter area. I watch the JRu­by de­vel­op­er newslist, which I don’t rec­om­mend un­less you’re an en­thu­si­ast; on a good day Ola Bi­ni alone can sat­u­rate the av­er­age in­box.
[1 comment]  
Building Ruby · A cou­ple of months ago, Ruby­ist world head­quar­ters over in Ja­pan was look­ing around for some­thing to run their new Sub­ver­sion serv­er on. We dug a box out of a clos­et and sent it along, and now it looks like it’s up. Jeep­er­s, that’s a ful­ly load­ed X4100, it ought to be able to han­dle the next cou­ple of thou­sand Ru­by com­mit­ters as­sum­ing they on­ly code eigh­teen hours a day or so, and with hot-swappable ev­ery­thing, so next time you type svn co ruby, it’ll prob­a­bly work.
[2 comments]  
RX + YARV · I’m in about round eight of my du­el with Ruby, try­ing to make a cor­rect automaton-based pars­er run as fast as a regexp-based one that has a ca­su­al at­ti­tude to­ward the rules. (Our sto­ry thus far here and here.) I thought I’d try out YARV, the heir-apparent Ru­by VM. [Up­date: Hah! Im­proved RX a lit­tle more.]  ...
[8 comments]  
RX Redux · Thanks to the com­menters on the pre­vi­ous RX piece who rec­om­mend­ed ruby-prof (there’s a gem in­stal­l), which is a much faster and thus bet­ter pro­fil­er than the built-in one. I learned a few more things ...
[6 comments]  
An RX for Ruby Performance · This is an in­sane­ly long and gnarly es­say about im­ple­ment­ing, then op­ti­miz­ing, the low-level bits of a pure-Ruby XML parser. If you ob­sess about XML read­ing, de­ter­min­is­tic fi­nite au­tomata, or Ru­by code op­ti­miza­tion, you may find some part of it in­ter­est­ing. There may per­haps be six peo­ple in the world who care about all three; oth­ers are warned that an at­tempt to read this end to end may lead to gen­er­al paral­y­sis and per­haps even clin­i­cal brain-death. [He’s not kid­ding. -Ed.] By way of com­pen­sa­tion, I’ve tried to be of­fen­sive wher­ev­er the op­por­tu­ni­ty pre­sent­ed. [Up­date: Out­stand­ing com­ment from Avi Bryant be­low, which he re­peats and ex­pands here.]  ...
[18 comments]  
Unicode and Ruby · I gave a pre­sen­ta­tion called I18n, M17n, Uni­code, And All That at the re­cent 2006 RubyConf in Den­ver. This piece doesn’t du­pli­cate this pre­sen­ta­tion; it out­lines the prob­lem, some con­fer­ence con­ver­sa­tion, and in­cludes a cou­ple of im­ages that you might want to steal and use in a fu­ture Uni­code pre­sen­ta­tion. For those who don’t know, “i18n” is short for “internationalization” (i-18 letters-n), “m17n” for “multilingualization”, and you can call me “T1m” ...
[24 comments]  
RubyConf · I spent Fri­day through Sun­day at RubyConf in Den­ver; a smal­l, friend­ly, ed­u­ca­tion­al gath­er­ing. The Ru­by com­mu­ni­ty is nice, and I’ve al­ready praised the tech­nol­o­gy enough; but the fu­ture is a bit opaque ...
[10 comments]  
Ruby String Walking · In prepa­ra­tion for my pre­sen­ta­tion next week­end at RubyConf, I’ve been pok­ing around at Ruby’s string-handling. One thing that text-wranglers such as me like to do is walk through a string a char­ac­ter at a time, and Ru­by doesn’t make this par­tic­u­lar­ly easy. I end­ed up im­ple­ment­ing String#each_char_ut­f8 three times along the way. [Up­date: Lots of in­ter­est­ing feed­back, and a worth-reading ruby-talk thread.] ...
[8 comments]  
JRuby News · Check out Charles Nutter’s blog for some in­ter­est­ing tech news on con­nect­ing to Ja­va. Even more in­ter­est­ing, they’ve added a new com­mit­ter to the team: Ola Bi­ni; he seems to be a cod­ing ma­chine. I’ve been gen­er­al­ly very im­pressed by the en­er­gy and in­tel­li­gence on dis­play in the mail­ing lists. Un­less I’m re­al­ly wrong, this tech­nol­o­gy has legs.
 
Red Rock Magic · If you, like me, know ba­sic Ru­by and are per­haps ready for some more ad­vanced top­ic­s, Ola Bini’s Ru­by Me­tapro­gram­ming tech­niques may be just the tick­et. The first tip, about sin­gle­ton class­es, is kind of scary and it’s a tech­nique I haven’t ful­ly in­ter­nal­ized, but the voodoo lev­el de­creas­es fast and there are a few tricks that I can use right now. I’m al­ready us­ing method­_miss­ing, any lan­guage that doesn’ t have that just seems crip­pled.
 
Making Markup Correctly · I’ve en­coun­tered three dif­fer­ent Ru­by li­braries for gen­er­at­ing markup: there’s one in the CGI li­brary, there’s Builder, and there’s Mark­a­by. To some de­gree, all are heav­i­ly in­formed by the spe­cial case of gen­er­at­ing HTML; and maybe they’re OK for that. But if you want to go fur­ther and gen­er­ate XML, they’re all point­ing in the same, wrong, di­rec­tion. Maybe I’m miss­ing some­thing, but I do have an al­ter­na­tive to of­fer. Plus, I find a chance to laugh at my­self glee­ful­ly. [Up­date: Ouch! Re­fut­ed!] [Up­date: And again, more se­ri­ous­ly.] ...
 
JRuby Love · Charles Nut­ter and Thomas Enebo, bet­ter known as “The JRu­by Guys”, are join­ing Sun this mon­th. Yes, I helped make this hap­pen, and for on­ce, you’re go­ing to be get­ting the Sun PR par­ty line, be­cause I wrote most of it. [Up­date: It strikes me that thank-yous are in or­der. Giv­en that Sun is in the pro­cess of (ap­pro­pri­ate­ly) slash­ing some of its en­gi­neer­ing group­s, new hires are a lit­tle trick­y. A lot of peo­ple helped, but I think the biggest con­tri­bu­tions were from our Soft­ware CTO Bob Brewin and es­pe­cial­ly Rich Green, who ap­proved the re­qs about fif­teen sec­onds af­ter Bob and I raised the is­sue.] ...
 
The Ruby Ape Diaries · I took tons of notes while I was work­ing on the Ape. I was go­ing to hold off pub­lish­ing till I re­leased the code, but once I ac­tu­al­ly launched the for­mal Sun pro­cess to do that, I dis­cov­ered that it can take two or three week­s, and so I de­cid­ed to go ahead while it was fresh in my mind. Un­for­tu­nate­ly, the piece pret­ty soon had fif­teen dif­fer­ent sec­tions and would have been too long for mere mor­tals with jobs to read, and fur­ther­more, the sec­tions didn’t have much to do with each oth­er, and there just aren’t that many peo­ple on earth who’d be in­ter­est­ed in all of them. Some of them look close at the is­sues of mak­ing Ja­va and Ru­by get along, while oth­ers wal­low in duck-typing per­ver­si­ty and fin­er points of Ru­by style. So I’ll keep them short and do one a day (or so) for the next week (or so) and fill a ta­ble of con­tents in here.
I. Why JRuby?
II. Back to Ru­by
III. Quack Like a URI
IV. TMTOWTDI
V. << !!
VI. Ja­va APIs from JRu­by
VII. J?REXML
VIII. Sur­face Phenom­e­na
IX. Those Li­braries
X. Mak­ing Markup
XI. Where To?

 
RAD XI: Where To? · [RAD stands for Ru­by Ape Diaries, of which this is part XI.] I think this con­cludes the Diaries, al­though on­go­ing al­ready has a cou­ple of five-part trilo­gies. The Ape works rea­son­ably well and is get­ting quite a bit of use; Sam Ru­by has con­vinced me that, rather than whit­tle away at the to-do list, I ought to fig­ure out a way to build a large cat­a­log of prob­lems and edge cas­es, test-suite style, in such a way that you can add new ones with­out writ­ing code. I haven’t yet fig­ured out how to do it. My Ru­by is still not ful­ly id­iomat­ic but it’s bet­ter than pidg­in, and there’s a re­al pos­si­bil­i­ty that the next time I get my back to a wall and need to do some­thing to a few mil­lion lines of text right now, I may not use Per­l. It should be rea­son­ably ob­vi­ous that I like Ruby. Stil­l, there are flies in the oint­men­t, worms in the ap­ple, fake jew­els in the shop win­dow ...
 
RAD X: Making Markup · [RAD stands for Ru­by Ape Diaries, of which this is part X.] If you’re writ­ing Web app­s, and even if you’re one of the few who isn’t, you’re prob­a­bly go­ing to have write code to gen­er­ate markup, HTML or XML. His­tor­i­cal­ly, pro­gram­mers have found this dif­fi­cult, and thus there are lots of li­braries that try to ab­stract markup away be­hind code (for ex­am­ple, my own Genx). There are tricky is­sues and trade-offs here, and Ru­by throws them in­to pret­ty sharp fo­cus ...
 
Spolsky Starts a Language War · In Joel Spolsky’s new Lan­guage Wars, he ar­gues that .NET, Java, PHP, and maybe Python are the safe choic­es if you’re go­ing to build out a Web app that’s re­al­ly big and re­al­ly crit­i­cal. He ices this cake with a shov­el­ful of clas­sic FUD aimed at Ru­by and Rail­s. Not sur­pris­ing­ly, David Heine­meier Hans­son vol­leys back twice with Fear, Uncer­tain, and Doubt by Joel Spol­sky and Was Joel’s Wasabi a joke? Bruce Tate has a more thought­ful re­sponse over at In­foQ: From Ja­va to Ruby: Risk. You may not agree with all of Bruce’s points, but they’re well ar­gued. It may sur­prise some who’ve en­dured the flood of Ruby-red writ­ing around here re­cent­ly, but I think Joel’s cor­rect that Python is quite a bit bet­ter proven than Ruby; and al­so that Ru­by has a big Uni­code prob­lem. But I can’t get around the fact that Joel sounds ex­act­ly like a main­frame droid talk­ing about Per­son­al Com­put­er­s, or a VMS droid talk­ing about Unix, or an EDI droid talk­ing about the We­b, or a C++ droid talk­ing about Java. Yeah, the new thing is kin­da un­proven and kin­da shaky in places and kin­da slow and not very full-featured. But it’s got ease-of-use ad­van­tages and programmer-productivity ad­van­tages and de­vel­op­ers like to use it. See the Tech­nol­o­gy Pre­dic­tor Suc­cess Ma­trix, and par­tic­u­lar­ly the last three cri­te­ri­a: Hap­py Pro­gram­mers, Tech­ni­cal Ele­gance, and es­pe­cial­ly the 80/20 Point. Joel’s prob­a­bly wrong.
 
RAD IX: Those Libraries · [RAD stands for Ru­by Ape Diaries, of which this is part IX.] Ruby’s de­bug­ging fa­cil­i­ties, com­pared to what IDE users like me are used to, are, well... sin­cere. At one point dur­ing the Ape work, I had a bug that was re­al­ly driv­ing me crazy. The symp­tom was that my HTTP in­ter­ac­tion with the serv­er would just freeze up, and I couldn’t spot the pat­tern be­hind it. It’s a fact of protocol-testing life that this par­tic­u­lar kind of shit hap­pen­s. Some­times you’re re­duced to de­bug­ging with print state­ments, and I was. But af­ter a while they weren’t help­ing me, I was call­ing Net::HTTP#s­tart on an apparently-valid con­nec­tion and then... noth­ing. Even­tu­al­ly, I was driv­en to look­ing in the li­brary source, net/http.rb. Hey, it was easy to un­der­stand! (Have I talked about Ru­by and read­abil­i­ty be­fore?) I could see where my re­quest was go­ing, but I couldn’t see how it could go wrong. Wel­l, this is a dev ma­chine, and Real Men de­bug with print state­ments. So in they wen­t... right in­to the Ru­by dis­tro li­braries, I mean. And I ran it again. On­ly took a cou­ple of min­utes to ze­ro in the prob­lem; in this case, a JRu­by bug. I’m not sure what the les­son is... but the code spelunk­ing was fright­en­ing­ly easy. This is not typ­i­cal of oth­er peoples’ HTTP li­braries; I have bit­ter mem­o­ries of bash­ing my head to a bloody pulp against LWP back in the last mil­len­ni­um. Did I men­tion read­abil­i­ty? [Ed. Note: You’ll be hap­py to hear that there are on­ly a cou­ple more RAD en­tries in the pipeline, then I’ll be done.]
 
RAD VIII: Surface Phenomena · [RAD stands for Ru­by Ape Diaries, of which this is part VIII.] Pro­gram­ming is sup­posed to be an en­gi­neer­ing dis­ci­pline, or maybe a branch of math­e­mat­ic­s. But, as Don Box mem­o­rably said: “the on­ly peo­ple who should do it are those who can't not do it”, call­ing us “those few peo­ple who ab­so­lute­ly must live in the world of ex­e­cutable abstractions”. One con­se­quence is that we’re pas­sion­ate about the con­tent and the for­m. Here­with some re­marks on ap­pear­ances; the way Ru­by code looks and how you store it and so on; is­sues as im­por­tan­t, per­hap­s, as any oth­er ...
 
RAD VII: J?REXML · [RAD stands for Ru­by Ape Diaries, of which this is part VII.] In na­tive Ruby, the de­fault way to do XML pro­cess­ing is via the REXML li­brary. In JRuby, you have an­oth­er de­fault choice—Java’s built-in XML APIs. Nei­ther op­tion is that great. Stil­l, there are some rea­son­ably safe ways to get the job done. I wrote some glue code called JREXML to make the Ja­va APIs look more like REXML, which forced me to think about this stuff per­haps more than is en­tire­ly healthy ...
 
RAD VI: Java APIs from JRuby · [RAD stands for Ru­by Ape Diaries, of which this is part VI.] The rea­son I first built the Ape in JRu­by was so I could get at all those nice Ja­va APIs, and that turned out to be a good rea­son. Of course, there is a bit of im­pe­dence mis­mach, and I end­ed up writ­ing some glue code. I kind of sus­pect that, should JRu­by catch on, there’s go­ing to be scope for quite a bit of this glue-ware. This frag­ment is just a few ex­am­ples of the gen­re, to pro­vide ex­am­ples and per­haps pro­voke thought ...
 
RAD V: << !! · [RAD stands for Ru­by Ape Diaries, of which this is part V.] If you look at Ru­by code, you keep see­ing this lit­tle two-character mo­tif <<, and maybe ev­ery­one else al­ready knew about this, but it sure feels like mag­ic to this farm boy from the Prairies. Bonus: Lisp spec­u­la­tion ...
 
RAD IV: TMTOWTDI · [RAD stands for Ru­by Ape Diaries, of which this is part IV.] That glob of let­ters in the ti­tle stands for “There’s More Than One Way To Do It”, and it comes from Perl cul­ture. It is a dis­tin­guish­ing fea­ture of Perl that if there’s some­thing you need to do, not on­ly does Perl have a way to do it, it has lots of dif­fer­ent ways. Perl’s le­gion of evan­ge­list­s, led by Lar­ry Wal­l, ar­gue that this is an ad­van­tage. Lar­ry has a com­pelling ar­gu­ment by par­al­lel with lin­guis­tic­s; nat­u­ral lan­guages usu­al­ly have many ways of say­ing any­thing that’s worth say­ing. Not ev­ery­one agrees that this is a virtue; in par­tic­u­lar, Python­istas have his­tor­i­cal­ly grum­bled. Ru­by seems to fall in­to the Perl cam­p. And now, dear read­er­s, I must con­fess to a bit of du­plic­i­ty. When I wrote RAD III: Quack Like a URI, I knew that my ex­am­ple was per­haps not the purest pos­si­ble ex­am­ple of duck typ­ing, but my hid­den agen­da, name­ly gath­er­ing ma­te­ri­al for a TMTOWTDI es­say, worked out well ...
 
RAD III: Quack Like a URI · [RAD stands for Ru­by Ape Diaries, of which this is part III.] This lit­tle il­lus­tra­tion of a pro­gram­ming id­iom is sole­ly de­signed to hor­ri­fy new­com­ers from the Ja­va world, and will look mun­dane to ex­ist­ing Ruby­ist­s. Prob­lem: I want to check a URI to make sure it’s ap­pro­pri­ate for use in the Atom Pro­to­col, and if not, re­port a co­her­ent er­ror mes­sage ...
 
RAD II: Back to Ruby · [RAD stands for Ru­by Ape Diaries, of which this is part II.] As of to­day the Ape is on Ruby, not JRuby; read on for the sad sto­ry and the Ape’s ad­dress ...
 
RAD I: Why JRuby? · [RAD stands for Ru­by Ape Diaries, of which this is part I.] To build a val­ida­tor you need an HTTP en­gine and an XML parser, both of which Ru­by is ad­ver­tised as hav­ing. JRu­by, when I first took this on, was as at re­lease 0.9.0 and had plen­ty of rough edges. But I de­cid­ed to use it any­how ...
 
On Ruby · I have pre­vi­ous­ly ad­mired the Ru­by lan­guage, al­beit from a dis­tance, and been im­pressed by the vig­or of the Rails com­mu­ni­ty. In the last week I have writ­ten a few hun­dred lines of Ru­by code that ac­tu­al­ly do some­thing use­ful and I’ll prob­a­bly re­lease (come see it at OSCON); so now I’m some­what bet­ter ed­u­cat­ed ...
 
Upcoming Gig: RubyConf · Hey, RubyConf ac­cept­ed my pa­per pro­pos­al, I18n, M17n, Uni­code, and all that. So it looks like I’ll be in Den­ver Oc­to­ber 20-22. See you there!
 
Rubies and Pearls · I’m still feel­ing my way in­to this com­ments sys­tem, but my first days with Ru­by are mak­ing me think back a dozen years or more, to when I was learn­ing Per­l. It was a big data-filtering job and Michael Leven­thal had pulled to­geth­er a very typ­i­cal Perl bundle-of-regexps and sud­den­ly one day I was pitch­ing in on han­dling more types of in­put da­ta and pulling out more struc­ture. Lar­ry Wall, the au­thor of Per­l, is a lin­guist by train­ing, and is proud of the fact that with Per­l, as with a nat­u­ral lan­guage, you don’t have to be an ex­pert to be ef­fec­tive Just as a child de­rives val­ue from us­ing English even if in­ex­pert­ly, a novice Perl pro­gram­mer starts be­ing re­ward­ed quick­ly. Other lan­guages have this char­ac­ter­is­tic to a greater or less­er de­gree; and I’m be­gin­ning to think Ru­by is right up there. (For me, Ja­va had it too, as it would I think for any ex­pert C pro­gram­mer com­fy with O-O think­ing.) At the mo­men­t, there are lots of Ru­by id­ioms that are still gib­ber­ish to me; but I find two cru­cial things: my pid­gin Ru­by is al­ready pret­ty use­ful for get­ting things done, and I’m learn­ing new trick­s.
 
Comments on Camping · Last month I said I’d make a com­ment sys­tem for on­go­ing, and I got lots of good ad­vice. Sev­er­al of the peo­ple who wrote sug­gest­ed I con­sid­er Camp­ing, so I de­cid­ed to give that a try, and start­ed to­day ...
 
author · Dad · software · colophon · rights
Random image, linked to its containing fragment

By .

I am an employee
of Amazon.com, but
the opinions expressed here
are my own, and no other party
necessarily agrees with them.

A full disclosure of my
professional interests is
on the author page.