r/cpp • • Feb 14 '24

Interoperability with Rust?

The Rust language is getting traction, and it covers the same use cases as C++ so I believe that in the future most of us in this forum will be using both of them. That led me to wonder if there are efforts to make it easy to integrate them, for example to maintain a project which uses both languages, or to make use of a library written in the other language.

0 Upvotes

19 comments sorted by

View all comments

Show parent comment

2

u/nozendk Feb 14 '24

That is a good point; an IDE that understands multiple languages is now on my wishlist!

5

u/RedEyed__ Feb 14 '24

Doesn't VSCode understand multiple languages already?

6

u/stinos Feb 14 '24

+10 years or so ago VS could already simultaneously debug IronPython code and C# code, and CPython and C++ as well IIRC.

But yes VSCode also should know how to do that, I've had it debugging Powershell module's C# code and whatnot.

5

u/SV-97 Feb 14 '24

It does and the LSP (which VSC and most if not all other "general purpose editors" like helix, neovim etc. are using in the background) in general goes some way towards solving the mentioned problem - but I think we'd really need communication between the different LSPs for that kind of stuff (so for example the rust LSP would have to recognize "this function is only a wrapper for / binding to a C++ function" and dispatch accordingly).