flâneur

Everyone Says Assembly Is Untyped—Everyone Is Wrong - gingerBill

gingerbill.org · 6,586 words · saved by 1 readers

The most important aspects are of this article listed below. I am not aware of any other assembly (GCC/Clang/Rust/Go…) that would combine all of these aspects: I have been asked why Odin even bothers having its own custom inline assembler at all. Isn’t inline assembly a solved problem? You take a string, you hand it to the assembler, and you let that external assembler sort out the rest. Everyone from GCC to Clang to Rust  does more or less this. The wheel has been invented, right? This is precisely the design I did not want, and the design that most languages have settled for. My goal from the beginning was to have an inline assembler that is actually integrated into the rest of the language rather than feeling bolted on the side. And I honestly believe that what Odin has ended up with is the best inline assembly system in any language right now. I don’t say that lightly, and by the end of this article I hope you’ll at least understand why I believe that to be true. Let’s start with t

TL;DR: I believe Odin’s inline assembly is currently the best out of any language. The most important aspects are of this article listed below. I am not aware of any other assembly (GCC/Clang/Rust/Go…) that would combine all of these aspects: Inline assembly is organized into asm “templates”, similar to and callable as procedures. asm templates integrate with rest of the code, through bindings specifying clobbers, pinned, tied, and scratch registers. Assembly syntax is unified across ISAs and consistent with Odin syntax. Assembly is fully type checked, just like rest of Odin code.…

saved by

related reading