with apologies to Rust maintainers it is a well-known fact that Rust standard library uses specialization internally. over the years, there were various attempts to observe this behaviour in user code and thus achieve ersatz specialization on stable. for example, removed Clone specialization on arrays was used in such a way by a high-profile library . the problem with this trick is that…
let’s start with some context: I’m currently writing unflake , which is essentialy a userspace reimplementation of nix flakes. to do that, I need some understanding of what flakes are : I want my implementation to be compatible with the upstream one. unfortunately, flakes don’t have a specification, are barely documented and upstream doesn’t really know how they work either (which is a big part of…
this is a horror story about Wayland, scaling and debugging multi-layered abstractions. I’m currently working on a project that requires me to write a GUI app. egui is generally a pleasure to work with, at least for simple cases, so I went with it. to start, I needed a fixed-size window: for various reasons, making my app flexible-size didn’t make much sense. I used eframe (egui’s standalone…
this has been bothering me for a while now, so I want to write down my thoughts so I can get it out of my head and move on. we’re gonna talk about how Deno approaches security, specifically with its permissions system, and why I think this approach is fundamentally insecure and misleading. wait, what’s Deno? Deno is a language runtime for JavaScript. it consists of a standard library, a package…
there’s an annoyance that comes up regularly when dealing with error paths: returning an error (or raising an exception) means you lose all the context you had stored in local variables. this prevents you from printing a nice error message, emitting useful metrics or just otherwise acting on this information. this is especially problematic when task is terminated from outside, like on timeouts.…
there is one useful trick in rust that’s usually called “autoref specialization”. it allows to select a method implementation based on traits some type implements. if you’re not familiar with the technique itself, dtolnay described it nicely here . this post is going to be using a variation of this idea that uses auto de ref instead of autoref, but the principle is the same: (ab)use the method…