Any serious Rust users here?

298 views
Skip to first unread message

Vitaly Davidovich

unread,
Dec 22, 2016, 7:03:12 AM12/22/16
to mechanical-sympathy
Curious if anyone on this list is running any non-trivial Rust code in production? And if so, would love to hear some thoughts on how that's going.

Also, if the code either interops with existing c/c++/java code or is a replacement/rewrite/port of code from those languages, interested to hear that aspect of the story as well.
--
Sent from my phone

Marshall Pierce

unread,
Dec 22, 2016, 10:14:28 AM12/22/16
to mechanica...@googlegroups.com
Our Rust project is not in production yet, so I can’t comment on that aspect, but it does interop with a large C codebase (PostgreSQL) and so far that has been smooth. FFI (both C calling Rust and Rust calling C) has been straightforward, and the predictable performance guarantees of Rust have been nice to rely on. Having a pleasant type system that also seems to end up with rather good assembly has been very nice. Thus far, at least, it’s been a good choice for us: aside from the performance and interop, it’s been an easy language for those new to Rust to pick up and be productive in, and we’ve already gotten good mileage out of the library ecosystem.

Separately, I’m contributing to ring, a rust wrapper around BoringSSL that’s slowly replacing C with equivalent Rust. It’s an interesting project not only because it potentially could free us from the monthly OpenSSL vulnerability cycle, but also because it’s got plenty of C interop (at least until we finish rewriting everything in Rust!) as well as assembly. There, too, things generally seem to go smoothly. There is some build system complexity but much of that is inherited from BoringSSL (and there from OpenSSL).

Overall the language and ecosystem feel surprisingly mature given how comparatively young they are. The default build tool (Cargo) is decent, and there’s even an IntelliJ plugin…

Rajiv Kurian

unread,
Dec 22, 2016, 1:34:10 PM12/22/16
to mechanical-sympathy
I wrote some Rust, not in production so please take anything I say with a giant grain of salt. My experience has tells me that a lot of C++ folks will find getting started with it very easy like I did. However the type system does take some time to get used to if you want to mutate things. I ended up giving up and making copies or using copious amounts of unsafe code. It took me a while to get the Rust way of doing things. Check out some of whitequark's articles on how he gets zero copies in Rust and you'll see that it's not trivial. SIMD support was very limited back when I last used it but I've seen a bunch of RFCs that plan to expose all the LLVM SIMD intrinsics.

My main complaint still remains long compile times. I hear that incremental compilation is finally a thing and the MIR layer in general will help with fast type checking (not codegen). The compiler still spends quite a bit of time in LLVM land (all those abstractions) but apparently the MIR layer can help by cheaply removing some of those abstractions even before LLVM kicks in. Overall though the toolchain is surprisingly mature and getting better every day. The FFI experience is smooth and unless you use very exotic C features you should be okay IMO. There are wrappers around things like Vulkan and even DPDK.

Rajiv Kurian

unread,
Dec 22, 2016, 1:46:25 PM12/22/16
to mechanical-sympathy
Another thing I wanted to add is that though there is a bit of ramp up time with the type system, there are some really cool things that can be done with it. Check out this proposal for alloca - https://github.com/rust-lang/rfcs/pull/1808

Vitaly Davidovich

unread,
Dec 22, 2016, 2:03:35 PM12/22/16
to mechanica...@googlegroups.com
Rajiv/Marshall,

Thanks for your comments.  I guess I should rephrase my initial post - I'm *particularly* interested in production and migration scenarios/stories, but happy to hear others' casual dabbling experience as well.

I agree on the compile time, but there's good news and bad news.  The good is that the Rust team knows this (it's a problem hard to hide), and has some plans (MIR as mentioned).  The bad news is that LLVM is getting slower at a worrisome pace - there's an ongoing thread about this on the LLVM mailing list.  The salt on the wound is that runtime perf isn't unequivocally better despite slower compiles.  The somewhat comical angle to this is LLVM (and clang) were also welcomed due to better compile times than GCC when they first showed up.  Now it seems like they're slower.

No surprise but I'm very positive on Rust as a whole for a bunch of reasons.


On Thu, Dec 22, 2016 at 1:46 PM Rajiv Kurian <geet...@gmail.com> wrote:
Another thing I wanted to add is that though there is a bit of ramp up time with the type system, there are some really cool things that can be done with it. Check out this proposal for alloca - https://github.com/rust-lang/rfcs/pull/1808



--

You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.

To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Vitaly Davidovich

unread,
Dec 22, 2016, 2:17:56 PM12/22/16
to mechanical-sympathy

To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages