C++ as Native Engine code and C# as Scripting
hey
I have looking at the idea of implementing a scripting language into my demo''s i have been working on for uni which are in C++. I have been looking at Python and Lua but i have had classes in C# from uni. I was wondering if it would be possible to have C# as a Scripting language sitting above C++ code . the C++ code is Un managed. Would i have to change it to Managed code at all?
cheers
Eul0gy^
I would imagine that C# could hypothetically be easier to embed, as managed C++ is much closer to the Way It Should Be than the Python/C API. (where the Way It Should Be is defined as using code from language A in language B without any work being done on bindings)
C# makes a terrible scripting language, though. It has so much syntactic overhead that you really shouldn''t have to deal with. (public static void blah....)
"Without deviation, progress itself is impossible." -- Frank Zappa
C# makes a terrible scripting language, though. It has so much syntactic overhead that you really shouldn''t have to deal with. (public static void blah....)
"Without deviation, progress itself is impossible." -- Frank Zappa
You don''t embedded C#, you embedded the CLR (Common Language Runtime), which means they can use any .Net language to script your game - you can load any .Net assembly. The .Net platform comes with VB and C# compilers built-in though. (It''s called Hosting the CLR if you want to read more about it).
VB.NET can be more script-like with Option Strict and Option Explicit turned off. Of course hosting the CLR will give you the option to use whatever .NET language you'd like to.
Epolevne
[edited by - Epolevne on March 19, 2004 2:33:06 PM]
Epolevne
[edited by - Epolevne on March 19, 2004 2:33:06 PM]
I cannot remember for sure if the C# compiler classes are part of the .NET runtime, or only the .NET SDK ... I thought they we''re SDK only.
Which would mean:
no, you CANNOT use C# as a scripting langauge ... because you can only compile C# if the client machine has the .NET SDK installed ... the COMPILER is FREE but included in the .NET SDK, but NOT the runtime.
Now if I am wrong, and the .NET classes to compile C# are in the CLR, then you could use it as a scripting language. And it really might be ... I''ll look it up and post later if someone doesn''t beat me to it.
Which would mean:
no, you CANNOT use C# as a scripting langauge ... because you can only compile C# if the client machine has the .NET SDK installed ... the COMPILER is FREE but included in the .NET SDK, but NOT the runtime.
Now if I am wrong, and the .NET classes to compile C# are in the CLR, then you could use it as a scripting language. And it really might be ... I''ll look it up and post later if someone doesn''t beat me to it.
Well regardless CodeDOM is part of the runtime, so there
Although I see no reason NOT to include the Microsoft.* stuff in the runtime, in fact that would probably piss alot of people off.
People like me.
Although I see no reason NOT to include the Microsoft.* stuff in the runtime, in fact that would probably piss alot of people off.
People like me.
quote:Original post by Xai no, you CANNOT use C# as a scripting langauge ... because you can only compile C# if the client machine has the .NET SDK installed ... the COMPILER is FREE but included in the .NET SDK, but NOT the runtime.
The compiler is actually included in the runtime. There are parts of the framework that relies on it, like XML serialization.
--
AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.
[Project site] [Blog] [RSS] [Browse the source] [IRC channel]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement