In this first episode of the Rust Compile time series, Brian Anderson, one of Rust's original authors, shares with you his researches and experiences with Rust compile times, using the TiKV project as a case study.
I thought this might interest some people here: Lean (a theorem prover in C++) uses something like Arc for its garbage collection in the purely functional language it implements, and with some tricks (basically make_mut)…
Lately there has been considerable drama around Actix-web, for which I’ll point to Steve Klabnik’s A sad day for Rust to explain. This post is an opportunity to share some thoughts I’ve had about soundness, Rust, and open source community.
actix-web is dead. This situation is bad, from all sides. When Rust was a tiny, tiny community, I thought to myself, “wow, I wonder how long this will last? Probably 1.0 will kill it.” Sort of playing off of Eternal September, I assumed that over... | Steve Klabnik | “The most violent element in society is ignorance.” - Emma Goldman
This is my second post exploring the internals of tokio. You can find the first here. As a refresher the last article had two open questions at its core: How many outstanding requests can we stack up inside of tokio: Is there a finite queue somewhere or what?How does
My $dayjob is working in the cozy realms of Java, coddled by a GC and the amenities of a fat runtime. Common wisdom is to use a GC if you can afford it. I sometimes even write python if performance is a non-issue. Why would I then long for Rust every now and then?
This is a followup to the previous post about spinlocks. The gist of the previous post was that spinlocks has some pretty bad worst-case behaviors, and, for that reason, one shouldn’t blindly use a spinlock if using a sleeping mutex or avoiding blocking altogether is cumbersome.
2019 was a great year for clippy. It’s available on stable, even installed by default in the Rust distribution and selectable as a rustup component. We have more than 300 lints, and the upwards trend is unbroken. The lints that we have also see a steady stream of improvements.
Rusts type system requires that there only ever is one mutable reference to a value or one or more shared references. What happens when you need multiple references to some value, but also need to mutate through them? We use a trick called interor mutability: to the outside world you act like a value is immutable so multiple references are allowed. But internally the type is actually mutable.
All types that provide interior mutability have an UnsafeCell at their core. UnsafeCell is the only primitive that allows multiple mutable pointers to its interior, without violating aliasing rules. The only way to use it safely is to only mutate the wrapped value when there are no other readers. No, the garantee has to be even stronger: we can not mutate it and can not create a mutable reference to the wrapped value while there are shared references to its value.
Both the book and the std::cell module give a good alternative explanation of interor mutability.
What are some patterns that have been developed to use interior mutability safely?
How do multithreaded synchronization primitives that provide interior mutability follow similar principles?
I would like to understand how Tokio works. My interests run to the real-time and concurrent side of things but I don't know much about Tokio itself. Before the introduction of async and stable futures I more or less intentionally avoided learning it, not out of any sense that Tokio
reqwest v0.10 reqwest is a higher-level HTTP client for Rust. Let me introduce you the v0.10 release that adds async/await support! Some headline features are: • Add std::future::Future support (hello...
I think about failure a lot. Why do things go wrong and what can we do about it? Professionally I’m a software engineer, presently the Infrastructure Lead for Goodwater Capital. How does software fail and what can we do about it? How do human processes fail and what can
Hyperbola is an OS project aiming for maximum freedom in the ‘free software’ sense. They’ve apparently been around for two years, although I’ve only j…
It's that time of year again and we've got a small gift for all y'all for the holidays! The parallel compiler working group has implemented a plan for you to test out a build of rustc which has far more parallelism than …
I was experiencing occasional crashes in C++/WinRT’s resume_foreground function when it tries to resume execution on a dispatcher queue. Here’s a simplified version of that function:
auto resume_foreground(DispatcherQueue const& dispatcher)
bool m_queued = false; bool await_ready()
We recently landed two PRs which together reformatted essentially all code in the compiler tree.
The first one, #65939, contained the initial formatting infrastructure. We currently use rustfmt directly, pinned to a version specified in src/stage0.txt. We expect to update it as needed, and otherwise once per cycle (coinciding with the bootstrap bump, most likely).
The second one which reformatted the majority of the codebase is #67540.
This change landed with the following rustfmt config. Note that this this configuration is subject to change (in particular, merge_derives may be removed in the future), but should be fairly stable. Your editor should automatically pick this configuration up inside the rust-lang/rust repository (it is located in the rustfmt.toml file in the root).
Today is a puzzle you can you can try to solve with the information you’ve learned about C++ coroutines and C++/WinRT.
C++/WinRT uses the IContextCallback interface to remember the context that initiated a co_await operation, so it can resume execution in the original apartment when the co_await completes.
In our last post about Async Rust we looked at Futures concurrency, and before that we looked at Rust streams. In this post we bring the two together, and will take a closer look at concurrency with Rust streams.
This year, I’ve been privileged to work with a great team across the DevOps community and help co-chair the new DeliveryConf 2020 conference, a non-profit conference dedicated to the technical aspects of Continuous Integration and Continuous Delivery. The conference is taking place on January 21 &
So you’re following along Kenny Kerr’s blog and you get to the part where he uses co_await on a time duration:
co_await 5s; so you try it:
using namespace std::chrono;
} and you get the error message
no callable ‘await_resume’