Originally Posted by: Benjamin Nitschke (DeltaEngine) 
True, but especially for scripting problems can be very different from one project to the next. That is why many projects use custom solutions (e.g. in our console game FireBurst we used Lua, UnrealScript and C++, each for stuff that could be solved the best way with it).
Yes, of course I'd use Lua for scripting with DE but that is not possible as there is no pure managed version of Lua available. All the ports have ceased development as well.
Using PInvoke or similar would work fine under DE I presume, but I don't want a situation where I want to release my game for example WP7 and I'd have to write the whole scripting part in C# again. Common scripting language for all platforms will be a must have at some point.
Benjamin Nitschke (DeltaEngine) wrote:
About your second point: I cannot fully agree. What you are saying is true, but no one forces you to do it exactly this way. For example I have rewritten parts of our content generation pipeline in the past few weeks and added scripting there as well (in C# because I was to lazy to find anything else that works, also fits better into the pure C# Delta Engine). It is very limited, I can only put some code for one method in the script (which will convert an incoming file to a processed file), but it is all we need for the content processors. Each generator code block is loaded into its own AppDomain and can be executed very quickly (the overhead is almost zero because processing takes a long time (often seconds) and switching to the other AppDomain is 1-2ms, if already loaded). Also each generator code block can be updated as many times as needed (unloading the app domain, loading the new code, etc. this actually takes around 100ms). Currently we only have about 20 code blocks (4 platforms, 5 content formats that need generation), but testing it with 100 or 1000 code blocks also worked fine in tests, so this approach could be useful for games too.
About your memory issues you are talking about. Each generator uses content processors and as much custom code as it wants, but it also has the responsibility to free all memory itself. For managed objects this is done automatically if the AppDomain unloads, everything will disappar. And native memory has to be freed anyway via the native tools used.
Using AppDomains and CodeDom sure is fine and fast but also it does not remove the memory issue. Please correct me if I'm wrong, but I'm under the impression that MonoTouch/Mono For Android/all the similar compiles all the necessary managed parts into pure native machine code for the target platform(arm in this case). Now when the app is loaded it injects the WHOLE binary into memory. That binary blob contains all the THOUSANDS of class definitions ("scripting"). Although it does not make any instances from those scripts it still eats up lots of memory when all those definitions are stored in RAM (even if all the text parts are separated into other files like tef/xml).
And I'm under impression that iPhone doesn't even make possible to load dynamic link libraries into apps(except the core iPhone SDK ones) just static libraries are permitted. Let alone those C# to arm compilers output a single executable (if I'm correct). So there would be no way to dynamically load anything into the application.
Quote:
About Apple restricting scripts: They actually do (read the EULA for the SDKs), but they don't do anything about it (except for last year when they wanted to prevent Adobe from putting Flash ActionScripts on iOS). Most games use some form of scripting and Lua is very popular for many iOS games.
MS is less restrictive in the EULA, but way more restrictive what you can actually do on mobile or console platforms (even in the native world, many things are just not allowed).
I thought Apple loosened those restrictions as many game developers cried for not being able to use scripting (mainly Lua)...
Footnote :
I'm not looking into making/using a scripting engine that is as fully functional language as Lua or python for example. I just need a simple scripting language for content creators and developers(though it should be able to use control/logic expression). Even class/function definitions are not necessary as they would be done in C# side to ensure good performance.
I started to prototype my solution yesterday - it does not even contain for/and/if/assignment functions, as they are added post to vm initialization. I'm sure at least programmers will hate the syntax as it is geared towards "common people"