Get the latest tech news

The Rust calling convention we deserve


I will often say that the so-called “C ABI” is a very bad one, and a relatively unimaginative one when it comes to passing complicated types effectively. A lot of people ask me “ok, what would you use instead”, and I just point them to the Go register ABI, but it seems most people have trouble filling in the gaps of what I mean.

Although I did sweep debugability under the rug, one nice property-Zcallconv=fast will not have is that it does not place arguments in the C ABI order, which means that a reader replying on the “Diana’s silk dress cost $89” mnemonic on x86 will get fairly confused. For that reason, I am happy to provide the Rust compiler team expert knowledge on getting LLVM to do the right thing in service of making optimized code faster. Although I did sweep debugability under the rug, one nice property-Zcallconv=fast will not have is that it does not place arguments in the C ABI order, which means that a reader replying on the “Diana’s silk dress cost $89” mnemonic on x86 will get fairly confused.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Rust

Rust

Photo of calling convention

calling convention

Related news:

News photo

Rust-Written LAVD Kernel Scheduler Shows Promising Results For Linux Gaming

News photo

Show HN: a Rust based CLI tool 'imgcatr' for displaying images

News photo

Recall.ai (YC W20) is hiring engineer #4 (Rust and large scale infra)