text: C# or Python with the Esenthel engine? - Devmaster
  C# or Python with the Esenthel engine?
  Started by Expert Novice, Jun 16 2009 09:20 PM
  Posted 16 June 2009 - 09:20 PM
  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?
  Posted 16 June 2009 - 10:59 PM
  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.
  Posted 17 June 2009 - 02:53 AM
  Expert Novice said:Hi everyone!
  Expert Novice said:
  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.
  Posted 18 June 2009 - 03:12 PM
  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:
  HTML < lol >
  Posted 18 June 2009 - 04:01 PM
  Expert Novice said: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.
  If you still want to try it, there is a C# Scripting sample in the DirectX SDK:
  http://msdn.microsof...299(VS.85).aspx
  Posted 23 June 2009 - 08:43 PM
  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.