Hacker News new | past | comments | ask | show | jobs | submit login
Linux Poetry Explains the Kernel, Line By Line (linux.com)
104 points by lclark on June 19, 2014 | hide | past | favorite | 28 comments



My favorite tech poem is Radia Perlman's "Algorhyme". She's the inventor of the spanning tree protocol.

		Algorhyme

        I think that I shall never see
        a graph more lovely than a tree.
        A tree whose crucial property
        is loop-free connectivity.
        A tree that must be sure to span
        so packet can reach every LAN.
        First, the root must be selected.
        By ID, it is elected.
        Least-cost paths from root are traced.
        In the tree, these paths are placed.
        A mesh is made by folks like me,
        then bridges find a spanning tree.

                         Radia Perlman

http://en.wikipedia.org/wiki/Radia_Perlman


Love it. Here's the blog: http://www.linux-poetry.com/

I'd actually say I found that knowing I could understand this in condensed poetic form makes it a nice affirmation that I do actually understand some of this stuff, but I also learned a lot.

I hope this continues!


Thanks! No plans of stopping in sight. :)


> “I have all this experience but I suffer from a thing that almost every person who doesn’t have an actual background in CS does: I have islands of knowledge with big gaps in between,” she said. “Every time I'd come across some concept, some data structure in the kernel, I'd have to go educate myself on it.”

I get the impression that Morgan Phillips avoids saying she has a background in CS due to not holding a degree in it. I think she has every right to state that she does have a background (being classified as a hacker goes without saying).

Now, I am going to compile her poetry.


Ha! Wouldn't it be lovely if having a "background" in CS actually made you as knowledgeable as Phillips thinks it does?

I've got a CS degree and 10 years of industry experience, and I'm still at clueless as she is and probably more.


> I've got a CS degree and 10 years of industry experience, and I'm still at clueless as she is and probably more.*

Realising that you are clueless keeps you on your toes.

Henri Poincare [0] is sometimes called "the last polymath" in mathematical circles, specialisation in subjects increases geometrically with time. Modern CS I would say dates back to the 1930's with guys like Neumann, Turing and Church. A mere 80 years and the subject has just ballooned.

[0] http://en.wikipedia.org/wiki/Henri_Poincar%C3%A9


She was a physics major.

There seems to be a strong correlation between physicists and good computer scientists:- Knuth, Dijkstra for example.


IIRC RMS has a good background in physics.

Seymore Cray worked with radios during WWII and had a very strong background in electrical engineering. He had to rely on Maxwell's equations to analyse signal paths [0]. The bottom anecdote [1] I found highly amusing, very "egg and chicken".

[0] http://en.wikipedia.org/wiki/Seymour_Cray#Technical_approach...

[1] http://research.microsoft.com/en-us/um/people/gbell/craytalk...


This is a realistic and humble view - thank you.


> I get the impression that Morgan Phillips avoids saying she has a background in CS due to not holding a degree in it. I think she has every right to state that she does have a background

That seems a bit semantic to me. She's basically saying "I never studied or worked extensively with X, so I have knowledge gaps about Y [which is tightly related to X, and often comes by studying X]".

As another researcher who is also sans-degree, I can see where she's coming from. To someone outside the field I would never split hairs about whether or not I have a formal CS background, whereas I might when speaking with a colleague or a professional peer.


> That seems a bit semantic to me. She's basically saying "I never studied or worked extensively with X, so I have knowledge gaps about Y [which is tightly related to X, and often comes by studying X]".

You can apply that to professionals in certain scenarios. Referring to my original quote: “Every time I'd come across some concept, some data structure in the kernel, I'd have to go educate myself on it.” The only difference between someone who has a formal CS background and someone who doesn't, is that the former is given a lot of guidance by one of the most sophisticated data processors on Earth - the human brain, the latter has to bootstrap their knowledge.

You didn't mention your area of research, I would be interested in knowing.


Really? Go take a look at the two code snippets in "The Reentrant Kernel." I can't tell what the salient difference is supposed to be between them, much less how they are meant to illustrate the concept of reentrancy.

I mean, I appreciate the concept of what she's doing here, but that self-assessment sounds reasonable to me.


I appreciate any feedback, of course, I'm trying to learn here! About the snippets you mentioned, my reasoning was:

