11th - 17th April 2005
Ruby Weekly News is a summary of the week’s activity on the ruby-talk mailing list / the comp.lang.ruby newsgroup, brought to you by Tim Sutherland.
Articles and Announcements
- CFP: DLS05: ACM Dynamic Languages Symposium
- Should Ruby Be Added to Your Programming Repertoire?
- A neat post on Rails & FastCGI...
Roel Wuyts posted the Call For Papers for the 2005 ACM Dynamic Languages Symposium, to be held in California in October. The deadline for submissions is June 24th 2005. “The goal of this symposium is to provide a highly visible, international forum for researchers working on dynamic features and languages.”
An introduction to Ruby by W. Jason Gilmore, the author of books on PHP and MySQL.
Tom Copeland linked to an article entitled Ruby on Rails and FastCGI: Scaling using processes instead of threads by Jon Tirsen.
User Group News
- Meetup.com changes
- PDX.rb meeting: Rails presentation
- Phoenix.rb this week
- MexicoCity.rb?
- detroit.rb
Many of the Ruby User Groups have been using Meetup.com to organise meetings. Robby Russell warned that the site was going to soon require meetup groups to pay a monthly fee.
“Perhaps this would be a good time for the community to build something (in Rails of course) for all the .rb groups that are popping up around the world.”
Phil Tomson announced a meeting in the Portland Oregon area, held on the 13th of April. The topic was Rails, presented by Lucas Carlson. Phil later reported that the talk went very well, and had around 50 attendees.
James Britt announced the Phoenix group was meeting on the 14th of April.
David Moreno Garza is looking for other Rubyists near Mexico city.
Not that close to Mexico city, but Patrick Hurley is looking for users in South East Michigan.
Threads
All Quiet on the Western Front: Is Rails overshadowing Ruby?
Trans thought that ruby-talk had become quieter in the last few months. The exception had been discussion on the topic of Rails. “So I wonder, is Ruby at risk of becoming little more than a subset techonolgy of Rails?”
Ryan Leavengood added “It is pretty amazing that a web framework could all of a sudden make Ruby so much more marketable.”
It seemed to James Britt that ruby-talk traffic had actually been steadily increasing. As far as Rails goes, “There may be some chance of Ruby “Strutsification”, where increasing numbers of people are familiar with a specific API or tool but have little understanding of the underlying technology.”
Continuing down a different path, James added that he thought the existence of RubyGems had helped Rails’ popularity, by making it easier to install.
David Heinemeier Hansson (the creator of Rails) said that it was RubyGem’s support for library versioning that made it so useful. “It’s funny, though. I remember some early discussion on RubyGems where someone pointed out that while library versioning was nice in theory, but who would _really_ want to have multiple versions of the same library installed? Hehe.”
David A. Black clarified, “You can specify version numbers in your configuration for each app, which is nice because it means you don’t have to upgrade all your Rails apps as soon as a new version of Rails comes out.”
In a related thread, NYC Meetup?, New York Rubyists discussed Matt Pelletier’s idea of creating a Rails-specific New York User Group, in addition to the Ruby-NYC group that already exists.
There was some opposition to this, and Matt decided to create a separate mailing list for Rails users, but keep going to the Ruby-NYC group. (For now?)
Really quick question - How do I convert a string to a date
Glenn Smith wanted to know how to convert a String like “13/04/2005”
into a Date.
Date.strptime("13/04/2005", "%d/%m/%Y").
Ruby Java Bridge: Are there any?
Richard Cole did query, “What’s a good way to communicate from a ruby process to Java process, SOAP? RMI? Corba? A socket? Are there any wrappers that let me go from ruby straight to the JVM presumably via the java native call interface?”
Takaaki Tateishi suggested rjb, a bridge between Ruby and Java. It allows you to use Java libraries (almost) as if they were implemented in Ruby.
Another option, proposed by David Corbin, is to use JRuby – a Ruby interpreter written in Java that “allows direct calls to Java objects”.
Madlibs (#28)
James Edward Gray II posted this week’s Ruby Quiz.
The quiz is to implement “Madlibs” – a system which allows you to specify a story with placeholders for verbs, nouns etc. The user is then asked to supply words that match the requirements and the output is a new story.
will $ for global disapears in ruby2?
Lionel Thiry asked if $ global variables would still exist in
Ruby2.
Matz replied ”$-variables will not disappear. Some of perlistic $
Locales
Stephen L Molitor wanted to know if there were any libraries for handling locale-specific formatting of time, money, numbers etc.
Austin Ziegler said that he wasn’t aware of any, but he had written some code that does similar formatting for numbers. It is included in Gavin Sinclair’sExtensions module.
Multiple asserts in a single unit test
Daniel Berger came across an article which asserted that it was bad practice to have more than one assertion in a single unit test. The idea was that multiple test failures would give you a better idea of where an issue was.
“This sparked a conversation on IRC regarding coming up with a way to have asserts continue even if one of them fails within a unit test. Is there a way to alter the behavior of test-unit so that it doesn’t bail out on subsequent asserts if one fails? Something builtin to test-unit or a simple hack?”
Pit Capitain replied “It may not be simple, but at least it’s a hack”, and included some code to enable that behaviour.
Seven new VMs, all in a row
There has been more discussion in this thread since last week. As this edition of Ruby Weekly News goes out, there are 121 posts in the thread.
There’s too much to summarise, but it’s very interesting reading if you’re into Virtual Machines. (A particular focus of the thread is Peter Suk’s plan to write a Ruby VM on top of Smalltalk VMs.)
when 1.6 != 1.6? -- newbie
Mel Bohince was confused. He had a unit test where an assert_equals
was failing with “<1.6> expected but was <1.6>”.
assert_in_delta should be used instead.
Mark Hubbart suggested reading the article What Every Computer Scientist Should Know About Floating-Point Arithmetic.
Neil Stevens noted the BigDecimal library could be useful in some
cases – it offers user-selectable precision for floating-point numbers.
BNF-like grammar specified DIRECTLY in Ruby
Eric Mahurin wrote a library that lets you to define a BNF-style grammar as Ruby code, by (ab)using Ruby’s syntax.
He included an example, noting “To get an idea of what this is, there is a simple expression evaluator example below. This is pure Ruby code – no yacc type compiling necessary. That’s what I love about it.”
Ruby and Logo?
Brian Candler was nostaligic for Logo, “a teaching language from the 80’s? Its big plus was that you could use it to drive a ‘turtle’ around the floor and draw shapes.”
He thought that Ruby would be very good for this, for example
fred = Turtle.new
fred.pendown
3.times { fred.forward 50; fred.turn 120 }
gabriele renzi found a Ruby Turtles package, which he recalled as being usable.
James Edward Gray II was interested in using the Turtle Graphics idea in a future Ruby Quiz.
What's beyond Rails?
James Toomey launched into a “Somewhat off-topic rant”. Rails and other web application frameworks are still oriented around outputting basically static HTML. “It seems to me that there needs to be a next-generation of HTML that enables web apps to truly be like rich client apps”. The idea of implementing a Photoshop-like program as a web application was given as an example.
Francis Hwang advised “There’s an inherent trade-off: Compared to desktop apps, web apps are pretty crappy interaction-wise, but you can use web apps in a lot more places. There are lots of efforts to bring more rich interactivity to web apps: Java, Flash, AJAX, XForms, even Mozilla’s XUL might count depending on how you look at it.”
Richard Kilmer is “working on implementing on open-source set of components in Flash”, using ActionStep, an implementation of a subset of the OpenStep Application Kit. From the website, “The intent is to create an open-source component framework for writing Rich Internet Applications for the Flash Player.”
Matt Pelletier gave a detailed summary of some of the options.
Several people said that REST (stateless) web applications were good, and having “rich” applications works against that.
ruby-fltk project abandoned?
Thursday found that the ruby-fltk binding was out of date. (FLTK is a lightweight GUI toolkit.)
Jeremy Henty announced that he had recently taken over the project, and would be starting to make improvements soon.
ettiquette question
Chris Pine asked “How do you spell ettiquette? No, no, that’s not really my question…”
Whenever a link to his Learn to Program tutorial is posted to the mailing list, Chris gets emails of thanks and questions. “Now my tutorial has been around for a while, but people who are new are, of course, not going to know that.”
Would it be okay to post an announcement for it every fortnight or month?
Curt Hibbs and others thought it would be good to include a number of different links in the post, not just Chris’ tutorial. Curt offered to maintain a Wiki page.
New Releases
FreeRide 0.9.4 - The Free Ruby IDE
Laurent Julliard heralded the latest FreeRide release. FreeRide is an IDE for Ruby, written in Ruby.
Two major new features have been added. The first is a Documentation plugin, which gives you context-sensitive help on methods and classes. The second is a code-template plugin.
(The Documentation plugin uses Martin Ankerl’s fxri.)
midilib 0.8.5
Jim Menard enhanced his midilib library, used for reading and writing MIDI music files and
handling MIDI event data. Bugs have been fixed and the MIDI::Track#quantize
method API has been changed.
FireRuby 0.2.2
Peter Wood updated his Ruby interface to the Firebird RDBMS. It now builds on Linux.
FXRuby 1.2.6
Lyle Johnson announced the latest bindings for the Fox GUI toolkit. A Win32 installer (and binary gem) are available for Windows, and a source gem and tarball can be used for other platforms.
KirbyBase 2.1
Jamey Cribbs enhanced KirbyBase, a pure-Ruby database management system that stores its data in plain-text files. He thanked Hal Fulton for his assistance in this release.
The API was improved, tables can be encrypted and data can be imported from CSV.
Bishop 0.3.0 - bayesian classifier for Ruby ported from Python
Matt Mower ported the Python ‘Bayesian’ classifier “Reverend” to Ruby, naming the port “Bishop”.
It includes the Robinson and Robinson-Fisher algorithms, and the trained classifier can be saved to and loaded from YAML.
fxirb 0.2.1 - gets support
Martin DeMello announced that FXIrb now supports gets, thanks to help
from Csaba Henk.
Ruby/Odeum 0.2 (More Idiomatic, Better Source Layout)
Zed A. Shaw posted “Just another announcement” for Ruby/Odeum. “Ruby/Odeum is an extension that wraps Mikio Hirabayashi’s QDBM Odeum library for fast reverse indexing of documents.”
Documentation has been improved, and bugs related to memory management have been fixed.
fxri 0.3.1
Martin Ankerl updated fxri, a GUI front-end to the RI documentation program. The layout is now “slightly slicker” and startup is faster. Version 0.3.2 was released the next day to fix a glitch.
Amrita2 1.9.4
Taku Nakajima added a couple of features to Amrita2, an XML/HTML templating library. One of the new features was partial rendering for ERB output.
How’s this for good feedback: Aredridel replied “I’d say Amrita2 is quite possibly the most brilliant templating library I have ever seen, and both the sheer pragmatism and elegance of it are both overwhelming.”
PageTemplate 2.0
Brian Wisti, with assistance from Greg Millam, released PageTemplate 2.0. “PageTemplate is a Ruby package which allows you to utilize text templates for your Web projects.”
This is a major release. The entire code base has been rewritten and there are many API changes.
Ruby Facets 0.6.3
Trans announced version 0.6.3 of the Fantastic Atomic Core Extensions (Facets). Facets is a collection of extra methods for classes in the Ruby standard library.
This release includes new methods for Array and Hash.
JRuby 0.8.1
Thomas E Enebo released JRuby 0.8.1, an implementation of Ruby in Java.
Changes include
“Some java interfaces are being adorned to quack like some ruby counterparts”,
for example java.util.List is Enumerable.