Stupid uComics!

My comics.rb script had failed to get my daily dose of Calvin and Hobbes in my RSS aggregator for a couple days, so I decided to check it out a few minutes ago. It turns out that the problem is that UComics now display the strips with Flash 8. So basically, my script which looks for an IMG SRC came back with nothing. That sucks, I have now removed C&H from my list of morning strips. Let’s hope other comic sites do not follow suit.

Ruby Summer of Code 2006

I was reading the page about Summer of code at Ruby Central to see which project I thought were interesting and which would be most benificial to Ruby. Here are some that caught my attention

A suite of Ruby refactoring scripts

These scripts would allow some refactorings like those found in the Smalltalk refactoring browser (rename a class, module, method, instance variable for isntance). Scripts would be a good idea because Ruby is a text-file based language and as such, different people use different editors: Emacs, vim, Scite, TextMate, etc. Building these features into a specific editor/IDE would only benefit the users of that editor, not the Ruby community as a whole. I’m not sure however if it should be a bunch of little scripts or just one big script that encompasses them all (or maybe a control script that calls the smaller scripts).

A Ruby code browser (à la Smalltalk)

Anyone who as worked with Smalltalk knows how nice the code browser is. You can view methods one by one, have a list of all the methods called in a particular method and go to their definition, etc. This would be a nice tool to navigate a Ruby project. Having an editing pane would be nice too.

Work on YARV

Some people call Ruby slow. YARV is an excellent project to shut those people up. YARV would also benefit the little Rails shop: if you have a faster language that can handle more clients at once, you don’t need as many servers in your farm. Therefore, a faster language can help reduce infrastructure costs.

An official GUI

New users are often asking on ruby-talk “Which GUI should I use?” QtRuby? wxRuby? FxRuby? Tk? There’s a lot of choice and people differ on the right answer to this question. If the Ruby community was to settle on one graphical user interface and make sure it’s easy to program, we could probably attract more people in the community.

Dave Anderson writes about Ruby’s epoch problem, and how in 2038 the epoch clock will go back to 1970. This is not only a Ruby issue, this is a UNIX issue and all languages who use a 32 bit integer as their system’s epoch. C, C++, Java, Ruby, Python are all affected by this bug. Using a 64 bit integer would mean that dates can go up to December 4th 292,277,026,596 15:30:07. I think it’s fair to say that we’d be okay for a little while, right?

Dave Anderson writes about Ruby’s epoch problem, and how in 2038 the epoch clock will go back to 1970. This is not only a Ruby issue, this is a UNIX issue and all languages who use a 32 bit integer as their system’s epoch. C, C++, Java, Ruby, Python are all affected by this bug. Using a 64 bit integer would mean that dates can go up to December 4th 292,277,026,596 15:30:07. I think it’s fair to say that we’d be okay for a little while, right?

Dave Anderson writes about Ruby’s epoch problem, and how in 2038 the epoch clock will go back to 1970. This is not only a Ruby issue, this is a UNIX issue and all languages who use a 32 bit integer as their system’s epoch. C, C++, Java, Ruby, Python are all affected by this bug. Using a 64 bit integer would mean that dates can go up to December 4th 292,277,026,596 15:30:07. I think it’s fair to say that we’d be okay for a little while, right?

Okay, so Vim 7 has just been released. What do I do, what do I do? Do I keep using Emacs and the extremely cool power to customize everything with a cool cool programming language (Lisp) or do I use the latest power editor, the one with the only sane keybinding on this planet? Ooh, I don’t think I’ll be able to sleep tonight!

Okay, so Vim 7 has just been released. What do I do, what do I do? Do I keep using Emacs and the extremely cool power to customize everything with a cool cool programming language (Lisp) or do I use the latest power editor, the one with the only sane keybinding on this planet? Ooh, I don’t think I’ll be able to sleep tonight!

Okay, so Vim 7 has just been released. What do I do, what do I do? Do I keep using Emacs and the extremely cool power to customize everything with a cool cool programming language (Lisp) or do I use the latest power editor, the one with the only sane keybinding on this planet? Ooh, I don’t think I’ll be able to sleep tonight!

Ruby blocks performance

Don Box asks a question regarding Ruby blocks:

What’s the performance penalty for passing/calling a block vs. executing the code “directly” on the current frame? Does the cost go up/down if the block doesn’t reference any symbols in the enclosing frame? I know the answers for the CLR and C#, but I’m not sure my intuitions from that environment apply here.

First, let’s see how blocks fare compared to methods:

>> require "benchmark"
=> true
>> def meth
>>   nil
>> end
=> nil
>> block = lambda { nil }
=> #
>> Benchmark.bm { |r|
?>   r.report { 100000.times { meth } }
>>   r.report { 100000.times { block.call } }
>> }
    user     system      total        real
    0.047000   0.000000   0.047000 (  0.047000)
    0.234000   0.000000   0.234000 (  0.235000)
=> true
>>

A little slower, but not that much. However, the real advantage of blocks is not their performance, it’s that they can be inserted pretty much anywhere. You can tack them onto collection operations, file operations, etc. You don’t need to choose a name, they’re anonymous, and you don’t need to go create another method and then come back to what you were writing. Your flow is less affected. And that’s the true power of blocks, making you go on with your code without jumping around your code.