869 private links
An article on how Rust can benefit from an effect system.
This article explores how we can separate the lifetime of values in a container from the lifetime of the container structure. The author approach the problem by issuing a token (zero-sized type) with an invariant lifetime. TIL ghost token. I think the type AppendOnlyVec (Vec<Box<T>>) could make a more straightforward example.
A concise and complete cheatsheet for the format!
macro.
It's a pleasurable and informative read. The nature of algebraic effect was accurately and concisely pointed out. This has been one of the best write-up on algebraic effects implementation in Rust I've read so far.
A nice article on the exploration of a performance issue, which ultimately leads to the discovery of a bug in AMD CPU.
A handy tool to play with Rust's regex/fancy-regex.
Fascinating paradigm for execution: log all side effects and restore execution deterministically.
A really innovative way to store exact floating point numbers:
- for "safe numbers" (numbers whose value can be expressed precisely in floating point), store them as is
- for non-"safe numbers", store two safe numbers as denominator and nominator.
There is a lot of this method comparing to the other alternatives:
- BigDecimal: a lot faster than arbitrary precision BigDecimal
- Rational: denom and nom deoesn't blow up to extremely large numbers
And it is also faster and uses less space.
A modern typesetting tool as an alternative to TeX. The clear syntax is not a lot more complicated than markdown yet it supports a lot of typesetting features, scripting, math symbols, etc. The syntax is certainly a huge improvement comparing to the obscure TeX. I may give it a try when there is an Emacs mode for that.
This is a not-so-short article teeming with "Aha!" moments.
- reduce all branching in the solution to a math expression
- converted to a lookup algorithm
- we need a perfect hash function
- use multiplication + shr as bit mixer
- store answers directly in a single u32 integer
- cram the answers even tighter with overlaps
The post shows off lot of tricks, very interesting read.
An article about Ray casting, WASM4 (a game console emulator that runs WASM "cartridges"), binary size reduction, and generally how to interface with WASM in Rust.
I learned a bit about how bluetooth low energy (BLE) works from this article.
A listing of good quasi-standard library for sundry purposes for the lazies.
Rust questions which are quite tricky. I learned a lot (mostly useless) knowledge form it.
Rust Higher-Rank Trait Bound (HRTB) explained beautifully!
Another fasterthanlime's article on troubleshooting Rust memory leaks. It's good to learn about the memory profiler bytehound (https://github.com/koute/bytehound). I also learned about this Rust-native embedded language called Rhai.
Welcome to the dark side of Rust :)
A bunch of funny Rust trivias! (by @Jonhoo)
A nicely looking and informative rust cheat sheet. Not sure when it's helpful, but it looked like good place for learn for certain unfamiliar practices.
Good info on how to use GDB with Rust, as well as other profiling/tracing tools. It also showcased how to use various error handling tools to catch and display nested exceptions.