Cross platform C++ plugins by supplying source code
#5
Even with dynamic linking things are not that simple. You can't reliably pass objects across dll boundaries, because different compilers (and different compiler versions) have different ideas about the object's internal structure. For example there's no guarantee that the object's virtual table will be at the assumed address. No, believe me, C++ dll interface is hell, we've been there at work and it's just not reliable enough.

So we need a C interface, which means writing tons of glue code yet again. And there's not much advantage that it would offer; the only thing C/C++ is better at than Lua is speed, and there isn't a speed issue with any plugin at all currently (apart from choosing obviously bad algorithms, of course). And even if there was a speed issue, it could still be solved by pushing the critical calculation to C++ and accessing it via the Lua API, as is done with for example the cBlockArea merging.
Reply
Thanks given by:


Messages In This Thread
RE: Cross platform C++ plugins by supplying source code - by xoft - 10-25-2014, 02:44 AM



Users browsing this thread: 1 Guest(s)