I am only Starting to learn Rust and would like to ask about other programmes,written on c++, python how can I easely and safely use Them simultaneously with rust programme,Thanks)
Rust is able to call C functions and get called from C (or alike) using the FFI (Foreign Function Interface).
Some docs are here: https://doc.rust-lang.org/nomicon/ffi.html
This is not "safe" according to what Rust considers safe, as you're leaving Rust land.
However, there's a bunch of tooling to make this easier (and safer) to use with other languages.
I gave a talk recently on how we build a cross-platform library in Rust.
Usually Rust with JS is used via Web Assembly (WASM).
A bit more specific option is to write native extensions to Node.js using Rust.
You could also use natively-compiled Rust with JS together via V8 bindings, but this is an advanced technique, and I don't recommend that if you're not an experienced programmer.
When I compile C/C++ with emscipten it produces WASM all nicely wrapped up to use a node module.
Is there nothing so simple for Rust and WASM?
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.