Rusty Russell

ozlabs.org/~rusty · Personal blog · on HN since 2012

Rusty Russell, a Linux kernel developer, writes about API design, including his lists on making interfaces hard to misuse.

What HN saysHN commenters cite his classic "Hard to Misuse" interface levels list and its follow-up as a favorite reference for API and C design.
18HN people shared it
16linked it in comments
7stories submitted
134story points
2 years agolast shared
2012people per year2026

Most-shared posts

  1. 1
    What If I Don't Actually Like My Users? (2008)
    8 people · 120 points · first shared 2014 · 51 comments on HN
  2. 2
    How Do I Make This Hard to Misuse?
    8 people · 13 points · first shared 2014 · 1 comments on HN
  3. 3
    Img39
    2 people · first shared 2019
  4. 4
    Easy to use versus hard to misuse
    1 people · 1 points · first shared 2012 · discussion on HN
  5. 5
    2007 05 04
    1 people · first shared 2016
  6. 6
    Stupidity
    1 people · first shared 2016
  7. 7
    Virtio paper.pdf
    1 people · first shared 2019
  8. 8
    Rproxy
    1 people · first shared 2013
  9. 9
    Linux.conf.au 2004 emails
    1 people · first shared 2016
  10. 10
    Blocksize pretty.svg
    1 people · first shared 2015

What HN people wrote when they linked it

Karellen · 2020-10-28
I like Rusty Russell's classic "Hard to Misuse Interface Levels". The first couple of items are 0: Impossible to get wrong/DWIM 1: Compiler/linker won't let you get it wrong ...through 9: Read the correct LKML thread and you'll get it right - SET_MODULE_OWNER ...all the way up to 17. I'll let you discover the rest yourself :-) https://ozlabs.org/~rusty/ols-2003-keynote/img39.html
JoshTriplett · 2019-06-19
> Replacing [] with at, eliminates the vulnerability. And for decades of C and C++ programmers, [] is still the most obvious way to index an array. And the most obvious way creates potential security vulnerabilities. See Rusty Russell's classic "easy to use versus hard to misuse" posts: http://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html and https://ozlabs.org/~rusty/index.cgi/tech/2008-04-01.html .
cesarb · 2016-08-10
I always liked Rusty's list on making an API "hard to misuse" (and its followup): https://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html https://ozlabs.org/~rusty/index.cgi/tech/2008-04-01.html
mananaysiempre · 2025-01-10
> everybody could (and should?) just start declaring size parameters before their respective buffer parameters in new code I know that was a common opinion pre-C23, but it feels like the committee trying to reshape the world to their desires (and their designs). It's a longstanding convention that C APIs accept (address, length) pairs in that order. So changing that will already get you a score of -4 on the Hard to Misuse List[1], for "Follow common convention and you'll get it wrong". (The sole old exception in the standard is the signature of main(), but that's somewhat vindicated by the fact that nobody really needs to call main(); there is a new exception in the standard in the form of Meneide's conversion APIs[2], which I seriously dislike for that reason.) The reason I was asking is that 'uecker said it was requested at the committee draft stage for C23 by some of the national standards orgs. That's already ancient history of course, but I hoped the idea itself was still alive, specifically because I don't want to end up in the world where half of C APIs are (address, length) and half are (length, address), when the former is one of the few C conventions most everyone agrees on currently. [1] https://ozlabs.org/~rusty/index.cgi/tech/2008-04-01.html [2] https://thephd.dev/_vendor/future_cxx/papers/C%20-%20Restartable%20and…
jbandela1 · 2023-10-04
Here are the original lists: How Do I Make This Hard to Misuse? - https://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html What If I Don't Actually Like My Users? - https://ozlabs.org/~rusty/index.cgi/tech/2008-04-01.html
amboar · 2020-09-06
Rusty's API scale captures this approach really well: How Do I Make This Hard to Misuse? https://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html What If I Don't Actually Like My Users? https://ozlabs.org/~rusty/index.cgi/tech/2008-04-01.html
diegocg · 2019-05-03
In case someone is curious about the original presentation https://ozlabs.org/~rusty/ols-2003-keynote/img39.html
pm215 · 2016-12-29
You reply to the email saying 'sorry, but we can't accept your code because...'. (The shortest way to do this is to just reply saying 'NAK', but I agree with Rusty Russell that nak-mails are generally unfriendly and a bad idea: http://ozlabs.org/~rusty/index.cgi/tech/2007-05-04.html)
lstamour · 2016-06-03
Note the "Hard to Misuse" list is at http://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html
ajdlinux · 2016-05-31
"I would suggest re-naming "rmbdd()". I _assume_ that "dd" stands for "data dependent", but quite frankly, "rmbdd" looks like the standard IBM "we lost every vowel ever invented" kind of assembly lanaguage to me. I'm sure that having programmed PPC assembly language, you find it very natural (IBM motto: "We found five vowels hiding in a corner, and we used them _all_ for the 'eieio' instruction so that we wouldn't have to use them anywhere else")." -- Linus Torvalds, LKML (http://ozlabs.org/~rusty/linux.conf.au-2004-emails.txt)
pstrateman · 2015-08-26
The simple truth of the matter is that there is no urgent action required. Blocks are only just now half full on average. http://ozlabs.org/~rusty/diagrams/blocksize-pretty.svg
samworm · 2013-11-28
I agree the "send me differences" model is appealing. A version based off rsync was created back in 1999 but patents killed it. I think the patent in question runs out pretty soon though... The Tragedy of the RProxy: http://ozlabs.org/~rusty/rproxy.html
mjb · 2019-02-06
Some background reading that may make this help makes sense to folks from outside the domain: https://www.ozlabs.org/~rusty/virtio-spec/virtio-paper.pdf Block storage (virtio-block) is way simpler than file systems, both in the virtio implementation and in the host filesystem implementation. Simple is good, both for security reasons and because it makes it easier to reason about performance isolation between guests. The cost is obviously in features, and in making it hard to share data (and very hard to multi-master data) between multiple VMs. To see how simple virtio-block is, take a look at Firecracker's implementation (https://github.com/firecracker-microvm/firecracker/blob/master/devices… The existing alternative, as the post talks about, is 9p which has a lot of shortcomings, so this is interesting. I suspect it's use is mostly going to be in development environments and client-side uses of containers, and server-side users of virtualization will likely stick with block (or filesystem implemented in guest userland).

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close