Elektrine
Log in Register
Paige Chat Timeline Gallery Friends Email Drive DNS Private DNS Domains VPN Kairo Nerve
Remote

Folkert de Vries

@folkertdev@hachyderm.io
mastodon 4.7.3
  • Open on hachyderm.io
0 Followers
0 Following
27 Posts
Joined December 18, 2022
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 5mo ago

The `cfg_select` macro is finally stable in today's rust 1.95 release

https://blog.rust-lang.org/2026/04/16/Rust-1.95.0/

It's a flexible way of picking an implementation based on information known at compile time, like the current target or a cargo feature.

I worked on the implementation of this macro in the compiler and pushing for its stabilization (updating tests, docs, the reference, etc.)

#rustlang

Announcing Rust 1.95.0 | Rust Blog
blog.rust-lang.org

Announcing Rust 1.95.0 | Rust Blog

Empowering everyone to build reliable and efficient software.

37
14
19
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 4mo ago

It's not in the 1.96 release blog post, but if you happen to have a mainframe in the basement you can now use vector registers in inline assembly on s390x

https://github.com/rust-lang/rust/pull/154184

The total number of users that will ever use that is probably roughly zero, but it's satisfying to tick off this sort of thing.

#rustlang

GitHub

stabilize s390x vector registers by folkertdev · Pull Request #154184 · rust-lang/rust

tracking issue: #133416 reference PR: rust-lang/reference#2215 Stabilizes s390x vector registers, e.g. unsafe fn vreg_128(x: i128) -> i128 { let y; asm!("vlr {}, {}", out(vreg)...

12
0
3
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 5mo ago

