C++ as Native Engine code and C# as Scripting

Started by
11 comments, last by Eul0gy 19 years, 12 months ago
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^
Advertisement
C# is not a scripting language if that is waht you are thinking ...
-----------------SloGameDev.net | My homepageQ:What does a derived class in C# tell to it's parent?A:All your base are belong to us!
Why on earth would you want to script with C#?
go with python
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
"There is only one everything"
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).
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
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]
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.
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.
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]
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]

This topic is closed to new replies.

Advertisement