An Architect's View

ColdFusion, Software Design, Frameworks and more...

An Architect's View

More notes on Scripting for ColdFusion 8

June 2, 2007 · 4 Comments

I've started running a number of experiments in terms of language interoperability between ColdFusion and the two script engines that I've implemented so far. It shouldn't be too surprising to learn that a class created in one language is pretty much useless in another language. Each engine uses a different representation for their classes, including how you call methods. You can pass strings between all three languages. You can pass arrays and structures between ColdFusion and Ruby (but not PHP - it uses some odd data representations). Limited interoperability is about what I expected since the script engines are all developed independently. I'll post more notes as I experiment more!

Tags: coldfusion

4 responses so far ↓

  • 1 Vince Bonfanti // Jun 3, 2007 at 5:29 AM

    "It shouldn't be too surprising to learn that a class created in one language is pretty much useless in another language. Each engine uses a different representation for their classes, including how you call methods."

    This is one of the things that's different about the DLR-based implementation of dynamic languages in .NET. Using the DLR, classes created in one dynamic language will be fully interoperable with classes created in any other dynamic language.
  • 2 Sean Corfield // Jun 3, 2007 at 8:45 AM

    @Vince, yup, I nearly added that as a footnote. All new DLR-based languages will be able to target a single model. I think, right now, we're seeing a set of existing, disparate Java implementations of a number of languages simply being hooked into the script engine mechanism by Sun's project.

    There's no reason why folks couldn't all build to a common standard set of classes with the Java script engine. Over time, I'd hope to see more collaboration between language implementors and more interoperability.

    I know several of the key implementors are sharing details on the jvm-languages group so we can hope :)
  • 3 Sammy Larbi // Jun 3, 2007 at 10:07 AM

    "It shouldn't be too surprising to learn that a class created in one language is pretty much useless in another language."

    That just means there's an opportunity to glue them together =)
  • 4 Dan G. Switzer, II // Jun 4, 2007 at 2:04 PM

    @Sean: It would probably be slow as h-e-double hockey sticks, but in PHP you could probably convert the data object to WDDX (it has does have libraries to do so) and then convert the data back to CFMX using CFWDDX.

    Or maybe JSON might be more effective since most languages these days have functions for serializing/deserializing to JSON.

    Like I said, it would be slow, but it might be an easy way to transfer more complex data types...

Leave a Comment

Leave this field empty: