y2s82 / goblin_camp

Dwarf Fortress clone, revisited
GNU General Public License v3.0
36 stars 12 forks source link

boost::python #102

Open y2s82 opened 5 years ago

y2s82 commented 5 years ago

Part of phasing out boost library

Review its use and replace with std:: if possible

gabriel-francischini commented 5 years ago

Removing boost::python will probably replace it with custom written C-wrappers for interfacing C++ and Python. Since we'll need to change the code that talks to the python environment, we may also be able (afterward) to change from Python 2.7 to Python 3 (if we are ok with dropping support for old mods written for the old version of the game).

There's another issue of even supporting Python for modding in the first place, as Lua is also commonly used for modding. While Python is a nice and useful general programming language, Lua was made for embedding into applications so it has a few more niceties when used for modding (especially when talking about speed). Both Python and Lua are used in games for modding, and there are even more languages that are embeddable. There isn't a consensus about this topic and this is kind of a tangential issue but we may benefit in the long term by rethinking if our inherited modding choice still is the right choice.

y2s82 commented 5 years ago

as mentioned in #16 , upgrading to Python 3 is one of the project's goals. Besides, Python 2.7 is quickly reaching EOL.

We could, for now, rely on the Python code we have, create a c-wrapper and remove this Boost dependency.

Adapting Lua is certainly an interesting option and may deserve more investigation. This idea would deserve its own project and a branch to explore the options and incrementally convert each Python code into Lua counterpart.