Better Inline ASM

I would agree that creating Rust-specific asm DSL is way too labor intensive. Given that both GCC and LLVM had settled on mostly the same asm dialect, I think it makes a lot of practical sense to piggy-back on that.
Every C++ compiler out there includes some implementation-defined extensions. IMO, we should accept that there is going to be some of that in Rust too.

I am not so sure.

I think that the best source for ideas here is ironically the Lua community. LuaJIT is a blisteringly fast JIT compiler for Lua. It has been used for things like packet processing systems where one would not normally expect a dynamic language to be. It also comes with its own assembler DSL (DynASM), which has inspired a Rust version. There is also a WIP patch that provides LuaJIT with user-defineable intrinsics, which could provide a source of ideas for what user-defineable intrinsics could look like at an extreme bare-bones level. Rust being AOT-compiled rather than JIT-compiled, there are a few more issues (mostly related to cross-compilation), but I think this could be a useful source of ideas.

1 Like