Hi, I'm Bruce Williams.

The Statesman on Rails(2008-01-28)

At the January meeting of Austin on Rails, we had a couple visitors from the Austin American-Statesman newspaper (which everyone around here just calls “The Statesman”), covering Rails’ mindshare and market penetration in the city for an article published today.

The first thing you’ll probably notice, looking at the page, is the huge Rails logo; you can even enlarge it, if you’d like. Beyond that, there’s a fairly even-handed article to read, and even a couple pictures (thankfully, the one with me hunched over my MBP hastily cobbling together the last few slides on my presentation has disappeared). If you’re interested in Ruby/Rails from either a development or a business standpoint, it’s probably worth a read.

Crazy how this little language grew up.

Austin on Rails

A lot of credit needs to go to Damon Clinkscales and the others who were around when the group first started. There’s a lot of value in actual, face-to-face, cross-company technical and social interaction for developers, and I’ve been really happy to hang around with these guys this year. This type of thing makes for a tighter knit community, a better support network, and opportunities for collaboration. If you’re a developer and you’re not taking a couple hours out of every month (or every week, with a Cafe Bedouin or ARCTAN style meeting) getting to know like-minded developers in your community, you’re shooting yourself in the foot, period.

Anyhow, a bit of code and beer never hurt anyone. Theoretically.

Welcome Back, Codefluency(2008-01-27)

A couple weeks ago I moved hosts, and while doing so put up a parking page. Life interceded, and I was down a bit longer than I would have liked, but codefluency is back up and running.

Some temporary shortcomings at the moment are, in order of importance:
  1. -The atom feed (which seems to be the way a good percentage of people pick this up)- This should be working now; it’s up at its old location.
  2. -The need to rewrite incoming links (tag articles/ on the front of those old links at the moment)- This should also be working. Let me know if you run into any bad links.
Notably, and possibly permanently missing are:
  1. Search. Most browser-based readers come here directly for a specific article, and search has been essentially unused. Google does a better job of indexing the site in any case, so if it’s needed just tack site:codefluency.com onto the front of your query, and voila .
  2. Comments. I love an active community just as much as the next guy (likely more, in fact), but I’ve always found the best type of communication of a more active (live, if possible) nature. I’ve had some great comments in the past, but the signal-to-noise ratio hasn’t been very compelling, even counting out spam. I’ve had a much better experience with those people who send a direct email, tweet, or IM (even if it’s just to say ‘hi’). If something’s said that’s worth an update to an article, it’ll happen. I’ve wrestled a bit with this, but that’s my conclusion; at least for the time being.

Now the obligatory comments on the current incarnation. Those of you that have known me for any length of time know how I feel about this website; it’s a playground, and it changes often. I had the previous design up for well over six months, which is likely a record for me. I’ll probably keep it that way.

So this time, a bit darker and content-focused. I’ve added a bit of vector art… which I’ve alternately heard called Rock Star and Maoist this time; an interesting stylistic overlap, I suppose. I’d heard comments that my old artwork looked dated, especially as it related to my hair (I’m growing it out for charity, so it’s obviously not short and spiky anymore), so this is a bit more accurate.

A quick note on the technologies used this go. I’ve opted for static pages, which is pretty refreshing for a guy who’s been up to his eyeballs in web frameworks, most notably Rails, for the past few years. I’m using Webby for generation; Tim Pease is both a good friend and a wickedly smart guy, and I really like what he’s put together. It’s built in Ruby, of course, and reminds me of the type of generation framework I wanted to write coming off of bloxsom years ago, but could never get quite right; Tim has done a much better job than I ever could. Webby comes with a rake autobuild task, which integrated with Jeremy Hinegardner’s heel and launchy projects makes on-the-fly generation a snap. Use Webby for static pages if you want something simple and straightforward.

Git and Nginx make up the rest of the toolkit; the website is actually a master repo that gets reset on update (thanks to ReinH’s suggestion and this script called in a post-update hook).

So, quick and simple is the callword for this version.

Okay, enough meta for now.

Taming Your Views(2007-12-18)

Here’s a note I should have posted a couple weeks ago..

The Taming Your Views talk I gave at the Charity Workshop for the Lone Star Ruby Conference is available at MindBites (along with the other talks filmed that night), with proceeds going to charity.

MindBites has some interesting videos (and you get some free credits when you sign up), so go have a look. Many thanks to Damon Clinkscales for putting the workshop together and handing video QA.

10 Minutes with Factor(2007-12-17)

Factor is a stack-oriented language, similar in that respect to Forth and Joy. I’ve played with both at one point or another, so when I recently ran across a reference to Factor in a recent interview with Zed Shaw, I thought I’d take a look. I’m always on the prowl for little esoteric languages, hoping to harvest new (or newly revised) approaches to software development.

First of all, some caveats. I don’t know much about Factor yet, and I’ve never been successful at implementing anything worthwhile in any stack-oriented language (not that I’ve tried); my strengths mainly lie along the OOP and functional fronts, and I haven’t really hit the “Aha!” moment yet with stacks. I do, however, appreciate the syntactic simplicity and extensibility of the idea, and hope to get there soon.

Let’s get started.

Installing Factor

You can grab binary and source copies of Factor from the website here. Make sure you download an image file as well if you’re building from source.

You can also clone the Factor repository using git, with the standard disclaimers on stability.

The GUI

As crazy little esoteric languages go, Factor comes well-dressed… with a relatively simple, but powerful GUI for interactive hacking, debugging, and code/documentation browsing. It completely puts irb to shame, of course; though there has been some work in this direction in Ruby, it sure would be nice if something similar would come standard with the language. I’m not a big fan of big IDEs that do enough work for you that you forget how to do things yourself, but give me a little hacking console any day.

Basic Concepts

The basic concept of stack-oriented programming centers around manipulation of one or more stacks. In Factor this manipulation is done via words (that sit in vocabularies), and generally a single stack is used. Let’s try a simple example using the ”+” word.

1 2 + .

The first thing you might notice is that ’+’ comes at the end. This is called Reverse Polish Notation (RPN), and though it might seem a bit weird to those of us with infix operator leanings (and backwards to PN Schemers), it makes complete sense when you’re dealing with a stack.

Let’s break the example down, bit by bit.
  1. ‘1’ is recognized as a number literal. It’s pushed onto the stack.
    • Stack looks like: 1
  2. ‘2’ is recognized as a number literal. It’s pushed onto the stack.
    • Stack looks like: 1 2
  3. ’+’ isn’t recognized as a literal; it’s a word that’s found and executed. It pops off two items from the stack, adds them (just pretend how that happens is unimportant for the moment), and pushes the result on the stack.
    • Stack looks like: 3
  4. A single period pops off an item from the stack. Think of it as returning a value.
    • Stack is now empty

Gem(2007-12-15)

Rails plugins have been a great tool to have around; just look at the amazing number of plugins that have popped up over the last couple of years; great ideas from all over the place. Plugins are so easy to put together and distribute that many people who’ve never released software before

They also have some pretty serious flaws. There’s no built-in versioning or Rails version requirements. There’s no dependency resolution. There’s no real metadata or built-in search functionality.

Syntax Changes in 1.9(2007-12-03)

I think one of the more interesting conversations that’s going to occur in the Ruby community once 1.9 is released is how we integrate the syntax (and behavioral) changes coming into the language in as elegant form as possible. Over time, the consensus (or at least conventional usage) will drive what we label Rubyesque (that is, idiomatically Ruby); what is accepted, what is absurd, what is clean, what is over-engineered, and what is far more clever than it is smart. We’ll be reforming the feel and taste of Ruby using new artistic tools.

Over time, we’re sure to see a lot of forms pop up and then slowly fade away (remember the days of def ClassName.method_name and :: method invocations?), we’ll see casual groups form (eg, the collectionists, the mappers, the private indenters, etc), and entirely new dialects pop out of the ether (Rails, anyone?) and seed the ground with fresh ideas.

This is nothing new. It’s how languages grow. Regardless of how you feel about it, Ruby is no exception.

Over the next few weeks I’m going to be switching the focus of this blog (wait, there was a focus?) to the Ruby 1.9 release, especially as it relates to the syntax changes.. since Ruby’s syntax is largely what drew me to the language, and something that continues to enthrall. This is definitely the most radical release I’ve seen so far (though it needs to be said that many of the changes are experimental), so I’m really going to dig in.

