Graham Jenkins

darkcoding.net · Personal blog · on HN since 2010

Graham Jenkins writes about Go, Rust, Linux internals, and code quality, including a post on building a tiny Rust binary.

What HN saysHN commenters link it for the guide to building a tiny Rust binary of around 500 bytes, and for the critique of Facebook's code quality.
44HN people shared it
20linked it in comments
27stories submitted
2.2Kstory points
1 year agolast shared
2010people per year2026

Most-shared posts

  1. 1
    Facebook’s code quality problem (2015)
    11 people · 602 points · first shared 2015 · 226 comments on HN
  2. 2
    A small Rust binary indeed (2022)
    5 people · 102 points · first shared 2023 · 47 comments on HN
  3. 3
    Credit card numbers
    3 people · first shared 2010
  4. 4
    A developer goes to a DevOps conference
    2 people · 409 points · first shared 2019 · 291 comments on HN
  5. 5
    epoll: The API that powers the modern internet (2022)
    2 people · 245 points · first shared 2022 · 65 comments on HN
  6. 6
    Go after four months
    2 people · 12 points · first shared 2012 · discussion on HN
  7. 7
    Go: The price of interface{}
    2 people · 1 points · first shared 2015 · discussion on HN
  8. 8
    Linux: What Can You Epoll?
    1 people · 264 points · first shared 2022 · 125 comments on HN
  9. 9
    In-memory key-value store in C, Go and Python
    1 people · 186 points · first shared 2012 · 56 comments on HN
  10. 10
  11. 11
    A day in the life of a professional software engineer
    1 people · 122 points · first shared 2021 · 12 comments on HN
  12. 12
    Evaluating LLMs for my personal use case
    1 people · 120 points · first shared 2025 · 47 comments on HN
  13. 13
    Rust: What I learnt so far
    1 people · 6 points · first shared 2013 · discussion on HN
  14. 14
    Online upgrades in Go
    1 people · 2 points · first shared 2013 · discussion on HN
  15. 15
    What if everyone worked remotely?
    1 people · 2 points · first shared 2013 · 2 comments on HN

What HN people wrote when they linked it

