4 ms·
There was a recent ATP.fm podcast with Chris Lattner of Swift fame. He talked about the topic of embedding Python code in Swift for TensorFlow and it overlaps w
by zerkten 7y ago
There was a recent ATP.fm podcast with Chris Lattner of Swift fame. He talked about the topic of embedding Python code in Swift for TensorFlow and it overlaps with your suggestion.
- NobodyNada 7y agoSwift for Tensorflow has implemented Python interoperability, rather than embedded Python code as in this article. A Swift program can import a Python module and interact with Python objects and functions as if they were native Swift objects (minus strong typing, of course). See https://github.com/tensorflow/swift/blob/master/docs/PythonInteroperability.md https://github.com/tensorflow/swift/blob/master/docs/PythonI...
- akiselev 7y agoRust has had Python interop through the Python C API since around 2015 [1]. It's pretty low hanging fruit for any language that supports the C FFI. Rust-cpython has had simple macros for interop for ages [2] and there's even a library that uses serde macros to encode/decode pickled object [3]. This article is just a fun hack using Rust macros. [1] https://github.com/dgrunwald/rust-cpython https://github.com/dgrunwald/rust-cpython [2] http://dgrunwald.github.io/rust-cpython/doc/cpython/macro.py_class.html http://dgrunwald.github.io/rust-cpython/doc/cpython/macro.py... [3] https://docs.rs/serde-pickle/0.6.0/serde_pickle/ https://docs.rs/serde-pickle/0.6.0/serde_pickle/