« Scorpio on Digg | Main | What Google knows »
June 03, 2007
Ruby, PHP in CF
Ruby, PHP in CF: If I'm understanding this correctly, Sean Corfield shows how Adobe ColdFusion 8 (Scorpio) can process instructions written in Ruby or other languages. It does so by invoking the Java 6 language engines, such as Quercus for PHP. (ColdFusion can be seen as a set of libraries atop Java, so we're calling in a peer library for the Ruby processing.) This sounds similar to Microsoft's recent announcement of the Dynamic Language Runtime for their Silverlight browser plugin, but with a difference in what-gets-processed-where... the DLR processes external languages on each client machine, while in Sean's experiments it sounds like the PHP instructions are processed when the page is served, or compiled for cached serving. I don't yet know whether there's any meaningful performance hit for calling out to another Java library, or what effects this external processing would have on the data model. But it sounds like there's an easy way to integrate existing code or skills from other languages, which can be useful in a number of situations. Sean, did I get this summary right...?
Posted by JohnDowdell at June 3, 2007 09:20 AM
Trackback Pings
TrackBack URL for this entry:
http://weblogs.macromedia.com/mtadmin/mt-tb.cgi/8773
Comments
Yes, that's a reasonable summary (sorry, I only just saw this reference to my blog post).
The DLR has the advantage of a defined object model for all languages, courtesy of Microsoft creating a new platform entry point here. In Java-land, J-implementations of many languages have existed independently for a long time with no common object model. However, with the Java 6 scripting engine interface, the J-implementors are now collaborating to find ways to migrate to a more common object model in order to improve interop between languages on the JVM. It's a good opportunity for Adobe, perhaps for ColdFusion 9.
As for overhead, the latest version of my library maintains a cache of compiled script fragments so you only pay the compilation penalty once and subsequent executions of the same code block use a compiled-to-bytecode version (which in turn may be further compiled to native code by the JIT compiler).
Hope that information is useful?
Posted by: Sean Corfield at June 14, 2007 10:54 PM