There's a variable outside of the functions scope. If the value of the global variable were changed before it's referenced in the function the outcome would change.

  int global_int;
  int is_not_reentrant(int x) { 
    int x = x; // An arbitrary operation
    return global_int + x; // the result depends on global_int
  }
In the second, the value of the global_int is copied into a variable within the function; so the result is no longer dependent on anything outside of the function's scope. My thinking was, that this demonstrated reentrancy.

  int global_int;
  int is_reentrant(int x) { 
    int saved = global_int; 
    return saved + x;
  }
From the looks of it I did make a mistake, since it seems to be missing one of these criteria. I'll modify the snippets to fix it. Thanks! :)

  +Must hold no static (or global) non-constant data.
  +Must not return the address to static (or global) non-    constant data.
  -Must work only on the data provided to it by the caller.
  +Must not rely on locks to singleton resources.
  +Must not modify its own code (unless executing in its own unique thread storage)
  +Must not call non-reentrant computer programs or routines.


Yeah, I would argue that both of those functions are re-entrant. The question is whether you can have two calls to is_not_reentrant executing concurrently without interfering with each other. So a typical example would have a non-reentrant function altering a variable like global_int as part of its computation.

Also, it's important to think about the kinds of program transformations that the C compiler is free to do with your code when going from C to assembly. I think it's likely that your compiler would produce the same output for both functions. Lines of C code do not execute atomically, and instructions can be re-ordered.

EDIT: Returning to this because I think I made a mistake. "Two calls executing concurrently" is not exactly right, because it admits the possibility of arbitrary instruction interleaving. A reentrant function must be able to be paused at any point, have another call to the function execute entirely, and then resume correctly. This is a weaker condition.


> I mean, I appreciate the concept of what she's doing here, but that self-assessment sounds reasonable to me.

I would use "realistic", as opposed to "reasonable", look hard enough and you will see that everyone has gaps in their knowledge.


That's a vacuous statement. She said "big" gaps. And I'm saying that she's making errors that no one with a background in CS (e.g. a degree) ought to make.

I have no idea what your agenda is in lavishing all this unnecessary praise on Morgan Phillips, but it's gross. Please stop.


> That's a vacuous statement. She said "big" gaps. And I'm saying that she's making errors that no one with a background in CS (e.g. a degree) ought to make. I have no idea what your agenda is in lavishing all this unnecessary praise on Morgan Phillips, but it's gross. Please stop.

Is your name Linus Torvalds by any chance?


I don't have any desire to be lavished in praise; but you're being unnecessarily rude I think. :[


Hey, I picked this username for a reason.


It's nice. I have more trouble groking the poem form so I would not use this, but certainly I understand those areas of tech where I wrote and researched say an article, far more than areas of flew over and just got working.

Each to their own learning I guess - but very nice


Reminds me of a discussion on HN a few years ago about painting some very famous algorithms on a canvas and expose them in exhibitions. There's a inherent form of beauty in some of them that may be visible even to the non-initiated.


This could be a great evidence for code as expression and needing protection by First Amendment argument.


Phillips' on github:

https://github.com/mrrrgn


>It's a “pedagogical hack”

Looking at a couple of them, I have no clue how it makes things any simpler. Removing line breaks and re-forming the text into correct sentences would make things easier to understand, imho.


It sounded from the article as though it had more to do with retention than simplification. Poetic expression optional, summarizing what you've read in your own words is a broadly-accepted method of internalizing the information.


It helps her to understand and remember it. You wouldn't use poetry for your own learning. I wouldn't either, but I don't expect others to only use what works for me. Some people would take notes, others might make visual diagrams, on paper or just in their head. Some people make narrative stories to help them learn and remember new concepts.


> I have no clue how it makes things any simpler

I'm sure it would make it simpler to her and probably keeps her motivated and encourages her to get a better understanding. It seems more of a way for her to personally understand the kernel, and she is just sharing the poems with everyone else for whoever wants to read.


Yes! That's definitely the way I think about it. These are just my way of taking notes, and I thought they'd be fun to share. I do it this way because writing a poem requires a bit of reflection, so, instead of just retaining nodes of information here and there I'm also capturing connections and concepts. The novelty of writing in prose also keeps things from seeming tedious. :)




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: