Monday, June 25, 2007

Google Clones Rails In JavaScript

One of the first talks that I went to at Foo Camp was called "Google Rails Clone" by Steve Yegge. With a title like that, how could I resist?

Google uses four different programming languages: C++, Java, Python, and JavaScript. Apparently, nobody likes writing web front ends in Java, not even Google who has a lot of web front end code in Java.

In an effort to increase developer productivity at Google, Steve tried to convince the company to adopt Rails (and consequently Ruby) as a programming language. When that fell on deaf ears (Google really does not want to increase the number of languages that must be supported by their infrastructure), Steve decided to do what any other frustrated programmer would do: he ported Rails to JavaScript. Line by line. In 6 months. Working 2000 hours. Steve is a coding stud.

Holy crap. (via Ruby Inside.)


  1. Wow. Now that's devotion! I'm altogether too lazy for that, but impressed anyway.

  2. He didn't have to do activerecord, apparently, and (imho) that's the biggest part of rails. I don't actually know that for sure, but that's the feeling I get.

  3. Hmm. Appears there was an update.

    Off the top of my head, I'm not sure. I do know it remains a nontrivial effort without AR. The real question there is the meaning of big. Lines of code? Or difficult?

    I ported essentially all of ActionView, ActionController and Railties, plus a teeny bit of ActiveRecord, although for the most part we were already constrained in how we talk to our backends. Long-term, I think the story is going to be Hibernate.

    There you go. (Still probably enough to keep a programmer busy!)

    But this:

    I didn't use a code generator, since I've never met one that I liked.

    He never met a code generator he liked? What about the one he ported? Code generation is the core of Rails' JavaScript strategy, and it's pretty obvious that it's a strategy with upsides. I don't understand that statement.


Note: Only a member of this blog may post a comment.