Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Eul0gy

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

This topic is 5202 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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^

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!