DRYML Tour (0.6 not quite ready)

Posted about 7 years back at The Hobo Blog

Nope, sorry. No Hobo 0.6 today, but to whet your appetites a little further, here’s an example of how clean a full DRYML template can look in the new DRYML. We’re pretty happy with the result over here - hope you like it :-)

In particular, look out for the new “smart HTML tags”. These aren’t a new DRYML feature, but a new style for the Rapid tag library. They’re just regular DRYML tags that have the same name as HTML tags. Want a link?

<a href="...">My Link</a>

Want Hobo to fill the href in for you? Say, to the author of the article you are rendering:

<a:author>...</a>

How about a form? Hobo will provide the attributes that make the form work (action, method…):

<form with="&Story.new">...</form>

Want to make that an ajax form? Just name the part (or parts) you want updated and Hobo does the rest:

<form with="&Story.new" update="stories">...</form>

So, on to that full page. It’s an index page BTW:

<Page title="Admin Home">

  <intro>
    <h1>Admin Home</h1>
  </intro>

  <maincol>
    <panel>
      <h2>All Accounts by client</h2>

      <section>
        <h3>Create a new client</h3>
        <form with="&Client.new">
          Name: <input:name/>
          <submit label="Create"/>
        </form>
      </section>

      <section>
        <p>Click on a client name to edit.</p>
      </section>

      <section repeat class="client">
        <h3><editor:name/></h3>

        <Table:accounts>
          <tr>
            <td><a/></td>
            <td>Created: <view:created_at.to_date/></td>
            <td>
              <a:quarters.latest if="&this.site_exists?">View Site</a>
            </td>
          </tr>
        </Table>

        <p>
          <b>&raquo; <a:accounts.new>Create a new account for 
              <name with="&this_parent"/></a></b>
        </p>

        <delete_button label="Delete #{this.name} permanently"/>
      </section>

      <section><page_nav/></section>

    </panel>
  </maincol>

</Page>

Let’s go over that again with some explanation. First the <page> tag.

<Page title="Admin Home">

<page> is a template. That’s a new DRYML feature. Where a normal tag has a single body, a template has a bunch of named parameters, and they can be placed wherever you like in the templates output. It’s a fill-in-the-blanks kind of model. Look up at the full listing again and you’ll see that <page> has two children – <intro> and <maincol>. These are not normal tags that are being called, they are named parameters to the <page> template. Whenever you see a tag with a capitalised name, remember that the children are parameters rather than tag calls.

Next, forms. Forms are blissfully neat now in Hobo.

<form with="&Client.new">
  Name: <input:name/>
  <submit label="Create"/>
</form>

Because the context for the form is a new AR object, Hobo knows to create a POST to the relevant RESTful create method. Furthermore, if you create the object via a has_many collection, the hidden field will be included so that the created object has the required foreign key.

Also notice the new tag for form controls: <input>, and the nice syntax to set the context to a given field: <input:name/>.

There are three general purpose tags of this kind: <view> for read-only views, <input> for form input fields and <editor> for ajax in-place editors. They all create the right stuff automatically depending on the type of the context, and it’s very easy to extend this with your own types. These replace the old show, form_field and edit (we’ve realised that nouns are better than verbs - they’re more declarative).

If the context is something enumerable, look how easy it is to repeat a tag for each item in the collection:

<section repeat class="client">

A quick click-to-edit title:

<h3><editor:name/></h3>

A table with a row for each account:

<Table:accounts>
  <tr>
    <td><a/></td>
    <td>Created: <view:created_at.to_date/></td>
    <td>
      <a:quarters.latest if="site_exists?">View Site</a>
    </td>
  </tr>
</Table>

That’s a template too - <tr> is a parameter and there are others for giving a thead and tfoot. Also Note the new in-line if syntax on that link.

And finally the page navigation:

<section><page_nav/></section>

That whole section will only appear if there is more than one page.

Sweet :-)

Speaking at the Lone Star Ruby Conference

Posted about 7 years back at PJ Hyett

If you need to hone your Ruby chops prior to heading to Berlin for RailsConf Europe check out the Lone Star Ruby Conference in Austin, TX September 7-8. I was digging the city hard after visiting for SXSW and can’t wait to get back there.

Chris and I will be representing Err Free at the conference with talks entitled On Your Best Behavior: BDD in Ruby and I Built this Killer Rails site, Now What?, respectively.

I promise mine will be entertaining, with the large caveat that it’s the first talk on Saturday after what will surely have been a long night of drinking on Friday.

