Hacker News new | ask | show | jobs
by eqvinox 388 days ago
It doesn't feel appropriate to comment there for me not knowing any Rust really, but "lax_" (or "relax_") would have the extra benefit of being very short.

(Is this going to overload operators or are people going to have to type this… a lot… ?)

2 comments

Rust has some precedence for adding convenience newtypes with overloaded operators (eg. `Wrapping<I>´ for `I.wrapping_add(I)` etc). Such a wrapper isn't currently proposed AFAIK but there's no reason one couldn't be added in the future I believe.
For giggles, here's one I whipped up, along with an example use: https://godbolt.org/z/Eezj35dzc
Having done unspeakable things with the C preprocessor myself, this Rust macro soup truly warms my heart <3
Oh this is simple, this is just a bit of basic expansion to generate boilerplate. The real experts can do some gnarly and amazing stuff with macros.
Wow, that's some hardcore unrolling.
Right, as long as the LLVM intrinsics are exposed you could just put that in a crate somewhere.
WebAssembly also ended up calling its set of similar instructions relaxed.