3 ms·
I'm no C++ dev, but as an outsider, it sure reads like the whole "int is variable length" mistake again.
by stephbook 5mo ago
I'm no C++ dev, but as an outsider, it sure reads like the whole "int is variable length" mistake again.
- pjmlp 5mo agoThat abstraction is occasionally usable in low level systems code, that is why Go, Rust, D and C# support it as well. Also to note that is C not C++.
- IshKebab 5mo agoIn a way it's worse because at least with int you're not really expecting to run the same binary on architectures with different int lengths, and also for several decades there have only been two realistic options (32 or 64), which makes it easy to deal with. With RVV (and SVE I assume) there are a wider range of realistic options - at least 128, 256 and 512. The RVV spec allows up to 65536! Also it's totally reasonable to want a single binary to work with all of them so then you're into compiling parts of your code multiple times with runtime dispatch which is a right pain. I haven't looked into how Highway does it but I don't really know you you write length-agnostic code in high level languages. It's easy in assembly, but it sucks if you have to do it in assembly.
- camel-cdr 5mo agoHere is a highway example: https://gcc.godbolt.org/z/7sdPr61W6 https://gcc.godbolt.org/z/7sdPr61W6 There is a bit of boilerplate to get dynamic dispatch working, but apart from that it's quite simple to use.
- imtringued 5mo agoThat's a mistake for ABI visible types, yes.