There’s an early-bird registration ending tomorrow night, so if you were at all interested in attending, I’d recommend doing so soon.

Speaking at the Lone Star Ruby Conference

Posted about 7 years back at PJ Hyett

If you need to hone your Ruby chops prior to heading to Berlin for RailsConf Europe check out the Lone Star Ruby Conference in Austin, TX September 7-8. I was digging the city hard after visiting for SXSW and can’t wait to get back there.

Chris and I will be representing Err Free at the conference with talks entitled On Your Best Behavior: BDD in Ruby and I Built this Killer Rails site, Now What?, respectively.

I promise mine will be entertaining, with the large caveat that it’s the first talk on Saturday after what will surely have been a long night of drinking on Friday.

There’s an early-bird registration ending tomorrow night, so if you were at all interested in attending, I’d recommend doing so soon.

Pardon the Dust

Posted about 7 years back at Shane's Brain Extension

I recently migrated this blog from Typo to Mephisto and have a few cleanup activities to perform. Markdown formatting has to be converted, sidebar stuff has to be added, and the design needs some minor tweaks to get things looking like how they did before. So sorry for the temporary ugliness.

I’ve been really busy working on client projects and trying to get my own startup launched, and therefore have been falling behind on the open source work. Thanks to those who sent me contributions to the youtube gem. I plan on making one more release before working on version 2. youtube2 will use the GData format since YouTube is changing the API to fit more with Google’s other APIs. It is slated for release later in the year.

Pardon the Dust

Posted about 7 years back at Shane's Brain Extension

I recently migrated this blog from Typo to Mephisto and have a few cleanup activities to perform. Markdown formatting has to be converted, sidebar stuff has to be added, and the design needs some minor tweaks to get things looking like how they did before. So sorry for the temporary ugliness.

I’ve been really busy working on client projects and trying to get my own startup launched, and therefore have been falling behind on the open source work. Thanks to those who sent me contributions to the youtube gem. I plan on making one more release before working on version 2. youtube2 will use the GData format since YouTube is changing the API to fit more with Google’s other APIs. It is slated for release later in the year.

A ruby API to the Ensembl database

Posted about 7 years back at Saaien Tist

"Joy to the world, lalaa la laaaa." I can finally announce that I've released the ruby API to the Ensembl core database under the bioruby-annex umbrella. Go here for the release.

What is it?
The Ensembl database stores genetic and genomic data on a variety of species: sequences of chromosomes and positions of features such as genes and polymorphisms. This data is browseable using their genome browser, but is also directly accessible if you connect to their mysql database. A perl API to that database has been available from the start and is used by the ensembl people themselves to handle the data. A java implementation (called Ensj) is also available, but I don't know the status of that one. The ruby version should provide similar functionality to the perl API, albeit for querying only and not for writing to the database.

This API is aimed at the core database. Ensembl also provides the variation and compara databases, but these are not the focus of the current API implementation.

A minimal interface to the data of Ensembl was already available through Mitsuteru Nakao's ensembl.rb library in the bioruby project, and is based on the exportview functionality of Ensembl's web interface. Although very useful, it does not give the full functionality that can be achieved by accessing the database directly.

The ruby API basically provides two things: access to the data in the database, and transformations of those data.
Access to the data. (Virtually) all tables of the database are available through ActiveRecord, with all the automated query methods associated with that ('find_by_anything_you_like'). Say you want to get the object of a transcript with stable_id "ENST00000380593", you'd do

transcript = Ensembl::Core::Transcript.find_by_stable_id('ENST00000380593')

Transformations of the data. You might have the coordinates of a gene on the chromosome, but actually want them on a contig or supercontig. This is where the Sliceable#transform and Slice#project methods come in. In contrast to the perl API, there is no Sliceable#transfer method, because my interpretation of a 'slice' is slightly different from the perl implementation. Read the tutorial for more information.

Minimal script
Any script using the API would have to these steps:
  1. require the library
  2. include the Ensembl::Core namespace (not strictly necessary, but saves typing)
  3. connect to the database
  4. start doing stuff

So for example:
#!/usr/bin/ruby
require 'rubygems'
require_gem 'ensembl-api'

include Ensembl::Core

CoreDBConnection.connect('homo_sapiens')

transcript = Transcript.find_by_stable_id('ENST00000380593')
puts "5'UTR: " + transcript.five_prime_utr_seq


