I am working on a “building game” (in the same vein as MineCraft, Roboblox and Dwarf Fortress). Obviously this game will be completely brimming with objects that interact with one another. I’d like to use a scripting language to describe the objects and their behaviours. Since these scripts will be executed in rapid succession, I need to find a scripting language such as lua, python, etc that is both very fast, and easily integrable into a C# program. Bonus points for specific information on how to implement.
Share
You can use C# 😛 It’s possible to compile and load .cs files at runtime.
And since C# is statically typed the scripts will be rather fast(just as fast as any other (non ngen-ed) C# code. And of course the compiler is already included with .net.
See CSharpCodeProvider
The main weakness of C# as scripting language is that it needs to compile a whole assembly at a time. So it’s not well suited for an interactive command prompt.