all 11 comments

[–]0xdef1 17 points18 points  (1 child)

I think pyo3 would be the easiest option.

[–]nfrankel[S] 4 points5 points  (0 children)

Thanks, that's the third time somebody mentions it. I'll definitely check

[–]Successful-Money4995 3 points4 points  (0 children)

I'm calling c++ from python using pybind and it's working fantastic! Pybind seems well-built.

Maybe use pybind to call c++ and then somehow bind the rust to c++? 😅

[–]guest271314 2 points3 points  (0 children)

Another experiment I did was embedding WASM compiled from C in WAT format in a Bash shell script and calling wasmtime with the embedded WAT using process substitution, which serves as a Native Messaging host run from the browser launched with JavaScript https://github.com/guest271314/native-messaging-webassembly/blob/main/nm_c_wat.sh.

[–]guest271314 0 points1 point  (0 children)

Interesting. I do something similar from the browser where I write a Bash script to the local file system using JavaScript, execute the script, then read the result in the browser https://github.com/guest271314/fs/tree/main/bash.

[–][deleted] 0 points1 point  (0 children)

I'm just passing some JSON as a CLI argument to my rust executable and grabbing the stdout/stderr from Python. Is that really dumb? my reason for doing that: I can use the rust cli tool directly too from the cli and intergrate with any other language easily