Future of SWIG bindings

Create issue
Issue #63 resolved
David Williams created an issue

I'm having a general spring-clean inside PolyVox and I notice there is still code related to the SWIG bindings. There's a bit inside the C++ ('#ifdef SWIG', etc) as well as the CMake code for building the bindings and the examples.

I'm assuming that none of this works, partly because I'm always changing things(!) and partly because the whole project is now header-only. But will this code ever work in the future, or are there other reasons to keep it around?

Comments (4)

  1. David Williams reporter

    As I recall, we said that the SWIG bindings didn't really make sense now that PolyVox is header only, and that future attempts to expose PolyVox to other languages would involve writing a simplified wrapper around core functionality, and then using SWIG on that.

  2. Matt Williams

    I think that bindings still make sense when PolyVox is header-only. However, the way that we do them will have to change in various ways. The #ifdefs were required because SWIG could not understand nested classes. I would say that we should remove them for now. After we've revisited the best way to do it we may need to add them back but I expect that we won't.

  3. David Williams reporter

    I've removed a few instances of #ifdef SWIG from places where I could see the SWIG version would not compile anyway (where code has since been templatised). I left the SWIG guards around the samplers though - I guess they are harmless.

    I'm closing this issue because even though I titled it 'Future of SWIG bindings' it was more about this specific question. We can open a new issue when we are actually ready to tackle bindings again (maybe we already have an issue open).

  4. David Williams reporter

    Although this issue is closed, I'll just note that I've resurrected the SWIG bindings to some degree. I'm not planning to polish them or fix any problems, but it wasn't too difficult to at least get them building after I broke them with the switch to header-only. So if you or anyone else ever does want to fix them up then there is a starting point.

  5. Log in to comment