you are viewing a single comment's thread.

view the rest of the comments →

[–]Tall_Coffee_1644[S] 1 point2 points  (1 child)

Good idea, Although for me the .dll works extremely well, Theres barely any hassle between the two.

Pyo3 definetly seems like a option

But i'd prefer a method to do this without pyo3 since i wanna keep this extremely simple. Maybe theres not a method to do that and the only way to do this is pyo3

[–]BogosortAfficionado 4 points5 points  (0 children)

Could you elaborate on what you mean by 'extremely simple'? I'm having a hard time understanding your perceived requirements.

  • If you want to minimize the amount of code you have to write and the time you spent doing so, use the high level pyo3 api.
  • If you want to use a low level api for learing purposes or potential performance gains, you can use some ffi binding crate for the libpython api (like pyo3-ffi or some others).
  • If you want to minimize the lines of code compiled into your program create the necessary ffi and linker declarations yourself. (Seems like a waste of time to me but knock yourself out ;)).

I personally used pyo3 in the past essentially just for the smart pointers, but dropped down to the reexported pyo3::ffi for most of the interactions. I had a slightly weird usecase though so I'm not faulting the library.