How to install
The API has been released as a gem file, which you can either download from the website and install using the command
gem install ensembl-api-0.9.gem

, or export from the SubVersion repository using the command
svn export svn://rubyforge.org/var/svn/bioruby-annex/ensembl-api
This gem depends on bioruby and ActiveRecord.

UPDATE: The code has been moved from rubyforge to github. Get it from http://github.com/jandot/ruby-ensembl-api


Documentation
Check the website at rubyforge, which will show the tutorial (based on the perl version) and the rdoc documentation. In addition, there are the tests in your gem directory, plus a sample script that shows all functionality of the perl-version of the API called examples_perl_tutorial.rb.

Credits
I owe a lot to the Ensembl core team for helping me out when I was at the Ensembl site as a "Geek for a Week"...

Call for help
If anyone would be interested in improving the API, don't hesitate to contact me. At the moment, for example, projections between coordinate systems only work if they're directly linked in the assembly table, and projections of the haplotype assembly_exceptions will now raise a NotImplementedError error. In addition, it would be very useful if we could add the variation and compara databases to the API.

Hobo 0.6 - Still lots to do

Posted about 7 years back at The Hobo Blog

Quick update - tomorrow is looking a bit doubtful for a Hobo 0.6 release. We’ll try for Wednesday.

Hobo 0.6 - Still lots to do

Posted about 7 years back at The Hobo Blog

Quick update - tomorrow is looking a bit doubtful for a Hobo 0.6 release. We’ll try for Wednesday.

Episode 66: Custom Rake Tasks

Posted about 7 years back at Railscasts

Rake is one of those tools that you don't realize how powerful it is until you start using it. In this episode you will learn how to create custom rake tasks and improve them by using rake features.

Heads: Flexmock; Tails: Mocha

Posted about 7 years back at Alloy Code - Home

So I've been wavering for the past couple of days on which Mocking/Stubbing libraries to embrace for my Ruby coding. The Rails core code uses Flexmock, which is a pretty strong endorsement. The OpenID Authentication plugin by David Heinemeier Hansson uses Mocha. The community does tend to look to DHH for cues as to where to follow.

When I saw that the charity Testing Workshop at Ruby Hoedown was going to include information on mocking and stubbing, I became excited. Here was a chance to hear what some industry heavyweights thought about Flexmock vs. Mocha. Bruce Tate managed to discuss Mocking and Stubbing without explicitly naming a preference.

