(permanently in beta)

Ruby

Monads Are Not Metaphors

27 Dec 2010

This article is also available in Japanese.

I am about to break a promise. Almost three years ago, I promised myself that I would never write an article about monads. There are too many such articles already; so many, in fact, that people are often confused by the sheer proliferation. Everyone seems to have a different take on the subject, meaning that those attempting to learn the concept for the first time are stuck trying to reason out the commonalities between burritos, space suits, elephants and desert Bedouins.

Integrating Scala into JRuby

29 Sep 2008

More and more projects (especially startups) have been choosing to build their software in multiple languages. Rather than using SQL for the database, XML for the RPC and Java for the everything else, companies have learned that sometimes a different language can serve best in a specific area. Ola Bini provides some guidance with regards to methodology in this area in the form of what he calls "language layers". He suggests that an application can be divided logically into separate layers, and for each of these layers there exists a class of language - be it dynamic, static, compiled or otherwise - which can best accomplish the task at hand. All of that aside, there is one problem which is absolutely assured when dealing with polyglot programming: integration between the languages.

Implicit Conversions: More Powerful than Dynamic Typing?

15 Sep 2008

One of the most surprising things I've ever read about Scala came in the form of a (mostly positive) review article. This article went to some lengths comparing Scala to Java, JRuby on Groovy, discussing many of its advantages and disadvantages relative to those languages. Everyone seems to be writing articles to this effect these days, so the comparison in and of itself was not surprising. What was interesting was an off-hand comment discussing Scala's "dynamic typing" and how it aids in the development of domain specific languages.

Pipe Dream: Static Analysis for Ruby

30 Jun 2008

Yes, yes I know: Ruby is a dynamic language. The word "static" is literally opposed to everything the language stands for. With that said, I think that even Ruby development environments would benefit from some simple static analysis, just enough to catch the really idiotic errors.

JRuby Interop DSL in Scala

24 Mar 2008

JRuby is an amazing bit of programming. It has managed to rise from its humble beginnings as a hobby project on SourceForge to the most viable third-party Ruby implementation currently available. As far as I am aware, JRuby is the only Ruby implementation other than MRI which is capable of running an unmodified Rails application. But JRuby's innovation is not just limited to a rock-solid Ruby interpreter, it also provides tight integration between Java and Ruby.

XMLBuilder: A Ruby DSL Case Study

10 Mar 2008

XML is probably the most ubiquitous and most recognizable format in the modern development landscape. It's simple power in representing hierarchically structured data has made it the standard for representing everything from Word documents to databases. It's also one of the most verbose and meta-rich syntaxes known to man.

Adding Type Checking to Ruby

6 Feb 2008

What's the first thing you think of when you consider the Ruby Language? Dynamic types, right? Ruby is famous (infamous?) for its extremely flexible type system, and as a so-called "scripting language", the core of this mechanism is a lack of type checking. This feature allows for some very concise expressions and a great deal of flexibility, but sometimes makes your code quite a bit harder to understand. More importantly, it weakens the assurances that a certain method will actually work when passed a given value.

The End of the Ruby Fad?

23 Jan 2008

Well, it's a new year; and apparently no sooner are the resolutions forgotten and the hangovers behind us then the internet en mass decides that we need a new language. Ruby was indisputably the hip language of 2006 and 2007. However, in an opinion shift so sudden as to make one's head spin, the blogosphere seems to have rebelled against the hype and gone in search of a new mistress.

JRuby Event Proxy

18 Feb 2007

One of the things which really which annoys me about JRuby is the lack of a clean syntax corresponding to Java's anonymous inner classes. Now, Ruby has a neat little syntax trick called blocks. It really would be the ultimate solution if you could use Ruby blocks in things like Java event listeners instead of subclasses. Here's a quick example: