Thursday, August 28, 2008

Lambda is your friend

I've been doing this IT thing for a while now; and I'm about to make a major transition. January 2006 I transitioned from the master ninja Unix sysadmin to the newbie Java developer. It wasn't an easy transition, but I made it. I had a lot of help, mainly from the tech lead on our project, a great guy and excellent developer. But after two and a half years, I'm tired of the Java developer world. It's not so much that I find it hard (it's not), but it's just that it's not where my passion lies. I still have trouble articulating this idea, but I prefer Getting Stuff Done (TM). It's not that I don't respect Java developers (well, I don't respect a lot of them, but that's the nature of anything with huge market share), it's just not a field I find myself passionate about.

So I'm going to a new job soon, returning to the life of Getting Stuff Done (TM). I'm very excited about it.

I think the whole Getting Stuff Done (TM) approach is why I love Perl so much. I use Java at work: it's what I'm paid to do. But when I have a problem that needs to be solved on my own systems, I use Perl. I can solve the problem in Perl in the same time it takes me to write all the boilerplate code in Java.

It's not that Java's bad, it's just that Java isn't good at Getting Stuff Done (TM). I realized in the last 12 months that all Java projects eventually grow into large frameworks. The word "framework" describes Java like "regex" describes Perl or "list" describes Lisp or "pointer" describes C. Java is plagued by thousands of huge frameworks that get stacked on each other, each containing hundreds of classes or interfaces, none actually Getting Stuff Done (TM).

When I tell people I know Java, they want to know which frameworks I use: no one really programs Java, they program collections of frameworks. Our stack involves Hibernate and Spring, so potential employers get excited about that: I guess the Hibernate + Spring stack is a popular one.

Don't get me wrong: I've seen good Java code, and I've written both good and bad Java code; some of it even does the job fairly efficiently. But it's a language that lends itself to Yet Another Framework, rather than a language that lends itself to Getting Stuff Done (TM).

Perl lends itself to Getting Stuff Done (TM).

That's not to say Perl doesn't have its own problems. Much like the Java culture has evolved to produce zillions of frameworks, none of which actually form a complete application; Perl's culture has evolved to produce billions of lines of unreadable code that only the Perl parser has any hope of understanding. And as one friend pointed out: people write bad Perl because they can. So far, the Perl community has been more impressed by obfuscated code than appalled: so Perl newbies learn terrible habits that any other language's community would quickly humiliate them out of.

But Perl's no mean language: it's actually possible to write very elegant and efficient code in Perl; it's just not emphasized by the Perl community like it is in most other communities. Dominus' Higher-Order Perl is a great example of someone looking past "quick and dirty" to "incredible potential". I hope to see many more books like it.

But after writing a lot of code in projects from simple short scripts, to various Java applications, to C plugins, to fairly monstrous Perl and Python programs; I've settled on what I think is my favourite language: Scheme. I've been using Gambit for a while now, and I'm finding it's a very simple, clean, elegant language. But best of all, it's a great language for just getting out of your way and letting you get the job done.

To be sure, I've used a lot of the Gambit extensions, so I'm not at all programming in "pure Scheme"; but the extensions I've been using are also included in most of the Schemes I've seen out there, so I think my code is fairly portable, if not actually standards-compliant.

Gambit also supports hygienic (define-syntax) and non-hygienic (define-macro) macros. That's a huge deal.

But after mucking with Scheme for the past four or five weeks in my spare time; I'm finally seeing the truth in what a lot of old Lispers used to say: the simple syntax (or lack thereof) lets you see the code, not just the syntax. And it's amazing how easy it is to make things happen in Scheme, although it takes a very different mindset from standard Algol derivatives.

Funny thing is, I started trying to learn Lisp maybe five years ago now. But I kept seeing it in little pieces: seeing how cool any one feature is, but never able to combine them all into a working piece of usefulness. But like others have said, with some practice, it suddenly clicked, and I'm writing genuinely working code.

It's all very cool.

I still find Common Lisp a strange entity: it puts all the power in the known universe at your fingertips, but I find it hard to get things done in it. That seems weird when I'm extolling the virtues of Scheme (they are very close cousins, after all); but I still find solutions tend to flow from my fingers in Scheme. In CL I find myself thinking around problems too frequently.

