Viewing By Entry / Main
June 2, 2007
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!

Comments

"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.


@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 :)


"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 =)


@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...


Post Your Comments
Name:
Email Address:
Comments
*** Please note that all comments require moderation so it may be some time before your comment posts to this blog! ***
Remember My Information:
 



Hosting provided by