I've been studying
Lua more in depth lately and I've been turning over a more difficult question in my head: How can you combine
XNA, with it's inherent constrictions due to the XBOX 360, and a scripting language such as Lua?
The problem is that, at runtime, Lua uses JIT compiling of unmanaged C code. Unmanaged code can not be run on the XBOX 360 alongside XNA. There is the possibility of using C# scripting; however, the necessary functionality for building the scripts on-the-fly are not included in the version of the .NET Framework running on the XBOX 360. As described
here, it
is possible to pre-compile your scripts and load them as an assembly.... But that is not particularly helpful for debugging/development. Is there a solution to this problem?
I've been tossing the idea around of writing a Lua-like implementation in C# that would not need to be compiled; it would simply be parsed at runtime by an assembly written for such a purpose. However, there are two main concerns that have leapt out to me so far:
- The obvious, performance issues. It may be possible to work out a method for this. I haven't spent the time on this yet, however.
- Functions. I could use delegates, but I'm not sure yet how to handle the variable number of arguments into a function.
Of course, it may be better just to go with the pre-compiled C# scripts to begin with. Thoughts?
Cheers!
Devan