Re:Announcing Rust 1.27
by harry8 on Thursday June 21, 2018 @06:58PM
(#17369935)
Anyone happen to know when inline asm will hit stable?
[ Parent
| on HN ]
There are a lot of inline-asm related bugs in the compiler. I'm hitting them almost daily (I'm writing a kernel, so a fair bit of asm is going on here). You can see them in the bug tracker[0].
Stabilizing inline asm in its current form would be a mistake. It's simply not ready.
[0]: https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Ais...
"not ready, bugs." Is a perfectly good reason to hold it back. Thanks.
Re:Announcing Rust 1.27
by steveklabnik on Thursday June 21, 2018 @07:34PM
(#17370075)
Not slated any time soon. There are major questions about the approach; the current implementation is "do whatever LLVM does" which is not in itself stable, and so cannot be our final implementation.
clang manages with "Do whatever gcc does" I wonder why that isn't good enough. Doing nothing useful now as we might want to do something more useful later than what we can now seems a bit self defeating, but I may be missing the point because I want to us inline assembly language in unsafe blocks.
The problem is, rust has stability guarantees to uphold. As such, depending on the unstable behavior of an upstream component is not possible in the stable branch of rust.
Furthermore, there are worries that depending on the llvm behavior might impede work on alternative rust backends, such as cretonne.
Clang isn't using LLVM's inline asm directly, it translates from the (stable) GCC format into the internal LLVM one. rustc could theoretically do the same translation, but implementing that is significantly more work than just stabilizing the current implementation of asm!().
That and GCC's format is not exactly great. I'm generally looking unfavorably towards NIH but in this instance I really hope they figure out something better.
GCC's format mostly exposes parts of GCC's internal machine description language (to the point that, in the past, most of it was documented only on the "GCC internals" part of the manual). It comes from a simpler time.
What exactly are you wanting to do with it? There's a few different things might want, and for many of them, there may be alternatives that work just as well, if not better (e.g. instrinsics for the operations like SIMD: https://github.com/rust-lang-nursery/embedded-wg/issues/63).