Then Chad & Marcel took the stage with their Test Driven Development approach to recreating Luigi Poker in Ruby. When the mocking question came up, Marcel simply replied (and I'm paraphrasing here), "Jim Weirich write Flexmock. He wrote Rake. He wrote RubyGems. We trust Jim."

Functionally, both libraries support the same operations. It comes down to a question of syntax. But since I've come from a "seat of the pants" PHP background, I don't have extensive mocking experience, so I don't already have a preferred mocking syntax.

Maybe I need to sidestep the question all together. If I switch from Test::Unit to rspec, I can just use rspec's built in mocking and stubbing libraries.

Related reading: Viget Labs "Mockfight!"

Heads: Flexmock; Tails: Mocha

Posted about 7 years back at Alloy Code - Home

So I've been wavering for the past couple of days on which Mocking/Stubbing libraries to embrace for my Ruby coding. The Rails core code uses Flexmock, which is a pretty strong endorsement. The OpenID Authentication plugin by David Heinemeier Hansson uses Mocha. The community does tend to look to DHH for cues as to where to follow.

When I saw that the charity Testing Workshop at Ruby Hoedown was going to include information on mocking and stubbing, I became excited. Here was a chance to hear what some industry heavyweights thought about Flexmock vs. Mocha. Bruce Tate managed to discuss Mocking and Stubbing without explicitly naming a preference.

Then Chad & Marcel took the stage with their Test Driven Development approach to recreating Luigi Poker in Ruby. When the mocking question came up, Marcel simply replied (and I'm paraphrasing here), "Jim Weirich write Flexmock. He wrote Rake. He wrote RubyGems. We trust Jim."

Functionally, both libraries support the same operations. It comes down to a question of syntax. But since I've come from a "seat of the pants" PHP background, I don't have extensive mocking experience, so I don't already have a preferred mocking syntax.

Maybe I need to sidestep the question all together. If I switch from Test::Unit to rspec, I can just use rspec's built in mocking and stubbing libraries.

Related reading: Viget Labs "Mockfight!"

The satisfaction of Rails

Posted about 7 years back at work.rowanhick.com

More work on XChain. In some spare hours on the weekend I implemented the basic structure of price catalogues for products. I can't tell you how long this took when previously doing it in PHP a few years back! (or even worse ASP a few years further back still). I'm sold on BDD, it was so quick to bang this out starting with the spec it first approach, mainly because all you need to do is 'rake spec', and bingo your code is tested... As follows, note code is cut down a little, but you get the picture: # A product itself does not contain any price information, it has many price's in a 'pricing' model, that is linked # to price types, eg "Standard Distributor" "Standard Retail" class Product < ActiveRecord::Base has_many :pricings has_many :price_types, :through => :pricings belongs_to :order_line end #The pricing table, not only links to a product and price_type, it also has a discount #model associated with it.. class Pricing < ActiveRecord::Base set_table_name 'pricing' belongs_to :product belongs_to :price_type belongs_to :discount end # discount linked to the pricing, and discount tables to enable volume based discounting. class Discount < ActiveRecord::Base has_many :pricing has_many :discount_tables, :order => "qty ASC" #note that I don't want to do queries every time I ask get_discount, so I just iterate over the # tables to find the discount, rather than doing a find each time. def get_discount(qty) discount_tables.each do |dt| return dt.discount_applied if qty <= dt.qty end return discount_tables.last.discount_applied end end # In order to calculate price, we need to determine the pricing model for the order (taken from price type) # then look up the unit price for the product according to the price type # finally get the discount for the volume at that price type. class OrderLine < ActiveRecord::Base belongs_to :order belongs_to :product def get_price(price_type) @pricing = product.get_pricing(price_type) price_as_ordered = ( get_unit_price * qty_ordered ) * get_discount end protected def get_unit_price @pricing.get_unit_price() end def get_discount @pricing.discount.get_discount(self.qty_ordered) end You feel like you accomplished something when you sit down to work for a few hours and you get this... ===================== rowans-computer:~/work/xchain rowan$ rake spec; (in /Users/rowan/work/xchain) DiscountTable - should be valid Discount when loading existing discount - should return a max discount of 0.25 for a quantity of 10000 - should return a discount of 1 for a quantity of 20 - should return a discount of 1.5 for a quantity of 5 - should respond to get discount - should have a discount table - should have a name - should belong to a pricing Order when finding existing order - should have a customer - should have a billing address - should have 3 order lines - should have a purchase order number - should have id = 1 Order with a single, invalid order line added - should after changing the quantity be able to be saved - should not be able to be saved as it has incorrect quantity - should calculate to a correct amount Order new draft order - should be in the order collection list - should belong to the correct customer - should have an associated user who created it - should be able to have it's address changed - should be able to be changed to a new status Order when creating a new order - should when valid and saved, have one order status history item - should be able to have an order line added - should throw an error that it doesn't have line items - should calculate return 0 dollars - should have a default price type matching customer price type - should be able to prefill an address - should default to draft status - should be able to instantiate OrderStatus using a draft order status a super user - should have a list of all available statuses OrderStatus using a draft order status with no super user - should not have all statuses available - should have a list of next available status, when flow next is false, only including itself and the next higher status OrderStatus - should be able to find standard statuses Product when using Product ID 1 - should be valid OrderLine with valid order line - should return correct discount levels (NOT IMPLEMENTED) - should after changing qty return a different price (NOT IMPLEMENTED) - should return a price of for x price type and y qty with a discountable price type - should return a price of for x price type and y qty with a non-discountable price type - should respond to get_price - should be valid Finished in 1.72758 seconds 40 examples, 0 failures, 2 not implemented

The daily miscellany

Posted about 7 years back at work.rowanhick.com

The Golden Rule Always isolate your speakers from whatever they're sitting on (be it floor, bookshelf whatever). It's just the golden rule in life. You must do it. Well, I built this new desk**, and completely forgot the rule, I was just so happy to have somewhere for these puppies to sit on. I happened upon some 8mm strips of rubbery packing foam - night and day difference, event at low volumes it makes a difference. I'm not sure the maple was really adding to music Just listening to some Ben Harper and it sounds GORGEOUS. No more annoying little bass resonances. Put on some Vivaldi and we get bone chilling clarity. Nice - that's what studio monitors are about, reproduction (this is a moment of triumph, I bought them 5-6 months ago and haven't really had a chance to *use* them until now). Of course a true audiophile might be a little horrified that sound waves are going to reflect off the desk, but you can't have it all. ** The other golden rule, never try to figure out how Ikea can sell furniture so cheaply. A long way from Paperboy.. Bioshock What a busy evening, picked up stuff for my significant other, went out for dinner, did some coding, managed to give the cats some attention, and last but not least sneaked in a few minutes of playing the Bioshock Demo. Holy sh-t. Games have come a very long way from Paperboy, and even further from "LOAD FROM A:\" "RUN" off a tape drive (yes I'm starting to feel old). What keeps me young is firing up the flat panel, powering up the receiver, turning on the XBox 360 and having a bit of good ole fun. All I've got to say with Bioshock, is I'll be very suprised if it doesn't come in a close 2nd, if not 1st with Gears of War for sales this year. It is absolutely spectacular (and this is just the demo). I was blown away from 15mins of play time, the water effects are very nice indeed. An eerie atmosphere pervades each section of gameplay. Well done. There goes my productivity for a few days...

Four Things: Ruby Hoedown

Posted about 7 years back at Alloy Code - Home

So I'm just now able to take a few minutes to reflect on my experiences at the past weekend's Ruby Hoedown in Raleigh, NC. Nathaniel Talbott and Jeremy McAnally did an outstanding job putting together the first in what I hope will be a long series of Ruby-focused events in the southeastern United States.

Rather than recap the entire conference (which has been done elsewhere by more prolific writers than yours truly), I would rather focus on four things I picked up over the 2-day conference.

Stubbing out Ruby's Time class

The pre-conference kicked off with a 2.5 hour workshop run by Bruce Tate, Marcel Molina Jr. and Chad Fowler. Chad, in particular, has been very vocal lately about the importance of developers (and particularly Ruby/Rails developers) giving back to the world. The workshop itself was a fundraising vehicle for the Food Bank of Eastern & Central North Carolina, with 100% of the workshop registration fee being donated. This is an interesting new model, and I'm curious to see where it's going to lead in the future.

So, one of the things I encounter frequently in my classes is needing to test time-specific behavior. Previously, I had been instantiating a plethora of instance variables to check edge cases for Date and Time processing in my tests. My first "a-ha!" moment of the weekend came during Bruce Tate's presentation, when he put up the following code snippet:


    Time.stubs(now).returns(groundhog_day_at_noon)

This is going to make a world of difference for me, because now I can create insular, repeatable tests regardless of the time of day at which the test is run.

VOIP has become accessible

Jay Phillips became a new hero of mine when he showed off his Ruby-based Dialplan using the Adhearsion library. After showing us a multi-thousand line Dialplan written in an obscure, telecom dialect, he switched back to his slides and showed us the equivalent code, written in near-human readable Ruby. VOIP has been one of those technologies that I wasn't really paying much attention to, but now my mind is spinning out a whole host of new telephony-enabled website applications faster than I can manage to write them down.

Driving return traffic to a website is a huge deal. Once they sign up for the account, what's the hook that keeps them coming back over and over again? What if Your Garage Online could CALL you to tell you your car was due for service, instead of simply sending you an email? Powerful stuff.

It's time to crack open those dusty C books again

Jared Richardson (who shares my agony of constantly being called "Jerry") gave an energetic talk on using Ruby's C extensions to speed up application performance. I had heard Jared speak back in January at the Rails Edge conference in Reston, VA, on Rails performance and how the search engine Cha-Cha was using Rails in an optimized fashion. This time, in between launching small boxes of candy at unsuspecting audience members, he gave us a great overview of the various methods to include C code to handle low-level, no-magic-required operations directly with our Ruby code. I actually coded along with his his presentation, and wrote more C code in 45 minutes than I'd written in the past 10 years combined.

In particular, RubyInline looks to be an incredibly useful library to write C code directly inside a Ruby class, and have it generated as needed. One caveat, which is particularly visible in the Rails spectrum, is that RubyInline's performance gains are only really visible AFTER the class has been run once and the C code compiled and cached. So, for Rails development, classes which use RubyInline should be housed in #{RAILS_ROOT}/lib, rather than directly in a model or controller, to avoid the code being recompiled on EVERY load.

The Germ of an Idea

This isn't directly something I learned at Ruby Hoedown, but more a general idea that I'd be curious to explore in the future. I've recently picked up Joe Armstrong's Programming Erlang from the Pragmatic Bookshelf. One of the most oft-repeated themes of the conference was concerns about Ruby's performance. If we eschew the idea that everything related to Ruby has to be written in Ruby (and I can thank Jared Richardson for this new mind-set), what if a version of the Ruby VM could be written in Erlang, to execute high performance Ruby in a multi-core environment?

I was sitting next to Brenton Leanhardt on Saturday, who happens to be another member of ErloungeRDU. We talked the idea over for a few minutes, and concluded that while neither of us had any solid idea how to write a Virtual Machine, the idea itself could be worth exploring. This may be a subject I return to in the future...

Four Things: Ruby Hoedown

Posted about 7 years back at Alloy Code - Home

So I'm just now able to take a few minutes to reflect on my experiences at the past weekend's Ruby Hoedown in Raleigh, NC. Nathaniel Talbott and Jeremy McAnally did an outstanding job putting together the first in what I hope will be a long series of Ruby-focused events in the southeastern United States.

Rather than recap the entire conference (which has been done elsewhere by more prolific writers than yours truly), I would rather focus on four things I picked up over the 2-day conference.

Stubbing out Ruby's Time class

The pre-conference kicked off with a 2.5 hour workshop run by Bruce Tate, Marcel Molina Jr. and Chad Fowler. Chad, in particular, has been very vocal lately about the importance of developers (and particularly Ruby/Rails developers) giving back to the world. The workshop itself was a fundraising vehicle for the Food Bank of Eastern & Central North Carolina, with 100% of the workshop registration fee being donated. This is an interesting new model, and I'm curious to see where it's going to lead in the future.

So, one of the things I encounter frequently in my classes is needing to test time-specific behavior. Previously, I had been instantiating a plethora of instance variables to check edge cases for Date and Time processing in my tests. My first "a-ha!" moment of the weekend came during Bruce Tate's presentation, when he put up the following code snippet:


    Time.stubs(now).returns(groundhog_day_at_noon)

This is going to make a world of difference for me, because now I can create insular, repeatable tests regardless of the time of day at which the test is run.

VOIP has become accessible

Jay Phillips became a new hero of mine when he showed off his Ruby-based Dialplan using the Adhearsion library. After showing us a multi-thousand line Dialplan written in an obscure, telecom dialect, he switched back to his slides and showed us the equivalent code, written in near-human readable Ruby. VOIP has been one of those technologies that I wasn't really paying much attention to, but now my mind is spinning out a whole host of new telephony-enabled website applications faster than I can manage to write them down.

Driving return traffic to a website is a huge deal. Once they sign up for the account, what's the hook that keeps them coming back over and over again? What if Your Garage Online could CALL you to tell you your car was due for service, instead of simply sending you an email? Powerful stuff.

It's time to crack open those dusty C books again

Jared Richardson (who shares my agony of constantly being called "Jerry") gave an energetic talk on using Ruby's C extensions to speed up application performance. I had heard Jared speak back in January at the Rails Edge conference in Reston, VA, on Rails performance and how the search engine Cha-Cha was using Rails in an optimized fashion. This time, in between launching small boxes of candy at unsuspecting audience members, he gave us a great overview of the various methods to include C code to handle low-level, no-magic-required operations directly with our Ruby code. I actually coded along with his his presentation, and wrote more C code in 45 minutes than I'd written in the past 10 years combined.

In particular, RubyInline looks to be an incredibly useful library to write C code directly inside a Ruby class, and have it generated as needed. One caveat, which is particularly visible in the Rails spectrum, is that RubyInline's performance gains are only really visible AFTER the class has been run once and the C code compiled and cached. So, for Rails development, classes which use RubyInline should be housed in #{RAILS_ROOT}/lib, rather than directly in a model or controller, to avoid the code being recompiled on EVERY load.

The Germ of an Idea

This isn't directly something I learned at Ruby Hoedown, but more a general idea that I'd be curious to explore in the future. I've recently picked up Joe Armstrong's Programming Erlang from the Pragmatic Bookshelf. One of the most oft-repeated themes of the conference was concerns about Ruby's performance. If we eschew the idea that everything related to Ruby has to be written in Ruby (and I can thank Jared Richardson for this new mind-set), what if a version of the Ruby VM could be written in Erlang, to execute high performance Ruby in a multi-core environment?

I was sitting next to Brenton Leanhardt on Saturday, who happens to be another member of ErloungeRDU. We talked the idea over for a few minutes, and concluded that while neither of us had any solid idea how to write a Virtual Machine, the idea itself could be worth exploring. This may be a subject I return to in the future...