Let’s start with a few examples of experimental lambda and hash features currently in 1.9. I’ll be showing a few examples of some variants, it’s up to you to decide on the forms you like most. You might want to bone up on the changes first.

The Strategy Hash

Example: Assigning a hash of symbol keys and lambda values as various strategies to process a string.

Flavors to choose from:
  1. Traditional ‘lambda’ (let’s skip ‘proc’)
  2. Experimental arrow lambda, parameters outside (parenthesized)
  3. Experimental arrow lambda, parameters outside (bare)

Note that I’m syntax highlighting the following examples partially because I know it won’t work correctly (since coderay currently only supports on 1.8 syntax).

strategies = { :simple => lambda { |item| item.capitalize } }
strategies = { :simple => ->(item) { item.capitalize } }
strategies = { :simple => -> item { item.capitalize } }

The arrow variants look [at least] a little less ridiculous with the special symbol-key syntax:

strategies = { simple: lambda { |item| item.capitalize } }
strategies = { simple: ->(item) { item.capitalize } }
strategies = { simple: -> item { item.capitalize } }

The Filter List

Example: Now let’s toss some text filtering lambdas into an Array, using the various flavors.

filters << lambda { |item| item.capitalize }
filters << ->(item) { item.capitalize }
filters << -> item { item.capitalize }

Whoa, love the opposing directions there.

Let’s push multiple arguments now:

filters.push lambda { |item| item.capitalize }, lambda { |item| item.reverse }
filters.push ->(item) { item.capitalize }, ->(item) { item.reverse }
filters.push -> item { item.capitalize }, -> item { item.reverse }

These filters would be fun with inject & the new experimental .() version of call/[]:

filters.inject('hey!') { |res, filter| filter.(res) }
# => "!yeH"

In parting, a bit of clever code (note Enumerator, Lambda syntax, single block parameter, alternate call syntax).

3.times.inject(-> { -> { -> { "Hello, #{RUBY_VERSION} World!" } } }){ |_| _.() }

There’s a lot more to cover, obviously, but that’s enough for now.

It's time to play with 1.9(2007-12-02)

With Ruby 1.9 just around the corner, it’s time for you to start playing with it. While you’ll want to keep any production apps you have chugging away happily on 1.8, don’t shoot yourself in the foot by not keeping up.

  1. Read the CHANGELOG, so you know what to expect (or read the overview at eigenclass).
  2. Install it alongside 1.8; here’s my method:
          svn co http://svn.ruby-lang.org/repos/ruby/trunk ruby1.9
          cd ruby1.9
          autoconf
          ./configure --prefix=/usr/local --program-suffix=1.9
          make
          sudo make install
  3. Try something ridiculous, just because you can: ruby1.9 e ‘>(t){ puts t }.(“This is Ruby 1.9!”)’
  4. Build something with it, post some examples (I certainly plan to), and see what other people have to say
  5. svn up, rebuild, and reinstall as we approach the Christmas release

There’s a lot of great features and syntax changes in this release; I expect we’ll see a lot of patterns (and anti-patterns) pop up as the community plays with 1.9. This is the first release with significant syntax changes since Ruby became popular—in the past the number of people using Ruby was smaller by several orders of magnitude… so it will be interesting to see how, or if, a general consensus can be reached.

Ruby.framework(2007-11-03)

A few articles ago I talked about re-building Ruby on Leopard (instead of using the provided Ruby.framework).

A couple days ago, I switched back to the framework to play around and have been using it instead—and after Laurent’s talk tonight I’m 100% certain it was the right decision.

Absolutely amazing.

RubyConf 2007 Designs(2007-11-03)

If you have a blog and are writing up an article on RubyConf, feel free to use the official conference artwork, which was used as the basis for this years’ t-shirts and badges. _If you need another format, feel free to ask.

Personal milestone: With RubyConf 2005-2007 and RailsConf 2006-2007 t-shirt designs under my belt, I’m pretty proud that I can now wear one a day, 5 days a week… though they’d probably wear out pretty quickly…

Drinks at RubyConf(2007-10-31)

My employer and BlueBox Group are graciously holding the bar open at Arpa after the RubyConf keynote. Obviously they’ll cap us at some point… but let’s make that happen, shall we?

No agenda + free drinks. See the official announcement and réservez s’il-vous-plaît if you have a moment (so I can gauge my planned intake).