eupolicy.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
This Mastodon server is a friendly and respectful discussion space for people working in areas related to EU policy. When you request to create an account, please tell us something about you.

Server stats:

214
active users

#rustlang

36 posts28 participants11 posts today
Taggart :donor:<p>Microsoft endorses writing drivers in <a href="https://infosec.exchange/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a>!</p><p>Cool, so when can I expect API docs with more than just C++ examples?</p><p><a href="https://techcommunity.microsoft.com/blog/surfaceitpro/safer-drivers-stronger-devices/4431411" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">techcommunity.microsoft.com/bl</span><span class="invisible">og/surfaceitpro/safer-drivers-stronger-devices/4431411</span></a></p>
Anisse<p>Overall, my Rust implementation (using the bzip2-rs crate) is (much) slower than than lbzip2, and faster than bzip2. For some reasons, it also sees huge performance boost on performance cores, most likely due to better IPC and branch prediction. 12/N</p><p><a href="https://social.treehouse.systems/tags/lbzip2" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lbzip2</span></a> <a href="https://social.treehouse.systems/tags/bzip2" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bzip2</span></a> <a href="https://social.treehouse.systems/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a></p>
Anisse<p>What about <a href="https://github.com/anisse/lbzip2-rs/" rel="nofollow noopener" target="_blank">my implementation of lbzcat</a>? It was designed to work with files generated by lbzip2: it does not work on some files compressed by bzip2, and silently produces incorrect output (!). So we'll limit benchmarking to files produced by lbzip2. 11/N</p><p><a href="https://social.treehouse.systems/tags/lbzip2" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lbzip2</span></a> <a href="https://social.treehouse.systems/tags/bzip2" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bzip2</span></a> <a href="https://social.treehouse.systems/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a></p>
Anisse<p>That gives us our baseline: bzip2 (in C) vs bzip2 (in Rust). But is it a fair enough comparison? I mentioned initially that I was implementing an lbzip2 "clone" (mostly a PoC for the decompression part). lbzip2 is an other program (a C binary, without a library), that can compress and decompress bzip2 files in parallel. Surely it should be slower than bzip2 since it has the parallel management overhead? 7/N</p><p><a href="https://social.treehouse.systems/tags/lbzip2" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lbzip2</span></a> <a href="https://social.treehouse.systems/tags/bzip2" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bzip2</span></a> <a href="https://social.treehouse.systems/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a> <a href="https://social.treehouse.systems/tags/perf" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>perf</span></a></p>
Anisse<p>But why? Let's see what <code>perf stat</code> has to say: the Rust version has less instructions, but with much less IPC (Instruction-per-clock); the Rust version also has less branches <em>and</em> misses in general. On the efficiency cores, we see that worse IPC and branch prediction of the Rust version give the advantage to the C version. 6/N</p><p><a href="https://social.treehouse.systems/tags/bzip2" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bzip2</span></a> <a href="https://social.treehouse.systems/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a> <a href="https://social.treehouse.systems/tags/perf" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>perf</span></a></p>
Anisse<p>What about the efficiency cores? (0-3 on my system); well, everything breaks down on those CPUs. The C implementation is now faster by a small margin! 5/N</p><p><a href="https://social.treehouse.systems/tags/bzip2" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bzip2</span></a> <a href="https://social.treehouse.systems/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a></p>
Anisse<p>So, let's start with the most obvious, the performance cores; they make the most sense for a CPU-intensive task; on my systems those are CPU 4-7. We can see here that the promise of the Trifecta Foundation holds, as the rust implementation is about 4% faster. 4/N</p><p><a href="https://social.treehouse.systems/tags/bzip2" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bzip2</span></a> <a href="https://social.treehouse.systems/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a> <a href="https://social.treehouse.systems/tags/AsahiLinux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>AsahiLinux</span></a></p>
Anisse<p>I'll do benchmarks using my own <code>bzcat</code> and comparing that with bzip2's original <code>bzcat</code>. All running on an M1 laptop running Linux. The M1 CPU has both performance and efficiency cores. We'll run the benchmark on both, using <code>hyperfine</code> to do the comparisons. 3/N</p><p><a href="https://social.treehouse.systems/tags/bzip2" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bzip2</span></a> <a href="https://social.treehouse.systems/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a> <a href="https://social.treehouse.systems/tags/AsahiLinux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>AsahiLinux</span></a> <a href="https://social.treehouse.systems/tags/hyperfine" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>hyperfine</span></a></p>
Anisse<p>First, let's look at the baseline. The <span class="h-card" translate="no"><a href="https://fosstodon.org/@trifectatech" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>trifectatech</span></a></span> foundation <a href="https://trifectatech.org/blog/bzip2-crate-switches-from-c-to-rust/" rel="nofollow noopener" target="_blank">recently claimed that bzip2-rs had faster decompression than libbzip2's original C implementation</a>. Is this true? Well, it depends... 2/N</p><p><a href="https://social.treehouse.systems/tags/bzip2" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bzip2</span></a> <a href="https://social.treehouse.systems/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a></p>
Anisse<p>For fun I implemented lbzip2's <a href="https://github.com/anisse/lbzip2-rs/" rel="nofollow noopener" target="_blank">lbzcat (parallel bzip2 decompression) clone in rust</a>, using the bzip2 crate. I found a lot of different interesting things. 1/N</p><p><a href="https://social.treehouse.systems/tags/lbzip2" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lbzip2</span></a> <a href="https://social.treehouse.systems/tags/bzip2" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bzip2</span></a> <a href="https://social.treehouse.systems/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a></p>
James Logan<p>If you have a vendetta against branches in floating-point calcs like I do, here's a neat trick - you can make a branching float calc that returns one of two different values depending on boolean logic and clips NaN values to zero, without producing a single jmp instruction!</p><p>This means you can clear the way for your autovectorizer and pipelining &amp; eliminate some potential cache misses, but still get to keep some expressive logic.</p><p>Snippet here <a href="https://godbolt.org/z/YsY31xxnj" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">godbolt.org/z/YsY31xxnj</span><span class="invisible"></span></a></p><p><a href="https://hachyderm.io/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a> <a href="https://hachyderm.io/tags/Performance" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Performance</span></a></p>
J Λ M Ξ S<p>anyone out there hiring <a href="https://mastodon.social/tags/rustlang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rustlang</span></a> programmers? looking for a fulltime role after doing time in academia</p><p>my most recent rust project is killabeez <a href="https://github.com/jmsdnns/killabeez" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/jmsdnns/killabeez</span><span class="invisible"></span></a></p>
Orhun Parmaksız 👾<p>Have you ever wanted to lint markdown... fast?</p><p>🌀 **mado** — A Markdown linter written in Rust 🦀</p><p>✅ Compatible with CommonMark and GitHub Flavored Markdown (GFM).</p><p>🔥 Approx. 49-60x faster than existing linters</p><p>⭐ GitHub: <a href="https://github.com/akiomik/mado" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/akiomik/mado</span><span class="invisible"></span></a></p><p><a href="https://fosstodon.org/tags/rustlang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rustlang</span></a> <a href="https://fosstodon.org/tags/markdown" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>markdown</span></a> <a href="https://fosstodon.org/tags/linter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>linter</span></a> <a href="https://fosstodon.org/tags/github" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>github</span></a> <a href="https://fosstodon.org/tags/actions" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>actions</span></a> <a href="https://fosstodon.org/tags/ci" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ci</span></a> <a href="https://fosstodon.org/tags/commandline" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>commandline</span></a></p>
Ivan Enderlin 🦀<p>Taming Floating-Point Sums, <a href="https://orlp.net/blog/taming-float-sums/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">orlp.net/blog/taming-float-sum</span><span class="invisible">s/</span></a>.</p><p>The article explores how to sum an array of floats with two goals: (i) the lowest imprecision possible, (ii) as fast as possible.</p><p>It goes from 5.5Gb/s with a high imprecision to 112Gb/s with an acceptable imprecision.</p><p>It also presents the new `std::intrinsics::fadd_algebraic` Rust function the author has written.</p><p><a href="https://floss.social/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a> <a href="https://floss.social/tags/performance" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>performance</span></a> <a href="https://floss.social/tags/float" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>float</span></a></p>
Rust Bytes<p>This Week's Project Spotlight 🦀 </p><p>RustFS</p><p>RustFS is a high-performance distributed object storage system built in Rust, and designed to rival giants like MinIO while waving the flag of open-source freedom.</p><p><a href="https://mastodon.social/tags/rust" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rust</span></a> <a href="https://mastodon.social/tags/rustlang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rustlang</span></a> <a href="https://mastodon.social/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a></p>
Lars Wirzenius<p>I've published version 0.3.0 of my Rust library clingwrap. It's something I wrote to make it easier for me to write command line programs. Highlights:</p><p>* TildePathBuf can be compared for equality.<br>* TOML supported as a configuration file format.</p><p>For the full release notes, see:<br><a href="https://app.radicle.xyz/nodes/radicle.liw.fi/rad:z3248z9KmBQ6Tf4mwXih1zKPtuSw5/tree/NEWS.md" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">app.radicle.xyz/nodes/radicle.</span><span class="invisible">liw.fi/rad:z3248z9KmBQ6Tf4mwXih1zKPtuSw5/tree/NEWS.md</span></a></p><p><a href="https://toot.liw.fi/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a></p>
Paul Götze<p>Very useful if you finally (after 5 years of existence and &gt;1M downloads) want to understand what the heck your are actually precompiling your Elixir NIF package for 😅:</p><p><a href="https://itsfoss.com/arm-aarch64-x86_64/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">itsfoss.com/arm-aarch64-x86_64/</span><span class="invisible"></span></a></p><p><a href="https://mastodon.social/tags/myelixirstatus" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>myelixirstatus</span></a> <a href="https://mastodon.social/tags/elixirlang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>elixirlang</span></a> <a href="https://mastodon.social/tags/opensource" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>opensource</span></a> <a href="https://mastodon.social/tags/foss" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>foss</span></a> <a href="https://mastodon.social/tags/rustlang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rustlang</span></a></p>
Oxidize Conf Sep 16-18, 2025<p>At Oxidize 2025, Daniel Silverstone (<span class="h-card" translate="no"><a href="https://social.codethink.co.uk/@codethink" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>codethink</span></a></span>) presents Safety Monitor - an open-source, configurable and Rust-based tool to track system state on Linux that supports defining a safe-state definition in mixed-criticality environments: <a href="https://oxidizeconf.com/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">oxidizeconf.com/</span><span class="invisible"></span></a> <a href="https://social.ferrous-systems.com/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a> <a href="https://social.ferrous-systems.com/tags/Safety" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Safety</span></a> <a href="https://social.ferrous-systems.com/tags/Linux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Linux</span></a></p>
happyborg<p>Good progress with <a href="https://fosstodon.org/tags/CodebergCI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CodebergCI</span></a> at last.</p><p>I have a <a href="https://fosstodon.org/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a> "hello world" building and deploying to 'pages' for Windows, and Linux on x86 and ARM. </p><p>I've yet to see if my dweb app will build though and still working on MacOS but have made progress with that too. </p><p><a href="https://fosstodon.org/tags/Codeberg" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Codeberg</span></a> is an awesome, non-profit that you can join, and a viable alternative to Microsoft github. Check it out.</p>
Diegovsky<p><a href="https://fosstodon.org/tags/rust" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rust</span></a> <a href="https://fosstodon.org/tags/rustlang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rustlang</span></a> low-level and <a href="https://fosstodon.org/tags/no_std" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>no_std</span></a> Devs: I have these memory registers which I can write to whenever needed.</p><p>Considering this is shared mutable static memory, does this violate aliasing rules in some way? It's impossible to cause memory unsafety because the content written is POD, no constructors, drops, etc.</p><p>I'm either copying/reading u8/u16 or C packed structs.</p>