Part of that is CL's insane number of options: accessing a file system in Common Lisp is not a simple task. And that complexity bleeds into my code too. Perhaps my problem is that the Scheme implementations I've tried are better implementations than the CL implementations I've worked with.

But I'm not trying to fan the flames of the infighting between Schemers and Lispers here: I'm just happy to have found a great language to work in.

Tuesday, August 26, 2008

Cat's out

Well, the cat is officially out of the bag. I have accepted a job offer in Tacoma, to start when my current support contract comes to a close. It entails a significant pay cut from what I make right now; but it looks extremely interesting, and the work environment appears to be first-rate.

My current customer/employer is unhappy with this decision, but I've let them know six weeks in advance that I'm disinterested in renewing my contract. I'm a contractor, not an employee; so the work relationship is always a little odd. I figured the fact they had me interviewing replacements indicated it was their intention for me to leave in the foreseeable future, but that's not apparently the case. Ah well... I'm well within the terms of the contract, and I've been more than patient with their unwillingness to commit in writing to maintaining our relationship past September; so I'm leaving with very little guilt, although I've enjoyed working on this project.

At any rate, I've been quiet about this turn of events on my blog, for obvious reasons. But now it's public knowledge, so I thought I'd mention it.

I've been a bit of a job-hopper in my adult life, but I never really intended it to work out that way. Every job is the one I want to be my last, but that's never how it works out. I did have the perfect job once, but economics made me leave: I was commuting 100 miles to work, and sleeping on my brother-in-law's couch a couple nights a week. Our house simply wouldn't sell, and I eventually had to realize it was an untenable situation.

Too bad: that was an incredible place to work, and I still keep up with the people there. I wonder how many people have had a perfect job and had to leave?


So I'm hoping this new job is the one, but obviously that remains to be seen. I've learned not to try and recreate something that was wonderful, but I have to admit a certain excitement based on some similarities to the perfect job that I see in this new place.

Monday, August 18, 2008

Smokin'

So this weekend was the first BBQ in the new place. Oh, we've been grilling, but this weekend we did a slow-cook on the grill for somewhere between 5 and 7 hours.

I love slow cooking, so I've been keeping an eye out for cheap cuts of appropriate meat. I stumbled on some reasonable prices at Fred Meyer, so I brought home two packets of meat:

Beef ribs:


and country-style pork ribs:


Barbecue can dry out the meat, so I always start by covering them in cheap yellow mustard, garlic powder, salt, pepper, and paprika. I first heard of that from a friend who made incredible ribs. I've altered the style a bit from his technique: he used brown sugar, for example, while I avoid putting anything sweet on meat I'm barbecuing until it's done.



It might be interesting to note that I can't stand mustard. Or ketchup. I have a serious food aversion to ketchup: the thought of eating it nauseates me. I only use mustard to prep meat before cooking.


The real key to BBQ is to keep the temperature steady. You want to keep it somewhere between 200F and 220F for several hours. That's difficult to do over charcoal, but 90% of good barbecue is temperature.

I have a remote wireless thermometer, which makes monitoring it a lot easier. But however you monitor your temperature, that's the most crucial part to barbecuing.


My efforts to maintain a constant temperature sometimes get comical. My grill was too hot closed, and too cool open: so I improvised with a piece of wood. This technique worked fairly well:




Once the meat has been cooking a bit, it needs basting. Low cooking temperatures do a lot to prevent drying the meat, but even at 200F, the meat will get dry unless it's basted to replenish moisture. I use a mop sauce loosely based on Smoky Hale's "Eastern North Carolina Basting Sauce" on p. 245 of The Great American Barbecue and Grilling Manual. My version of this sauce is a little different than Smoky's, but I think mine gives a more rounded flavour. And mine reminds me a lot of the sauces I've actually eaten in eastern NC. Here's my mop sauce:
2 C. water
1 1/2 C. white vinegar
1/2 C. apple cider vinegar
1 T. crushed red pepper
1 1/2 T. salt
2 t. black pepper
1 T. garlic powder
2 T. paprika
Just mix all that up and you've got a basting sauce.


Part-way through the cook I had to stoke the fire, so I used the hibachi as a burn pit. It worked very well.


Then, after several hours of basting, the meat was cooked. I covered it in something sweet and sticky (cheap Kraft BBQ sauce cut with my baste to make it spread better), and left them to caramelize a little:



After a couple coats caramelized, I took them inside:


The verdict? Not too bad. The beef ribs were a little bony: slim pickings. But the flavour was all there, and the pork was definitely decent.

Next project: Boston butts. Time to bring some BBQ to the West Coast!

Thursday, August 14, 2008

Tripping Teresa Day

August 14 is an important day for us: it's my baby sister's birthday.

My baby sister is one of my favourite people, for all that I haven't seen her in a few years. In fact, I just recently saw my older sister for the first time in 7 years... there seems to be a pattern here.

Gwen's clever and witty: I try to keep up with her, but truth to tell, I can't. To misquote Blackadder, she's as witty as a very witty person who enjoys good wit.

We used to be good buddies at one point. Not that we're enemies now or anything, but the course of life tends to affect one's relationships just as it affects one's waistline. We're no longer found bombing around in my old VW Rabbit or a Cessna 152. We don't rise at 4:30 to go fishing in Dad's canoe like we used to.

But although I rarely see her in real life, I certainly hold her in the same affection as then. And I suspect a great deal more respect.

So many happy returns, Gwennie. I look forward to seeing you again in real life when the days get shorter.

Tuesday, August 12, 2008

The One True Cross

I've been playing with Scheme, and have (almost reluctantly) concluded that Gambit Scheme might be the One True Cross.

If you've not played with Scheme, it's a reasonably minimalist Lisp dialect characterized by a single namespace (functions and variables share single namespace) and lexical scope (variables are bound as they are defined, rather than as they are called). Scheme is Lisp, with all the complexity and magic that implies.

I started playing with Scheme a little when reading The Little Schemer this last spring; but I wasn't in love with it enough to actually try using it. But in the last three weeks, I have suddenly found myself playing more and more... and actually getting useful code written!

I've been using Gambit, which is a Scheme renowned for its abilities in massive concurrency and parallelization. In English, Gambit is very good at allowing a programmer to spawn a number of autonomous computations that occur more or less simultaneously. So instead of doing A, then B, then C; Gambit lets you do A & B & C, all at once.

But Gambit's real strengths for me lay in three lesser-touted features:

  1. Gambit has simple and powerful hooks into the host operating system. This is a major deal after trying for ages to get something close to usable out of Common Lisp for day-to-day hack scripts. See, in the end my life is rather dull: I don't need to encrypt huge amounts of data or write a new programming language nearly as frequently as I need to back up files or directories on my laptop. Common Lisp makes it easy to do the former, not so easy to do the latter. But Gambit steps in with some simple functions like file-exists? or directory-files to test for file existence or find directory contents, respectively. It was very simple to write Scheme equivalents to the Perl commands I use the most (-x, -d, etc.) and suddenly Gambit was teaming with admin scripting potential!

  2. Gambit has a script mode. So instead of starting up a REPL, loading some files, and throwing off complex-looking commands; Gambit lets me start a file with something like #!/usr/bin/gsi-script and get stuff done.

  3. Gambit can compile Scheme code to C, thence to native binaries. This is a major win, because it means I can write something in Scheme, compile it and distribute it as native code, and the end user has no idea what language it was written in. Best of all, a script can be run via gsi-script until it seems stable, then it can be compiled to C and thence to binary without further ado. They can be tested as scripts, and compiled when they pass testing.



One more thing, Gambit's fast: recursive directory tree walks are like lightning. I've been using a simple backup program I wrote in Gambit, and it zooms through copying my data.

But I'm starting to figure out what others have hinted at: Lisp (and Scheme) is more of a phenomenon than a programming language. You don't just learn Scheme; you explore it. And as you explore it, you start to slowly see the depths of potential that your computer doesn't know it has. Scheme becomes a road to enlightenment, not a language to make computers do stuff.

Monday, August 11, 2008

House Warming

So we had our first cook-out in the new digs. Our place is still stacked with boxes, we still have very little open floor space; but we had the privilege of some guests this last weekend.



But let's get the backstory first.

