News for hackers. Stuff that matters.
Re:Facebook picked Rust to implement Libra by langitbiru on Wednesday June 19, 2019 @12:01PM (#20224494)
Bitcoin (Bitcoin Core) is implemented in C++. At that time, Go and Rust weren't born yet.

The most popular Ethereum implementation (Geth) is written in Go. The second most popular Ethereum implementation (Parity) is written in Rust.

Now, Libra is written in Rust.

So I guess the moral of the story is, if you want to write a greenfield high performance application, Go or Rust should be your choice compared to C++.

Re:Facebook picked Rust to implement Libra by jandrewrogers on Wednesday June 19, 2019 @02:35PM (#20225931)
It really depends on the type of application. Rust's memory safety model works well for most software.

Some types of software require memory safety models that Rust was not designed to express e.g. safety models when mutability of references and ownership of objects are not observable at compile-time. High-performance database engines tend to have this challenge due to pervasive DMA-ed I/O and opaque page-structured memory. The OS hides this from most applications that aren't high-performance systems code. In C++ (which also looks askance at these memory models) this is addressed by designing an execution scheduler to dynamically guarantee safety; the scheduler understands the memory model and never schedules or executes a sequence of concurrent operations across a set of mutable references that would violate the safety model -- the operations are oblivious. In modern designs this requires no locks and negligible state.

Rust can deal with these types of memory models too while minimizing the amount of unsafe code with enough layers of indirection, it just has a high performance cost.

Re:Facebook picked Rust to implement Libra by saagarjha on Wednesday June 19, 2019 @12:11PM (#20224581)
> So I guess the moral of the story is, if you want to write a greenfield high performance application, Go or Rust should be your choice compared to C++.

I don't see how this generalization follows from the three examples you've cited?

Re:Facebook picked Rust to implement Libra by ncmncm on Wednesday June 19, 2019 @01:39PM (#20225343)
Wishful thinking would be my guess.

Rust in production use tends to be found in circumstances where there is no need for mature tooling, and no expectation of a need to hire experienced coders. Of course there are exceptions.

Re:Facebook picked Rust to implement Libra by damnyou on Wednesday June 19, 2019 @02:20PM (#20225741)
It is not that hard for C++ developers to pick up Rust. The borrow checker makes explicit safety requirements that exist in C++.

The tooling does need to be more mature but for many projects the pioneer tax paid to improve the tooling may be worth it. Besides, it's not as if C++ dependency management is very mature either — most people build custom tooling for that anyway.

Re:Facebook picked Rust to implement Libra by shmerl on Wednesday June 19, 2019 @12:23PM (#20224692)
> If you want to write a greenfield high performance application, Go or Rust should be your choice compared to C++.

Go is not in the same performance category as Rust and C++. It has more limited use cases where it works well, due to mandatory runtime. Rust and C++ are more general purpose.

Re:Facebook picked Rust to implement Libra by coldpie on Wednesday June 19, 2019 @12:27PM (#20224727)
Performance is one reason to use Rust, but it's not the only one. It enforces correctness at compile-time, eliminating a ton of easy-to-miss bugs. If your application is multi-threaded, it also enforces guarantees about thread safety, eliminating another class of bugs. If you care about correctness, that is another reason to use Rust.
Re:Facebook picked Rust to implement Libra by sbov on Wednesday June 19, 2019 @12:24PM (#20224701)
When it comes to performance, Go is more comparable to Java than Rust.
Re:Facebook picked Rust to implement Libra by sethgecko on Wednesday June 19, 2019 @02:59PM (#20226224)
Grin (mimblewimble) is also written in Rust https://github.com/mimblewimble/grin