Wrapping Swift for Python: Bridging the gap with Pybind11
Just write it in C and wrap it in Python… I want to see you struggle @programmersarealsohuman5909 I recently worked on a project that required seamless integration between a Swift Framework and Python. Options like PyObjC exist for simple integrations, but if the Swift code needs to be bundled up, or if you’re working on larger projects, the best option is to “wrap it up”. There’s no direct way to make Python bindings for Swift, but we can wrap C/C++, for example with PyBind11, and expose the Swift functions as C symbols with @c_decl (which is stil undocumented and unofficial)....