Skip to main content
gamedev.net
🔒 Locked

A Question about Python

Started by Alpha_ProgDes Jun 29, 2006 at 6:23 AM 8 replies 1.2k views
Original Post
Alpha_ProgDes
Alpha_ProgDes
If you've ever read a Deitel & Deitel book, you'll see that they make another (mini-)language using the language they are teaching. So I heard (and I've searched a little in Wikipedia and they Python website) that Python was made in C in the same way. First, is that true (or mostly true)? If yes, then why is it (I swear I've seen other posts that has said this) that Python binds easier in/to C++ than C? Or am I horribly mistaken?
Beginner in Game Development?  Read here. And read here.  
programwizard
programwizard
Yes, the main Python interpreter is written in C (although there also implementations written in Java and Python itself). As for binding to C++, I assume you mean embedding Python in C++ programs or vice versa. If so, I've never heard this; according to the manual, it interfaces equally well with C as well as C++.
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.
Alpha_ProgDes
Alpha_ProgDes
ahh i see. would it be safe to say that if you want a scripting language embedded in C then use Lua and if you want a scripting language embedded in C++ then use Python?
Beginner in Game Development?  Read here. And read here.  
Nitage
Nitage
From a gaming perspective, World of Warcraft use LUA with C++ and Civilization 4 uses Python with C++.

The APIs for Python and LUA are in C, so you can use them for pretty much any language.

There is no mapping between C/Lua and C++/Python
Alpha_ProgDes
Alpha_ProgDes
Quote:
Original post by Nitage
From a gaming perspective, World of Warcraft use LUA with C++ and Civilization 4 uses Python with C++.

The APIs for Python and LUA are in C, so you can use them for pretty much any language.

There is no mapping between C/Lua and C++/Python

Well going from what the AP said, I was implying ease: of use and actually embedding the code.
Beginner in Game Development?  Read here. And read here.  
Nitage
Nitage
Libraries similar to boost::pytohn exist for Lua.
See LuaBind.

Xai
Xai
my understanding is not that LUA = better for C, Python = better for C++, but more along the lines of LUA = lighter weight better for simple glue code, Python = complete general purpose langauge, more power for complex task modeling therefore more rope for scripters to hang themselves with ...

The community seems to be going the Python / ruby direction for full fledge conversion and mod ability, and toward LUA for simple customization / extension support. Although Python is getting some of that too.
TrueTom
TrueTom
Quote:
Original post by Nitage
From a gaming perspective, World of Warcraft use LUA with C++ and Civilization 4 uses Python with C++.


I somewhere read that Duke Nukem Forever uses Ruby2...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.