Rust should have guaranteed tail calls (but it's complicated). I did a deep dive on why tail calls are useful in low-level libraries, current blockers for stabilization that we know about, and what we can do to fix them:

https://trifectatech.org/blog/tail-calls-project-goal/

@wffl@im-in.space and I submitted a project goal to make progress on this niche but important feature.

#rustlang

Rust should have stable tail calls - Trifecta Tech Foundation
trifectatech.org

Rust should have stable tail calls - Trifecta Tech Foundation

19
0
9
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 5mo ago

On rust nightly you can now cfg on the current object format

https://github.com/rust-lang/rust/pull/155126

This is useful for e.g. selecting the right section name for #[link_section = "..."] and more generally for inline assembly and linker shenanigans.

#rustlang

GitHub

add `cfg(target_object_format = "...")` by folkertdev · Pull Request #155126 · rust-lang/rust

tracking issue: #152586 I'm implementing the predicate as target_object_format, because that's what is useful to me (for testing #[link_section = "..."] where mach-o has some extr...

16
0
8
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 7mo ago

The cfg_select! macro is now stable, and will be part of rust 1.95.

https://github.com/rust-lang/rust/pull/149783

This is a builtin replacement for cfg_if, and is really effective at cleaning up complex configuration logic.

#rustlang

GitHub

stabilize `cfg_select!` by folkertdev · Pull Request #149783 · rust-lang/rust

View all comments tracking issue: #115585 closes #115585 reference PR: cfg_select! macro reference#2103 Request for Stabilization Summary The cfg_select! macro picks the expansion corresponding t...

22
1
17
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 4mo ago

I too will be at #RustWeek

Come watch my talk on stabilizing features:

https://2026.rustweek.org/talks/folkert/

And I'm happy to chat about my work on c-variadic functions, guaranteed tail calls, zlib-rs, SIMD, and any other low-level shenanigans

#rustlang

hachyderm.io

Hachyderm.io

9
1
4
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 6mo ago

The message on an invalid target feature now suggests the most similar valid target feature names, for when it's been a while and you can't quite remember the exact target feature name.

https://github.com/rust-lang/rust/pull/153966

You can often make improvements like this by pattern matching on the surrounding code, you should give it a go when there are errors you run into that could be more helpful.

#rustlang

GitHub

suggest valid features when target feature is invalid by folkertdev · Pull Request #153966 · rust-lang/rust

I run into this quite frequently, where I remember some part of a feature name but not the exact name. Now this emits suggestions like error: the feature named `+avx512` is not valid for this targe...

15
0
7
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 6mo ago

I wrote about some rustc compiler contributions that derive from our low-level systems work

https://trifectatech.org/blog/fixing-our-own-problems-in-the-rust-compiler/

Also it's already out of date, because with https://github.com/rust-lang/miri/pull/4912 that got merged earlier today we will soon be able to run our AArch64 SIMD tests with miri.

#rustlang

Fixing our own problems in the Rust compiler - Trifecta Tech Foundation
trifectatech.org

Fixing our own problems in the Rust compiler - Trifecta Tech Foundation

12
1
3
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 5mo ago

The rust flate2 crate will make zlib-rs the default soon

https://github.com/rust-lang/flate2-rs/pull/542

Making zlib-rs the default is a free performance boost for the rust ecosystem. You can always switch back to the old default of miniz_oxide if you do encounter issues (though please let us know if you do, we should fix those!)

#rustlang

GitHub

switch to zlib-rs by default by folkertdev · Pull Request #542 · rust-lang/flate2-rs

We aim to make zlib-rs the default implementation in flate2 soon. The switch to zlib-rs (from the current default of miniz_oxide) massively improves performance. The release enabling zlib-rs by def...

9
0
5
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 7mo ago

Miri and const-eval can now execute c-variadic functions

https://github.com/rust-lang/rust/pull/150601

That's the last major technical hurdle for c-variadic functions. Time to stabilize this thing!

#rustlang

github.com
8
1
2
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 6mo ago

I helped with shaving some instructions from isfinite and similar float functions on a variety of platforms (notably aarch64):

https://github.com/llvm/llvm-project/pull/169402

This inefficiency was first reported on the rust issue tracker, then nerdsniped some LLVM folks, and I did the boring but necessary work of actually landing the change.

#llvm #rustlang

github.com
5
0
1
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 8mo ago

I've implemented a `simd_splat` intrinsic, a function that puts the same value in each SIMD lane. LLVM wasn't handling the previous workaround (a manual shuffle) very well.

https://github.com/rust-lang/rust/pull/151346

the intrinsic is now used by stdarch and portable_simd:

- https://github.com/rust-lang/stdarch/pull/2003
- https://github.com/rust-lang/portable-simd/pull/501

This intrinsic fixes a bunch of long-standing optimization issues, and appears to have sped up compile times for some crates too.

#rustlang

GitHub

add `simd_splat` intrinsic by folkertdev · Pull Request #151346 · rust-lang/rust

Add simd_splat which lowers to the LLVM canonical splat sequence. insertelement <N x elem> poison, elem %x, i32 0 shufflevector <N x elem> v0, <N x elem> poison, <N x i32> z...

8
0
4
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 5mo ago
Replying to
@bal4e I'd love to make progress on runtime feature detection at RustWeek/the All Hands cc @raph who I know is also interested in this.
3
12
0
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 5mo ago

In Frisian, when someone is not feeling well, you can wish them (to experience) bettership, i.e. the opposite of hardship.

Frustratingly this is not common in English and using it sounds like you want someone to have an improved boat.

https://en.wiktionary.org/wiki/bettership

en.wiktionary.org
2
1
0
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 5mo ago
Replying to
@pinskia @bal4e it would be neat if LLVM can paper over the differences. We'd need a portable and robust implementation of course. Though it's totally possible that we have a generic implementation and then a specialized one if the conditions are satisfied.
2
0
0
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 5mo ago
Replying to
@bal4e ah, right, that totally works. e.g. https://crates.io/crates/multiversion So we'd want something like this conceptually, but in std/the compiler. We're not using this in zlib-rs in part because it did not seem to matter that much versus just a well-predicted branch but mostly because of the additional unsafety.
crates.io
2
1
0
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 7mo ago

Niche rust feature now on nightly: carryless multiplication

https://github.com/rust-lang/rust/pull/152132

This operation is useful in some cryptography and checksum algorithms, as well as e.g. simdjson.

#rustlang #llvm

GitHub

implement `carryless_mul` by folkertdev · Pull Request #152132 · rust-lang/rust

tracking issue: #152080 ACP: rust-lang/libs-team#738 This defers to LLVM's llvm.clmul when available, and otherwise falls back to a method from the polyval crate (link). Some things are missing...

3
1
0
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 5mo ago
Replying to
@bal4e A problem with generics + proof objects currently is that inlining becomes load-bearing for correctness because functions don't have the required target features. There have been ideas of using effects (so like the WIP const polymorphism, but more general) to effectively make all downstream functions have the necessary target features. And then there is still the problem of how to dispatch. I believe we disqualified ifuncs as too hacky/fragile at some point, though I don't remember the details. In any case the stdlib implementation is bad when asking for multiple target features, it would be neat if we could move it into core, etc.
1
6
0
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 6mo ago
Replying to
@mjk@hachyderm.io Neat, I'm working on moving tail calls in rust forward, and having a real but relatively small interpreter to benchmark is really useful! https://rust-lang.github.io/rust-project-goals/2026/tail-call-loop-match.html I think your post again shows though that it's really hard to strike a balance between actually useful functionality and something that is portable enough that it can be stabilized. E.g. preserve-none does not work for many LLVM targets. Something might come of this thread though: https://discourse.llvm.org/t/experience-with-clang-musttail/89085 Also with latest nightly the add function does not do the register shuffle/spill any more, though it's still not perfect and I can still roughly reproduce your benchmark results on x86_64. https://gist.github.com/folkertdev/9097f4621ac00ab7829a41cd8b9a38dc
rust-lang.github.io

rust-project-goals moved to goals

1
1
0
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 6mo ago

Reading about the Russian conquest of central Asia

1
0
1
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 7mo ago

@harold@mastodon.gamedev.place we experimented with something like that, but the fallback is only really used during const evaluation and with the cranelift/gcc backends. So for now at least we picked the simple implementation in those cases, and trust that LLVM will normally provide something more efficient.

mastodon.gamedev.place

Harold Aptroot (@harold@mastodon.gamedev.place) - Gamedev Mastodon

1
0
0
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 7mo ago
Replying to
@pinskia I mean yeah, it's unfortunate. It's the only (remaining) ABI issue for f16 in rust.
0
0
0
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 7mo ago

@artagnon@mathstodon.xyz that's unfortunate, our internal cleanups will have to wait for LLVM 23 then

mathstodon.xyz

Ramkumar Ramachandra (@artagnon@mathstodon.xyz) - Mathstodon

0
0
0
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 7mo ago

@artagnon@mathstodon.xyz did lowering to the platform-specific instructions not make it into LLVM 22? On x86 the relevant PRs are from after the cutoff, but I thought that riscv at least made it in but can't get that to work

https://godbolt.org/z/Ercb7cMbE

Compiler Explorer - Rust (rustc nightly)
godbolt.org

Compiler Explorer - Rust (rustc nightly)

#![feature(uint_carryless_mul)] #[target_feature(enable = "zbkc")] #[unsafe(no_mangle )] pub fn clmul(rs1: usize, rs2: usize) -> usize { #[cfg(target_arch = "riscv32")] { (u32::carryless_mul(rs1 as u32, rs2 as u32) as usize) } #[cfg(target_arch = "riscv64")] { u64::carryless_mul(rs1 as u64, rs2 as u64) as usize } }

0
0
0
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 5mo ago

An excellent time to listen to my favorite Hungarian band, Thy Catafalque

https://www.youtube.com/watch?v=KnAq5dFHE9o&t=811s

Technically a one-man project, but live it has 4 vocalists, and a huge variety of sounds, e.g here they go from harsh vocals to a cello section from one song to the next. It's really neat.

Thy Catafalque - Live at Budapest Park 2023

0
0
0
0
Open post
Folkert de Vries @folkertdev@hachyderm.io
· 7mo ago
Replying to
@david_chisnall weird, I've updated the link to a different viewer, does that work?
0
1
0
0
Back
313k7r1n3
Elektrine

Tor hidden service

elekhj7afj4qnrr4yd3bkzslsyo5jgfxw3orgjkhlcxifueodybyiiad.onion

I2P eepsite

j6b6cyk6gjmepjih7jjadxgxvvf3lzzujljuu2v4biemzpg3naya.b32.i2p

Platform

  • Email
  • Chat
  • Timeline
  • VPN
  • DNS

Company

  • About
  • Contact
  • FAQ
  • Lite (no JS)

Legal

  • Terms of Service
  • Privacy Policy
  • Transparency Report
  • Report Abuse
  • Warrant Canary
  • VPN Policy

Support

  • support@elektrine.com
  • Report Security Issue
Mail client setup IMAP mail.elektrine.com:993 POP3 mail.elektrine.com:995 SMTP mail.elektrine.com:465
© 2026 Elektrine. All rights reserved. Server: 07:51:53 UTC