19 ms·
Facebook picked Rust to implement Libra
- novalis78 7y agoAnd Cardano is already working closely with the Haskell community..
- steveklabnik 7y agoNote that Facebook has also been previously using Rust for https://github.com/facebookexperimental/mononoke; https://github.com/facebookexperimental/mononoke; as well as for some smaller things. They've been sponsoring Rust conferences too. I am not personally interested in cryptocurrency, but it's always great to see more big companies using Rust!
- thih9 7y agoURL isn't clickable because of a semicolon. This should work: https://github.com/facebookexperimental/mononoke https://github.com/facebookexperimental/mononoke .
- steveklabnik 7y agoUgh, thank you. This is the second time this has happened to me today, you'd think I would have learned. Sigh.
- kreetx 7y agoBut it's great that it is in your muscle memory, no linting errors at least :p
- azangru 7y agoSurprised it's not OCaml; they've invested highly in OCaml.
- dymk 7y agoIn their frontend, yes. The Flow JS typechecker, and (kind of) Reason. Backend and infrastructure sees more Rust though. Eg the Mercurial server implementation.
- vijaybritto 7y agoThe primary reason they stated is memory safety as this is gonna be really critical stuff dealing with money. Also no GC.
- tomp 7y agoOCaml is more memory safe than Rust (as the "unsafe" parts are harder to access). But it does have GC, so GC is likely the primary reason.
- gfs 7y agoI wouldn't label Rust as being less safe than OCaml. You have to explicitly opt-in to any unsafe operations. More often than not, the unsafe blocks are needed because the compiler can not check all of the invariant cases.
- saagarjha 7y agoDoes OCaml even have a way of shedding memory safety?
- ncmncm 7y agoOCaml is an "obligate-GC" language. Most languages that offer optional GC, including Rust (with its RC and ARC boxing) and C++ (with std::shared_ptr), implement it mainly via reference-counting.
- tomp 7y agoYes, the `Unsafe` module (well, at least used to have it... fairly undocumented... maybe it's been removed?).
- deltron3030 7y agoThey want to be trusted.
- jvanderbot 7y agoTangential: Is there an easy way to map all links of form www.reddit.com/* to old.reddit.com/* on all my devices? (I assume /etc/hosts would work for linux?)
- modeless 7y agoLog in. Then you can set a preference to always show old Reddit.
- thih9 7y agoWhen possible, I try not to log in. I dislike targeted content or targeted ads, I hope clearing cookies helps with avoiding it.
- est31 7y agohttps://addons.mozilla.org/en-US/firefox/addon/old-reddit-redirect/ https://addons.mozilla.org/en-US/firefox/addon/old-reddit-re... https://chrome.google.com/webstore/detail/old-reddit-redirect/dneaehbmnbhcippjikoajpoabadpodje https://chrome.google.com/webstore/detail/old-reddit-redirec... In order to redirect it on all your devices, install Firefox. It can install extensions on Android, too. Should solve it for everything except smart TVs (Firefox for Amazon TV can't install extensions) and iOS.
- jvanderbot 7y agoWell that's perfect. Thank you.
- rkalfane 7y agoYes, you could write a proxy auto-config file[1], host it somewhere and have it rewrite the urls you want. I think that's how an ad-blocker worked on iOS before they enabled the functionality. [1] https://en.wikipedia.org/wiki/Proxy_auto-config https://en.wikipedia.org/wiki/Proxy_auto-config
- cesarb 7y ago> (I assume /etc/hosts would work for linux?) No, because both www.reddit.com and old.reddit.com (in fact, *.reddit.com) already map to the same IP address. They are distinguished through the Host HTTP header. The only way to do that mapping would be within the browser (or with a MITM proxy, which I wouldn't recommend).
- est31 7y ago> We'll need to work together on challenges like tooling If you wonder what is meant by that, I think I know of an example. They have done this (quite unusual) choice to not include a Cargo.lock into their project because it gives a bad developer experience on merge conflicts [1]. They'd love to have a merge tool for the purpose, see more in [2]. [1]: https://github.com/libra/libra/issues/52 https://github.com/libra/libra/issues/52 [2]: https://github.com/rust-lang/cargo/issues/1818 https://github.com/rust-lang/cargo/issues/1818
- xvilka 7y agoAnd WindRiver just sent their first pull request[1] to support VxWorks as a target. Shameless plug - I made a proposal[2] to create Business Applications Working Group to help promote Rust in enterprise software, quant and "normal" finances, taxes, and governance, the areas now completely dominated by COBOL and Java. Rust is a perfect fit for such applications, offering more safety and security, speed and higher levels of abstraction. Hopefully, formal verification will arrive soon as well. [1] https://github.com/rust-lang/rust/pull/61946 https://github.com/rust-lang/rust/pull/61946 [2] https://internals.rust-lang.org/t/proposal-business-applications-working-group/10400/2 https://internals.rust-lang.org/t/proposal-business-applicat...
- wbl 7y agoYou don't need to avoid the GC. Why not SML or the like? Why Rust?
- jonbarker 7y agoIt's not uncommon for up to 1/3 of usage and therefore the bill on VMs in the cloud to be consumed by garbage collection. So if you can rewrite it without a garbage collector, you can save money. A great book on this topic is "The Beast Is Back" by jetbrains. Advocating C++ in that case (written in 2015). If GC makes you more productive, that's good, but at some point rewriting things without GC makes sense.
- icebraining 7y agoHow much is the usage consumed by malloc/free or equivalent?
- ncmncm 7y agomalloc/free are not used in modern C++. The fraction of runtime involving allocation and deallocation, at the level where they happen, is typically negligible. In servers, after program startup, it is often (and deliberately) exactly zero.
- geodel 7y agoGreat. I think this is the kind of booster Rust sorely needed.
- ncmncm 7y agoWhen security holes in Libra implementations surface, that will reflect badly on Rust. There will of course be explanations why the holes are really not Rust's fault, and that bugs and security failings are possible in any language, but it will force a more realistic assessment of Rust's strengths.
- geodel 7y agoRight. And I think it is reasonable thing to happen. Languages can't mature without big public successes and failures.
- JoshTriplett 7y agoThere have already been such assessments. For instance, in https://hacks.mozilla.org/2019/02/rewriting-a-browser-component-in-rust/ https://hacks.mozilla.org/2019/02/rewriting-a-browser-compon... , Mozilla estimated that writing a given browser component (specifically the CSS engine) in Rust, 51 of its 69 security bugs (73.9%) wouldn't have happened. The other 18 weren't things that the implementation language doesn't inherently help with.
- blub 7y agoThe problem with Mozilla's C++ code is that it was developed in a time where memory-safety was an afterthought and they're still paying for that. Rewriting it in anything will offer a great opportunity of improving it. For example, the real fix for their vulnerable code example is using automatic bounds checking, just as Rust does. Replacing [] with at, eliminates the vulnerability. Most C++ programmers are allergic to at, so Mozilla could have created some container wrappers that do this by default. GCC and I think also clang have a macro which adds automatic bounds-checking to the STL containers.
- not_a_cop75 7y agoI hate Facebook, but Rust is probably the best possible choice.
- langitbiru 7y agoBitcoin (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++.
- saagarjha 7y ago> 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?
- ncmncm 7y agoWishful 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.
- damnyou 7y agoIt 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.
- deleted 7y ago[deleted]
- shmerl 7y ago> 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.
- adamnemecek 7y agoThe language of Libre "Move" is inspired by logic. It makes sense that they would pick a language that is also inspired by linear logic.
- seomis 7y agoBruh. It's Li𝘣𝘳𝘢.
- jammygit 7y agoLibra I thought?
- jackgavigan 7y agoSomeone has created a Rust crate called libra, which claims to be a "Simple fantasty Adventure MUD" (sic). It's currently just a "Hello, world!" program. What are the chances it's a placeholder for malicious/trojan code intended to steal Libra coins? (c.f. the event-stream backdoor[2]) [1] https://crates.io/crates/libra https://crates.io/crates/libra [2] https://news.ycombinator.com/item?id=18534392 https://news.ycombinator.com/item?id=18534392
- apta 7y agoCan't Facebook call it something like FB.Libra?
- steveklabnik 7y agoA dot is not allowed, but they could use a dash or underscore.
- hombre_fatal 7y agoGlobal unqualified namespace is a classic mistake. Causes all sorts of silly "squatting" and drama issues. Should really be: https://crates.io/crates/someorg/libra https://crates.io/crates/facebook/libra People like unqualified names because it's slightly cute, though.
- Waterluvian 7y agoI have been enjoying how npm is addressing this with @organization/project. Makes using npm a little less awful these days.
- jopsen 7y agoThe argument I saw was that a global namespace ensured: A) Packages can change owners without changing names (and breaking downstreamers) B) It encourages creative names, rather can calling something myusername/http, you have to give the package a real name like hyper, express, curl, etc.
- _def 7y agooff-topic: do you think it's safe to assume consent of a site's cookie policy by clicking/scrolling like on https://libra.org/ https://libra.org/ ? I actually like it because these banners are just annoying, but I'd be afraid to do something like this (The first time I checked out that site I only noticed that something disappeared).
- eggy 7y agoI wonder if they even considered Ada/SPARK 2014, or are program languages like fashion trends, and Rust has the runway right now. I like Rust, but I would think the amount of work that has been put into Ada/SPARK 2014 would make it the better choice for the problem set.
- steveklabnik 7y agoI would imagine that Rust’s advantage over Ada here is in the second paragraph. I don’t know if they directly considered it or not.
- eggy 7y agoSteve, I would agree; you are a large part for that momentum. Community is important, and the SPARK 2014/Ada community has proven itself to be very helpful, and has a long history behind it. I know big business decisions are sometimes made by advocates or evangelists, but you would hope somebody did their pros/cons matrix on top of that one criteria. SPARK 2014 has really surprised me in terms of what it brings to the table aside from Ada's legacy, which is also still evolving.