FFI - Python and Node.js and Rust

Veröffentlicht am: 23 Juli 2021
auf dem Kanal: krscleancode
310
1

We demonstrate a couple of design ideas to embed Rust with Python and Node.js and to dynamically invoke the foreign function

We introduce cdylib, the c-compatible dynamic library format of Rust.

We start by performing certain interesting experiments with Strings and String slices to understand the challenges in exchanging the pointers between Rust and Python.

Then we introduce the significance of CString and CStr, the c-styled null-terminated implementation of Rust, that makes the invocation safe and breeze.

We continue our discussion on exposing the Rust Struct to the Python Client using the "principle of least knowledge". This type of adapter pattern finds a lot of applications in the field of interoperability between two languages. This design style is the first step towards understanding WebAssembly

Then we switch our experiment with Node.js and Rust interoperation, to appreciate the commonality with the earlier Python adapter implementation.

Yes, we continue our pursuit of cross-compiling the PatternCounter, in its cdylib shared object format, for the Linux Target.

Finally, we complete our experiment with the joy of invoking the foreign function from Node.js in the Linux environment


Auf dieser Seite können Sie das Online-Video FFI - Python and Node.js and Rust mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer krscleancode 23 Juli 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 310 Mal angesehen und es wurde von 1 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!