Steve Yegge has posted more details on his port of Rails to Rhino and his thoughts on Rhino.
"When you start digging into Rhino, you find unexpected depth. JavaScript (unlike Perl, Python and Ruby, at least today) actually has a real specification, and Rhino follows it rigorously, aiming for complete SpiderMonkey compatibility within the bounds allowed by the different language platforms. Rhino also offers rich configurability, has well-defined multi-threading semantics, has a full set of hooks for debugging and profiling, and much more besides. There's a lot under the hood."
About building on Rhino, he says... "keep in mind that this is server-side JavaScript we're talking about, and on the JVM to boot. So libraries aren't an issue; there are plenty. And browser incompatibilities aren't an issue either - there's only one Rhino, and it works as advertised. But we've been able to go a step further and make some fundamental extensions that have made it almost Ruby-esque."
Interestingly, the example he picks is regarding the enumeration of methods and properties extending the Object and Array prototypes... "in client-side JavaScript there's currently no way to define a property that's non-enumerable, which implies that you can't add new functions or properties to Object.prototype, since they'll suddenly start showing up in your object literals (which are JavaScript's hashes, more or less). But in Rhino you just create a Java method that calls into the Rhino runtime to define non-enumerable properties, and you can extend Object.prototype to your heart's content. So we went wild, and added pretty much every interesting Ruby (and Python) built-in method on the built-in classes (Object, String, Array and the like)."
Of course, with the dontEnum method the way it's implemented in Helma, you can additionally also do this in plain Javascript. (Did this feature make it back into Rhino with the Helma patches Norris Boyd recently committed ? Not sure.)
Steve Yegge says that quite a team inside of Google has gathered by now, investing their 20% time into future Rhino development. Very Cool! I think that's probably the best news about the whole story - because on the Rails port side of the story, it seems he didn't really address the most interesting part, ActiveRecord, and they are instead planning to go in the direction of Hibernate.
He makes it clear that the project is not at a stage where it could be open sourced, and that that won't change much for at least a year. It looks like they will keep their eyes open for Rails-ish web frameworks of the likes of Helma.
Hey Steve, you can find it here: http://helma.org/ :-)
So, I think this is great news for Rhino, and as a result great news for the Helma project.
27.6.2007, 16:45