Most of the questions here go about "how to I use Python in Swift". I want to do the opposite: use a Swift library from Python on Mac OS.
I have a library in Swift that performs fast calculations on GPU using Metal Performance Shaders. I want wrap that code so it is callable from Python (restricted to MacOS only is fine) and pass some Numpy matrices from Python to Swift, let swift do calculations, and return the resulting Numpy matrices back. If it's not possible to pass the Numpy matrices, I guess I could live with passing in the arrays. Is there a way to achieve this kind of interop?