Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K

    Diomidis Spinellis

    spinellis.gr · Personal blog · on HN since 2008

    Diomidis Spinellis, a software engineering professor and author of Code Reading, writes on Unix history, C, and tooling.

    Visit blogRSSHN submissions
    HistoryLanguages & CompilersOpen Source & Linux
    What HN says

    HN links it for the C preprocessing algorithm write-up, which a compiler writer says is needed, and for Unix history charts.

    Stats for nerds
    100HN people shared it
    126linked in comments
    3.1Kstory points
    Apr 2026last shared
    2008people per year2026

    Top posts on HN

    1. 1
      What I Learned From Fixing my Laptop's Motherboard
      1 person · 342 points · first shared 2011 · 81 comments on HN
    2. 2
      How I slashed a SQL query's runtime with two Unix commands
      2 people · 253 points · first shared 2018 · 83 comments on HN
    3. 3
      Reviving the 1973 Unix Programmer's Manual
      1 person · 209 points · first shared 2017 · 51 comments on HN
    4. 4
      Raspberry Pi Zero vs. Elliott 405
      3 people · 204 points · first shared 2015 · 98 comments on HN
    5. 5
      The evolution of Unix architecture in two diagrams
      1 person · 194 points · first shared 2017 · 6 comments on HN
    6. 6
      Benefits of choosing email over messaging
      1 person · 183 points · first shared 2025 · 157 comments on HN
    7. 7
      How to Create Your Own Git Server
      1 person · 163 points · first shared 2014 · 35 comments on HN
    8. 8
      Was Knuth Really Framed?
      1 person · 130 points · first shared 2020 · 126 comments on HN
    9. 9
      Dave Prosser's C Preprocessing Algorithm (2006)
      4 people · 124 points · first shared 2017 · 6 comments on HN
    10. 10
      The Birth of Standard Error
      5 people · 116 points · first shared 2013 · 20 comments on HN

    What HN people wrote when they linked it

    • SwellJoeAug 2008

      Yes, though I don't think you can say anything really objective about the "quality" based on the data available. I found some of the statistics in the case of Windows source indicative of lower readability and maintainability...defined global funcs and structs counts are higher than the Open Source systems (FreeBSD and Linux) and file length is significantly longer, even though Linux is a significantly larger codebase (the largest of all of the systems analyzed). But, of course, that's just numbers...roughly meaningless without context. And, obviously, Microsoft manages to keep shipping code that mostly works, and they hire some of the best developers in the world.

      Here's the paper:

      http://www.spinellis.gr/pubs/conf/2008-ICSE-4kernel/html/Spi08b.pdf

      And some additional commentary:

      http://www.spinellis.gr/sw/4kernel/

      Anyway, while I've never seen the Windows source code, I have looked at FreeBSD, Linux and Solaris, and all are pretty good. I think FreeBSD may be the cleanest (partly because it tries to be fewer things to fewer people than Linux), but probably not technically the most interesting. And, of course, I've only taken a few quick trips through FreeBSD and Solaris, and I've actually written driver code for Linux. Doing real work in a codebase always makes the warts more apparent.

    • ispolinDec 2012

      Using my complete lack of statistical knowledge, I multiplied the wrong output rate % by the total lines of code in the examples from original paper here http://www.spinellis.gr/pubs/conf/2012-PLATEAU-Fuzzer/pub/html/fuzzer.html to get a very bad approximation of fat fingering adjusted for program length. You'd expect more typos in a longer program; the original experiment always introduced 1 typo per run regardless of program length.

      You guys enjoy while I prepare for the lynch mob of Statisticians :-)

      Lang Err % LOC LOC adjusted Err %
      Ruby 0.17 159 27.03
      Python 0.15 161 24.15
      Perl 0.22 156 34.32
      PHP 0.36 224 80.64
      JS 0.18 102 18.36
      Java 0.1 331 33.1
      Haskell 0.15 114 17.1
      C# 0.095 389 36.955
      C++ 0.08 461 36.88
      C 0.1 458 45.8

    • h0l0cubeJan 2021

      There's nothing particularly wrong about it. Twitter does something like this with a bit of timing thrown in the mix, which is why some smart-asses have made self-referencing tweets:

      https://www.spinellis.gr/blog/20090805/

      I believe they also for a long time had a public API^.. and I'm pretty sure they soft-delete posts (bonus that they could revive the tweet down the track if it was a 'mistake'). I don't think the Twitter team are amateurs though.

      Having monotonically increasing IDs for non-distributed systems removes the possibility of duplicate IDs. In distributed systems ID conflicts are unavoidable, and you might have less conflicts if you generate random IDs, as well as it becomes difficult for an attacker to guess IDs.

      ^ likely it would have been rate-limited, which isn't a problem if you've got a large pool of users you can authenticate with

    • chubotJan 2021

      Yes being able to store the FDs for pipes in variables is something that would make it more explicit and flexible. (It could also introduce deadlocks though)

      Also, dgsh is along these lines: https://www.spinellis.gr/sw/dgsh/#compress-compare

      It appears to use Unix domain sockets, not pipes.

      I think I might want to use the Ruby-like blocks for syntax, something like

      grep FOO *.py | wc -l | sort -n

      pipeline {
      pipe :p1 # variables that are pipes
      pipe :p2

      # this syntax isn't great but shows the idea
      grep FOO *.py > &p1
      < &p1 wc -l > &p2
      < &p2 sort -n
      }

      -----

      Although I think richer pipelines make sense, structured data will probably come first:

      https://github.com/oilshell/oil/wiki/Structured-Data-in-Oil

    • nerpderp82Apr 2024

      I'd love to see textual preprocessors kinda banned. Or at least done upstream and outside of the language. You can't both be <the language> and also have a textual preprocessor defined internally. It doesn't work.

      I really like what Zig and C++ are doing with `const`.

      https://ikrima.dev/dev-notes/zig/zig-metaprogramming/

      Have you looked at Spinal?

      https://github.com/SpinalHDL/SpinalHDL

      https://spinalhdl.github.io/SpinalDoc-RTD/master/index.html

      edit, I see in your post history that your first submission was on Prosser's macro expansion. https://www.spinellis.gr/blog/20060626/cpp.algo.pdf :)

    • wallflowerFeb 2010

      Great example. About a clever technique. And implementing it in the author's own code.

      Check out Dr. Spinellis' Code Reading:

      "Code reading requires its own set of skills, and the ability to determine which technique to use when is crucial. In this indispensable book, Diomidis Spinellis uses more than 600 real-world examples to show you how to identify good (and bad) code: how to read it, what to look for, and how to use this knowledge to improve your own code.

      Fact: If you make a habit of reading good code, you will write better code yourself."

      http://www.spinellis.gr/codereading/

    Related

    Keegan McAllistermainisusuallyafunction.blogspot.com52 people

    151-byte static Linux binary in Rust

    Keegan McAllister
    Personal · last shared 2023
    Linus Åkessonlinusakesson.net290 people

    The TTY demystified (2008)

    Linus Åkesson
    Personal · last shared 2026
    Ksplice Blogblog.ksplice.com30 people

    I want to compile a C program so simple I can explain all of the assembly

    Ksplice Blog
    Company · last shared 2011
    Tomas Petricektomasp.net152 people

    Write your own Excel in F# (2018)

    Tomas Petricek
    Personal · last shared 2026
    David R. MacIverdrmaciver.com94 people

    How to do hard things

    David R. MacIver
    Personal · last shared 2026
    John Regehrblog.regehr.org401 people

    Teaching C

    John Regehr
    Personal · last shared 2026
    David Givencowlark.com94 people

    Live coding a vi for CP/M from scratch

    David Given
    Personal · last shared 2026
    Rich Felkerewontfix.com36 people

    Broken by design: systemd

    Rich Felker
    Personal · last shared 2025