views:

126

answers:

2

I'm looking for a embedded language that can be used to script common code between a server app written in C# and a client app written in Flash/Actionscript. It is important that the embedded language interpreter run natively in the environment it is embedded into. For example, it cannot load any external C libraries (i.e. python, neko).

Does such a thing exist for these two languages? Perhaps there is some minimal interpreter that could be easily ported to both?

Thanks!

A: 

I believe Javascript is the answer.

Here's some thoughts on calling Javascript from Actionscript and vice versa.

Here's some words about calling Javascript from C#.

Chris McCall
A: 

It would probably end up fairly ugly, but someone has successfully embedded Lua into Actionscript through Alchemy -- demo on Google Code. Pair that up with LuaInterface and you've got an embedded language on both sides. You'll find a couple more "JavaScript (or ActionScript in Flash)" implementations of Lua on the Lua Implementations page.

There's also Pair, an AS3 implementation of Python that looks a lot more stable than Lua-Alchemy. The .NET complement would be IronPython.

Haxe can output a .swf, which might suffice for your needs -- I'm not sure if two .swf files can communicate, I don't really use flash. The big downside with Haxe is no native .NET support, although it can support Neko or C++, both of which you would have to go out of your way to integrate with .NET.

Mark Rushakoff