Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move SWIG files to a common folder #233

Open
chapulina opened this issue Aug 31, 2021 · 2 comments
Open

Move SWIG files to a common folder #233

chapulina opened this issue Aug 31, 2021 · 2 comments
Labels
enhancement New feature or request scripting Scripting interfaces to Ignition

Comments

@chapulina
Copy link
Contributor

With the addition of Python interfaces, we now have partial support for 2 scripting languages: ruby and python. Each language was placed into a separate folder for organization purposes, but this means we're repeating the SWIG .i files across both directories, i.e.:

It would be nice to reduce duplication as much as possible. The strength of SWIG is the multi-language support, so we should strive to write a SWIG file once and get support for multiple languages automatically.

Desired behavior

Have a single SWIG file for each class, which can be reused across all languages.

Alternatives considered

Keep separate files and deal with the extra overhead.

Implementation suggestion

Move the SWIG files to src/swig and update CMake to get them from there.

Additional context

I see that the SWIG files are slightly different between both directories right now. I imagine there must be good reasons to have differences for each language. I haven't dug into this yet, but I'd hope that SWIG would offer a solution for that use case, maybe using conditionals according to the language?

@chapulina chapulina added enhancement New feature or request scripting Scripting interfaces to Ignition labels Aug 31, 2021
@chapulina
Copy link
Contributor Author

Since #354, the SWIG files have been removed from the python directory (which uses pybind11 now) and moved to the Ruby directory. So there's no more duplication until we decide to add SWIG wrappers for another language.

@scpeters
Copy link
Member

scpeters commented May 9, 2022

Since #354, the SWIG files have been removed from the python directory (which uses pybind11 now) and moved to the Ruby directory. So there's no more duplication until we decide to add SWIG wrappers for another language.

this seems to be the case on the ign-math6 branch, but there are still multiple .i and _TEST.rb files in the src/ folder on the main branch:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request scripting Scripting interfaces to Ignition
Projects
None yet
Development

No branches or pull requests

3 participants