[rust-dev] Migrate legacy code to Rust

Xiao Jia stfairy at gmail.com
Sat Jul 12 18:37:01 PDT 2014


I'm considering migrating a legacy system written in C++ to Rust.  It runs
on Windows, has dependencies such as boost and Windows GDI+ (yes it has a
Win32 window on the screen), and receives real-time messages via an
internal low-latency library.  Based on these conditions, I consider a
direct full-stack migration is infeasible.  So I am considering two

1. Write core business logic (including spawning and managing multiple
worker threads) in Rust and compile as a static library which can be linked
together with other C++ code (that I cannot change).

2. Wrap the unchangeable C++ code as a C library, and use the library from
Rust.  The wrapping is needed because I read from Rust docs that it's not
possible to call C++ directly at present.

I am completely a newbie in Rust and hope you could give your advice on
which way to choose, or on better alternatives :-)

P.S.  For alternative 1, I wonder if MinGW run-time libraries are needed
when the linked program is deployed.  I would prefer completely native
executable without external run-time dependencies.

Xiao Jia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140713/d415bdeb/attachment.html>

More information about the Rust-dev mailing list