yjftsjthsd-h · 2021-01-07
> At these companies, algorithms and the basics are fundamentally important. Because you tend to work on tiny parts of a massive whole, there is no tolerance for cowboy-coding and not following best-practices. IMO the interviews test that you can fall in line and follow the patterns that have been in place for decades. ... have they gotten a lot better since 2015? https://www.darkcoding.net/software/facebooks-code-quality-problem/
segphault · 2017-04-22
Facebook is the world's largest PHP shop. Does that mean that everyone should use PHP? As it turns out, moving fast and breaking things isn't all that conducive to quality engineering[1][2]. Facebook has a massive legacy code base maintained by an enormous team that is under pressure to iterate quickly while supporting what is arguably the world's largest user base. They are dealing with extremely specialized constraints that most of us will never encounter. Many of the trade-offs they consider acceptable aren't trade-offs that make sense elsewhere. And that's exactly what the blog post is getting at. A lot of these emerging technologies are situationally useful in a particular set of scenarios and environments, but developers with cargo cult mentality convince themselves that these things will solve all of their problems if they use them everywhere. When the disappointment sets in and they figure out that isn't the case, yesterday's darling stack becomes the subject of today's "considered harmful" essays and everybody moves on to the next shiny thing. The point here is that maybe you should make a sober assessment of new technologies and objectively evaluate whether they are actually practical for your usage scenario rather than just blindly jumping on the bandwagon and using something. The examples from the blog post are totally on point. I previously worked at a company that built a NoSQL database and I have great affinity for the technology, but there's no question…
qweqwe14 · 2024-04-09
To achieve the smallest size, you have to ditch main entirely and use _start, along with passing certain linker flags not to align sections. See https://darkcoding.net/software/a-very-small-rust-binary-indeed/ You can easily get around 500 bytes this way
bluejekyll · 2024-02-18
This is a good guide on building small Rust binaries: https://github.com/johnthagen/min-sized-rust This talks about going to extreme lengths on making the smallest Rust binary possible, 400 bytes when it was written, https://darkcoding.net/software/a-very-small-rust-binary-indeed/ The thing is, you lose a lot of nice features when you do this, like panic unwinding, debug symbols, stdlib… for kernel and some embedded development it’s definitely important, but for most use cases, does it matter?
askonomm · 2023-11-09
You might enjoy this blog post: https://darkcoding.net/software/a-very-small-rust-binary-indeed/ It illustrates the steps to take Rust from 3.6MiB executable to 400 bytes, by stripping more and more things away, and changing things.
IshKebab · 2023-10-25
Rust binaries can be just as small as C ones: https://darkcoding.net/software/a-very-small-rust-binary-indeed/ Computers do much more than they could in the 80s.
tonyedgecombe · 2023-04-19
The iOS app had more than 18,000 classes (in 2015, god knows how many it is now). https://darkcoding.net/software/facebooks-code-quality-problem/
JelteF · 2021-05-17
> If your slice has a million entries, it's definitely a different story. Searching through a map is much faster than you think. At 20 entries searching through a slice of strings is already slower than searching in a map. For ints this threshold is 100 entries. Feel free to test on your own machine, my benchmark code is here: https://gist.github.com/JelteF/1251f180966eb974d7732ea6c3d3b7ff You can run it with: go test -bench='.' -benchtime=1s slicemap_test.go The benchmark code is based on the one from this blogpost: https://www.darkcoding.net/software/go-slice-search-vs-map-lookup/ After looking at that code though I didn't trust the results too much anymore, because of various issues with it. So I decided to fix those issues.
Apocryphon · 2020-05-07
This isn't exactly the first time Facebook has been called out for poor engineering practices: https://www.darkcoding.net/software/facebooks-code-quality-problem/ https://blog.timac.org/2017/0410-analysis-of-the-facebook-app-for-ios-…
skybrian · 2018-04-05
Go is sort of the opposite of this. If you do something like: func sum(a, b float64) interface{} { return a+b } It will allocate memory for the float, because an interface type always contains two pointers. [1] It's pretty crazy that the second word in a Go interface has to be a pointer. But I suppose if dynamic types were used more, they would be optimized more. [1] https://www.darkcoding.net/software/go-the-price-of-interface/
patcheudor · 2017-06-09
I got a Rachel from Cardholder Services call once during an in-office meeting so I put the call on speaker for everyone to enjoy, then immediately went to Graham King: https://www.darkcoding.net/credit-card-numbers/ to get some credit-card numbers that would pass their basic Mod 10 check and go to their CC merchant service, thus costing them money. By the sixth failed card and 20 minutes later the 'agent' figured out I was messing with him and threatened to rape my wife and kill me while screaming obscenities. It went very NSFW in a matter of seconds.
mixedCase · 2016-10-05
Facebook is known for having fairly bad code standards in their mobile apps. It's mostly a product of overengineering and feature creep. This is a good blog post about it: http://www.darkcoding.net/software/facebooks-code-quality-problem/ And Facebook's own blog post about their Dalvik hacks and how clever they are, which speaks volumes of their development culture: https://www.facebook.com/notes/facebook-engineering/under-the-hood-dal…
mshenfield · 2016-09-28
Facebook noticed the same thing. http://www.darkcoding.net/software/facebooks-code-quality-problem - "Exhibit C: Our site works when the engineers go on holiday"
akerro · 2016-05-28
Yea, essentially this, they have bigger problems: http://www.darkcoding.net/software/facebooks-code-quality-problem/
graham_king_3 · 2012-07-20
Very nicely presented. My credit card page and code have been top search result for years - it's about time someone improved upon it! Thanks. http://www.darkcoding.net/credit-card-numbers/ http://www.darkcoding.net/credit-card-generator/ If the code on darkcoding helped you build your project (we have the exact same card issuers), could you give attribution? It would also be very cool if you open-sourced that site. The code on darkcoding is GPL, not AGPL, so you're not required to. Would still be cool of you :-)
mpweiher · 2025-03-12
Yes, I think the promises of the "we can JIT all the overhead away"-camp were always overblown, and never materialized in practice. This is another very strong datapoint for that hypothesis[1]. However, it is important not to conflate "scripting language" and "dynamic language" and "interpreted". While there is some correlation there, it is not a necessary one. Objective-C is an example of a fast AOT-compiled pretty dynamic language, and WebScript was an interpreted scripting language with pretty much identical syntax and semantics.[2] What do I mean with fast? In my experience, Objective-C can be extremely fast [3], though it can also be used very much like a scripting language and can also be used in ways that are as slow or even slower than popular scripting languages. That range is very interesting. So I don't actually think the tradeoff you describe between low-level unergonomic fast and high-level ergonomic slow is a necessary one, and one of the goals of Objective-S is to prove that point.[4] So far, it's looking very good. Basically, the richer ways of connecting components appear to allow fairly simple "scripted" connections to achieve reasonably high performance [5]. However, I now have a very simple AOT compiler (no optimizations whatsoever!) and that gives another factor 2.6 [6]. Steve Sinowsky wrote: "Does developer convenience really trump correctness, scalability, performance, separation of concerns, extensibility, and accidental…
9ec4c12949a4f3 · 2010-07-30
I've seen medical stuff and there's a good reason I won't work in that industry... What REALLY bothers me is things like credit cards. http://www.merriampark.com/anatomycc.htm There's encoded data on something that's supposed to be a UUID thing: Industry, Issuer (card company), Lender (banking institution), Account number, and Checksum This is a good way to prevent fraud? Or have they just given me the keys to generate "valid" credit cards? http://www.darkcoding.net/credit-card-numbers/ Slap a name from the phonebook on there and see what you can purchase. Now we have PCI compliance trying to tell people to somehow lock this crap down? So they invent the CV2 codes, a 1 in 1000 hit-or-miss, I don't think my odds are too bad when I can generate any creditcard. Dates will also only fall into a specific range of time anyway. Yeah, we keep putting up bandages to creditcard security processing, but why do we need to? Honestly, the world of standards sucks.

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