C# or Python with the Esenthel engine?

D78ab7d1b68ef03b77ca285b6dbddf2b
0
Expert_Novice 101 Jun 16, 2009 at 21:20

Hi everyone! I’m new here this is my first post, but i’ve explored the site for a long time. I’ve been browsing for a new engine for a project im working on, and esenthel is perfect! But its coded in C++ and I was wondering if its possible for a simpleton to enhance it with either C# or python or both? If I only get one, which should I work with? I chose those two after reading the pros and cons about them and hearing about them around also, I like C# because its C but its updated, and I like python because it seems like a solid language with many people backing its quality.

Those would be my “script languages” I guess, but then again I could just write everything in C++… I really want to save as much time as possible. I do not know C++ I know I need to know it to design but Im going to learn it as I progress. (the 3d makes learning fun!)
I really want to learn to use the scripting languages because I want to know a language that will save me lots of time, and take care of certain complexities for me that I just dont want to have to deal with.
Also I know that Im just plain crazy to go into this headfirst without a clue how to program in C++, C#, or python, but I dabbled with C++ a bit and I think I can figure out the syntax easy enough. One last question too, doesnt C take forever to compile with lots of code? or is that the high end languages?

Thanks everyone!

6 Replies

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 168 Jun 16, 2009 at 22:59

If you’re really interested in using C# and/or Python, the Esenthel engine might not be the best for you. You could check out the Panda3D engine, as it supports Python scripting. Also, if you have no programming experience, Python will probably be much easier as a first language than C++.

But if you’re dead set on using Esenthel and extending it, you should definitely learn C++.

As for compile times, big projects take a long time to compile in any language. I don’t know much about differential compile times between C vs. C++ vs. C#, though.

B7dcbc0c0f07253f25ff5c25fe38c081
0
SamuraiCrow 101 Jun 17, 2009 at 02:53

@Expert Novice

Hi everyone!

Hello.@Expert Novice

Those would be my “script languages” I guess, but then again I could just write everything in C++… I really want to save as much time as possible. I do not know C++ I know I need to know it to design but Im going to learn it as I progress. (the 3d makes learning fun!)
I really want to learn to use the scripting languages because I want to know a language that will save me lots of time, and take care of certain complexities for me that I just dont want to have to deal with.
Also I know that Im just plain crazy to go into this headfirst without a clue how to program in C++, C#, or python, but I dabbled with C++ a bit and I think I can figure out the syntax easy enough. One last question too, doesnt C take forever to compile with lots of code? or is that the high end languages? Thanks everyone!

C# actually has very little in common with C or C++. It has more in common with Java or VB.NET. C# and Python both use JIT compilers so they do very little compilation in advance of execution. This is a good thing when prototyping or bug fixing. This is bad when trying to make fast code. Also, Python and C# have extensive extension libraries and run-time libraries respectively. This means there is usually less that needs compiling since it is already compiled in advance.

The reason it seems that C and C++ take a long time to compile is that the runtime libraries are quite primitive for C and implemented with templates on C++. (A template is like a type-safe macro-substitution.) This means there is more to compile to get things working the first time. Also, C and C++ use static compilation so once it is compiled, it’s done compiling altogether, thus freeing up the processor to run the actual code. This is good if you are trying to make efficient and fast-running code. This is bad if you are trying to work a bunch of bugs out of the code and have to recompile each time you make a change.

Does this clear up the compilation time theories and the language decision? Also, I second the recommendation that Reedbeta made about using the Panda3d engine with Python. If you’d rather use a .NET language there are other engines that use those as well although I’ve never worked with any of those.

D78ab7d1b68ef03b77ca285b6dbddf2b
0
Expert_Novice 101 Jun 18, 2009 at 15:12

Thank you for your advice guys!

I don’t really want to get confused with my own code, so I don’t think learning C++ is a very smart option at this point. I’ve heard it is a huge task to write in C++, which isn’t something I want to deal with when trying to be creative with my project. I’ve heard Python is much faster to pick up and easier to comprehend, and C# is pretty close to C++ in functionality, while also being somewhat easier. I’m not bent on one of the three.

I am wondering if there isn’t code somewhere on the internet that I could plug into my C++ project to get Python or C# in there somehow. I don’t know how one would go about mixing code, but it seems possible… This however might be a mistake and result in problems as I do not understand some of the code I would be using. What do you guys think?

I am also not decidedly using Esenthel yet, it does however appeal quite a lot to me. I will check out Panda3d a bit on my computer and see if it isn’t perfect for me.

Languages I’ve worked with in the past:
Visual Basic
Java
HTML < lol >

THANKS AGAIN GUYS!

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 168 Jun 18, 2009 at 16:01

@Expert Novice

I am wondering if there isn’t code somewhere on the internet that I could plug into my C++ project to get Python or C# in there somehow.

It is possible of course, but getting two or more languages to talk to each other is usually tedious and/or painful. I wouldn’t recommend it for a beginner.

46407cc1bdfbd2db4f6e8876d74f990a
0
Kenneth_Gorking 101 Jun 18, 2009 at 16:54

If you still want to try it, there is a C# Scripting sample in the DirectX SDK:

http://msdn.microsoft.com/en-us/library/bb153299(VS.85).aspx

8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Jun 23, 2009 at 20:43

@Expert Novice

I am wondering if there isn’t code somewhere on the internet that I could plug into my C++ project to get Python or C# in there somehow.

It’s not easy, but it’s doable.

You can export your C++ code to use in other languages by creating “bindings”. For Python, I recommend Py++. It’s a code generator that uses Boost’s Python library. The latter is the real heavy lifter, but Py++ is a generator that does most of the manual work for you.