hext
hext copied to clipboard
Consider building Hext for Python without SWIG
After #37 , Hext for Python will be the only language binding that is built using SWIG.
SWIG is great if you have to support multiple languages, or have a large public interface with many members/methods/types. Both of which is untrue in Hext for Python.
On the other hand, I suspect that the abstraction layer provided by SWIG took care of the evolving Python API (e.g. replacing deprecated "glue" code, depending on which Python version is currently targeted).
Consider if removing SWIG and directly targeting Python's C API has the following benefits:
- Simplified build process (i.e. pure CMake without SWIG glue)
- Tighter memory handling, with explicit type conversion / memory access / memory copy (specifically in regards to the HTML buffer)
- Some performance improvements might be easier to implement (e.g. releasing Python's Global Interpreter Lock)
- Most importantly: It may be more enjoyable to maintain :stuck_out_tongue_winking_eye: