parking_lot: ffffffffffffffff...
https://fly.io/blog/parking-lot-ffffffffffffffff/ [fly.io]
2025-05-31 02:27
tags:
bugfix
concurrency
programming
rust
You’re reading a 3,000 word blog post about a single concurrency bug, so my guess is you’re the kind of person who compulsively wants to understand how everything works. That’s fine, but a word of advice: there are things where, if you find yourself learning about them in detail, something has gone wrong.
source: L
Making the rav1d Video Decoder 1% Faster
https://ohadravid.github.io/posts/2025-05-rav1d-faster/ [ohadravid.github.io]
2025-05-25 00:24
tags:
c
compiler
perf
programming
rust
rav1d is a port of dav1d, created by (1) running c2rust on dav1d, (2) incorporating dav1d’s asm-optimized functions, and (3) changing the code to be more Rust-y and safer.
Video decoders are notoriously complex pieces of software, but because we are comparing the performance of two similar deterministic binaries we might be able to avoid a lot of that complexity - with the right tooling.
source: HN
Evolution of Rust compiler errors
https://kobzol.github.io/rust/rustc/2025/05/16/evolution-of-rustc-errors.html [kobzol.github.io]
2025-05-16 22:13
tags:
compiler
development
rust
ux
I wrote a script that downloaded all stable Rust releases all the way back to 1.0, executed each stable version of the compiler on a set of small programs containing an error and gathered the compiler standard (error) output.
source: HN
Beating the Fastest Lexer Generator in Rust
https://alic.dev/blog/fast-lexing [alic.dev]
2025-05-09 19:07
tags:
compiler
perf
programming
rust
text
I was aware of the efficiency of state machine driven lexers, but most generators have one problem: they can’t be arbitrarily generic and consistently optimal at the same time. There will always be some assumptions about your data that are either impossible to express, or outside the scope of the generator’s optimizations. Either way, I was curious to find out how my hand-rolled implementation would fare.
source: L
Marching Events: What does iCalendar have to do with ray marching?
https://pwy.io/posts/marching-events/ [pwy.io]
2025-04-18 05:31
tags:
format
programming
rust
I’ve found a way of describing occurrences through distance functions. This means that instead of implementing logic for all combinations of frequencies and parameters - as that spooky table from before suggests one might do - we can simply compose a couple of distance functions together.
source: HN
Static search trees: 40x faster than binary search
https://curiouscoding.nl/posts/static-search-tree/ [curiouscoding.nl]
2025-01-02 01:18
tags:
compsci
perf
programming
rust
In this post, we will implement a static search tree (S+ tree) for high-throughput searching of sorted data, as introduced on Algorithmica. We’ll mostly take the code presented there as a starting point, and optimize it to its limits. For a large part, I’m simply taking the ‘future work’ ideas of that post and implementing them. And then there will be a bunch of looking at assembly code to shave off all the instructions we can. Lastly, there will be one big addition to optimize throughput: batching.
https://en.algorithmica.org/hpc/data-structures/s-tree/
source: HN
Leaving Rust gamedev after 3 years
https://loglog.games/blog/leaving-rust-gamedev/ [loglog.games]
2024-04-28 02:32
tags:
development
gaming
programming
rust
This post isn’t a scientific evaluation or an A/B study. It’s my personal opinion after trying to make Rust gamedev work for us, a small indie developer (2 people), trying to make enough money to fund our development with it.
source: L
On Tech Debt: My Rust Library is now a CDO
https://lucumr.pocoo.org/2024/3/26/rust-cdo/ [lucumr.pocoo.org]
2024-03-26 20:59
tags:
development
library
rust
There is a joke that if there is tech debt, surely there must be derivatives to work with that debt? I’m happy to say that the Rust ecosystem has created an environment where it looks like one solution for tech debt is collateralization.
source: HN
Identifying Rust's collect::<Vec<_>>() memory leak footgun
https://blog.polybdenum.com/2024/01/17/identifying-the-collect-vec-memory-leak-footgun.html [blog.polybdenum.com]
2024-01-18 17:32
tags:
malloc
programming
rust
turtles
This is the story of how I identified the bug. (TLDR: collect::<Vec<_>>() will sometimes reuse allocations, resulting in Vecs with large excess capacity, even when the length is exactly known in advance, so you need to call shrink_to_fit if you want to free the extra memory.)
Ordinarily, that wouldn’t have been a problem, since the into_iter().map().collect() line used to pack them into (u32, u32)s would allocate a new vector with only the exact amount of space required. However, thanks to the allocation reuse optimization added in Rust 1.76, the new vec shared the backing store of the input vec, and hence had a capacity of 16560, meaning it was using 132480 bytes of memory to store only 16 bytes of data.
source: HN
Polonius update
https://blog.rust-lang.org/inside-rust/2023/10/06/polonius-update.html [blog.rust-lang.org]
2023-10-08 19:10
tags:
compiler
compsci
programming
rust
update
Polonius refers to a few things. It is a new formulation of the borrow checker. It is also a specific project that implemented that analysis, based on datalog. Our current plan does not make use of that datalog-based implementation, but uses what we learned implementing it to focus on reimplementing Polonius within rustc.
source: L
FAAS in Go with WASM, WASI and Rust
https://eli.thegreenplace.net/2023/faas-in-go-with-wasm-wasi-and-rust/ [eli.thegreenplace.net]
2023-05-11 21:07
tags:
go
programming
rust
wasm
web
This post is best described as a technology demonstration; it melds together web servers, plugins, WebAssembly, Go, Rust and ABIs. Here’s what it shows:
How to load WASM code with WASI in a Go environment and hook it up to a web server.
How to implement web server plugins in any language that can be compiled to WASM.
How to translate Go programs into WASM that uses WASI.
How to translate Rust programs into WASM that uses WASI.
How to write WAT (WebAssembly Text) code that uses WASI to interact with a non-JS environment.
source: L
How to Make Rust Leak Memory (Also: How to Make It Stop)
https://fly.io/blog/rust-memory-leak/ [fly.io]
2022-06-16 18:40
tags:
bugfix
investigation
malloc
programming
rust
Of course you can leak memory, even in Rust. For even medium-sized long-running applications, lots of graphs from a good memory profiler can make life better. And they’ll probably help you find the memory leak too.
How to speed up the Rust compiler in April 2022
https://nnethercote.github.io/2022/04/12/how-to-speed-up-the-rust-compiler-in-april-2022.html [nnethercote.github.io]
2022-04-13 20:08
tags:
compiler
development
perf
rust
update
In my last post I introduced the Compiler performance roadmap for 2022. Let’s see how things are progressing.
Along the way I had to undo some optimizations I had added to this code a couple of years ago. Those optimizations turned out to be useful for one kind of expensive macro (with many rules but no metavariables) present in the html5ever benchmark. But such macros aren’t common in practice, and these optimizations were unhelpful for more typical expensive macros, which are recursive, have fewer rules, and use metavariables. This shows the value of a good benchmark suite.
source: L
Why Rust mutexes look like they do
http://cliffle.com/blog/rust-mutexes/ [cliffle.com]
2022-04-02 05:25
tags:
concurrency
programming
rust
In the rest of this post I’ll walk through a typical C mutex API, compare with a typical Rust mutex API, and look at what happens if we change the Rust API to resemble C in various ways.
source: HN
Cranelift, Part 3: Correctness in Register Allocation
https://cfallin.org/blog/2021/03/15/cranelift-isel-3/ [cfallin.org]
2021-03-19 23:12
tags:
compiler
compsci
development
fuzzing
jit
programming
rust
testing
In this post, I will cover how we worked to ensure correctness in our register allocator, regalloc.rs, by developing a symbolic checker that uses abstract interpretation to prove correctness for a specific register allocation result. By using this checker as a fuzzing oracle, and driving just the register allocator with a focused fuzzing target, we have been able to uncover some very interesting and subtle bugs, and achieve a fairly high confidence in the allocator’s robustness.
source: HN
Rust after the honeymoon
http://dtrace.org/blogs/bmc/2020/10/11/rust-after-the-honeymoon/ [dtrace.org]
2020-10-11 20:55
tags:
development
programming
rust
So Rust is going really well for us at Oxide, but for the moment I want to focus on more personal things — reasons that I personally have enjoyed implementing in Rust. These run the gamut: some are tiny but beautiful details that allow me to indulge in the pleasure of the craft; some are much more profound features that represent important advances in the state of the art; and some are bodies of software developed by the Rust community, notable as much for their reflection of who is attracted to Rust (and why) as for the artifacts themselves.
source: L
Rust programming language exploit mitigations
http://rcvalle.blog/2020/09/16/rust-lang-exploit-mitigations/ [rcvalle.blog]
2020-10-02 21:28
tags:
compiler
defense
development
rust
security
This section documents the exploit mitigations applicable to the Rust compiler when building programs for the Linux operating system on the AMD64 architecture and equivalent.
source: L
Implementing a Type-safe printf in Rust
https://willcrichton.net/notes/type-safe-printf/ [willcrichton.net]
2020-08-17 04:35
tags:
programming
rust
text
type-system
I show how to use heterogeneous lists and traits to implement a type-safe printf in Rust. These mechanisms can ensure that two variadic argument lists share important properties, like the number of format string holes matches the number of printf arguments.
source: HN
"Rust does not have a stable ABI"
https://people.gnome.org/~federico/blog/rust-stable-abi.html [people.gnome.org]
2020-08-17 04:28
tags:
development
library
programming
rust
Or more exactly, why does this happen, and why do people perceive it as a problem?
source: L
xi-editor retrospective
https://raphlinus.github.io/xi/2020/06/27/xi-retrospective.html [raphlinus.github.io]
2020-07-01 00:55
tags:
compsci
concurrency
development
programming
rust
swtools
text
I still believe it would be possible to build a high quality editor based on the original design. But I also believe that this would be quite a complex system, and require significantly more work than necessary.
A few good ideas and observations could be mined out of this post.
source: L