When we left the house in January, I had to part with my grill, as we couldn't "cook with open flame" in the apartment. Some wonderful friends agreed to grill-sit in exchange for use of it for six months; and my grill spent several months at a friend's house. We went over and cooked for them on it twice, but I have to admit I've missed my grill.

When we were in BC last month, I bought a small hibachi to use at the beach or the lake, and it was worth every penny of the $21.95 it cost me at Canadian Tire:


It looks a little rusty: that's new after being caught in a rainstorm (we have those in the Northwest). The problem with grilling on charcoal: ash is very caustic once it gets wet. Ash + Water = Lye.

At any rate, I got my grill unpacked, reassembled, and polished on Thursday or Friday. So it was a tearful reuniuon

Notice the shelf under the grill is still dirty. I need to get that cleaned. But the stainless is pretty shiny.

So Saturday KingJaymz and his Queen came to visit. They bore gifts, including a bottle of Old Viscosity Ale and a Stumptown Tart. Neither bottle made it through the night. (No, it wasn't a drunken rout, we had a nice long visit and got thirsty a couple times.)



But the main event, of course, was meat. Saturday as Bone-In Ribeye Day.




Good food, good drink, good company. Saturday was a good day.



Update: I can't help notice KingJaymz' account of the visit is so much more meaningful and kinder than mine. I discuss the grill, beer, and meat; while he talks about how nice we are. I'm tempted to edit my post heavily, but I think that would blur the reality of the situation: he's obviously a better man than I.

Saturday, August 9, 2008

Welcome home

Well, we're in our new home in the Tacoma area. The house is piled high with boxes, there is a POD in the driveway, and the kitchen is almost unusable. In other words, we're moving in.

The unload & unpack went remarkably well: the POD arrived at 7:00 AM, and it was empty by 10:00 PM. Not too bad.

I have my grill back, I re-assembled and polished it; then loaded it up for its inaugural cook: chicken leg quarters. I have a history with chicken leg quarters, it was 18 chicken leg quarters that caused the Great Fireball wherein I reduced the venturis from my gas grill into molten metal and ended up with some interesting objects:



The chicken leg quarters did very well over charcoal, and turned out not too badly. But I still have deep respect for chicken leg quarters.

A friend told me yesterday that Anthony Bourdain summed up the Pacific Northwest with "obsession". A quick Google search suggests that's true, but I've been unable to find the original quote. Nevertheless, it is an extremely apt description.

I don't think Vancouver Island is characteristically obsessive---certainly not like Seattle or Tacoma---there is a very different culture and sense there.

But at least in the Puget Sound and Olympic Peninsula areas, obsession is rife. Ames and I travelled down to Tacoma from the Island for some business a couple weeks ago, via the BlackBall Ferry, which runs between Victoria, BC and Port Angeles, WA. Port Angeles is a very interesting town---I regret it's so close to home, as I'll likely only ever go through it, rather than stopping and exploring it. One thing one notices about Port Angeles is, every restaurant---without exception---advertises "Espresso". You see signs "Soup and Espresso," "Burgers and Espresso"... the combinations get quite interesting. Even here in the Tacoma area, we've seen a stand advertising "Hot Dogs and Espresso".

The cliche that there is a Starbuck's on every corner isn't far off. One intersection a few miles from the new house has a Starbuck's, an independent coffee shop, and a grocery store advertising an in-store Starbuck's kiosk. Literally all on one intersection. Every strip mall seems to have an espresso stand (generally not part of a chain) in the parking lot in addition to coffee shops (Starbuck's or otherwise) in the mall itself. A couple of the espresso stands have prominent signs advertising they're open 24 hours. Because you never know when you'll need an espresso at 3:00 AM...

These people are obsessed.

And the coffee obsession is not unique. There are at least a dozen teriyaki restaurants within 6 miles of our new house. Teriyaki and noodles, teriyaki and burgers... if you can eat it, you can find a place that serves it and teriyaki within ten miles of our place.

But despite the gentle laughs we've had at our new home and its residents, I'm honestly enjoying my time here. I have to admit I moved here somewhat reluctantly---I was wanting to be a good deal further north and less urban than where I am---but I am thoroughly pleased with our new city.

We'll be taking pictures and so on soon, but we're still in the throes of moving, so both my loyal readers will have to wait.