using .NET as a script engine
-
Hi all, I've been using C++ for almost everything I've done in software development, Windows or otherwise. It is only recently I've looked into .NET and C# in depth. I have a few questions that someone can hopefully shed some light on. The main question really, is if .NET can be used somewhat like a script engine for an (unmanaged) application. For example, most games embed a scripting engine such as Lua, Tcl, or even Java in the application to allow themselves and the end users to modify the game itself, extending its replay value. While perusing through the .NET docs, I noticed that you can dynamically load assemblies during runtime. This is where I got the idea. Also, is there a way to have a piece of code compiled into bytecode and executed during runtime, similar to an eval() function? -Maki
-
Hi all, I've been using C++ for almost everything I've done in software development, Windows or otherwise. It is only recently I've looked into .NET and C# in depth. I have a few questions that someone can hopefully shed some light on. The main question really, is if .NET can be used somewhat like a script engine for an (unmanaged) application. For example, most games embed a scripting engine such as Lua, Tcl, or even Java in the application to allow themselves and the end users to modify the game itself, extending its replay value. While perusing through the .NET docs, I noticed that you can dynamically load assemblies during runtime. This is where I got the idea. Also, is there a way to have a piece of code compiled into bytecode and executed during runtime, similar to an eval() function? -Maki
Try these CodeProject article: Tool to run .NET sourcefiles like script files[^] Dot Net Script[^]
-
Hi all, I've been using C++ for almost everything I've done in software development, Windows or otherwise. It is only recently I've looked into .NET and C# in depth. I have a few questions that someone can hopefully shed some light on. The main question really, is if .NET can be used somewhat like a script engine for an (unmanaged) application. For example, most games embed a scripting engine such as Lua, Tcl, or even Java in the application to allow themselves and the end users to modify the game itself, extending its replay value. While perusing through the .NET docs, I noticed that you can dynamically load assemblies during runtime. This is where I got the idea. Also, is there a way to have a piece of code compiled into bytecode and executed during runtime, similar to an eval() function? -Maki
Also, JScript.NET is a .NET language, and still included the .eval method. :) But yeah, C# or any other .NET language should be able to dynamically execute code. --------------------------- He who knows that enough is enough will always have enough. -Lao Tsu