Live data from Hacker News

Reading OpenBSD source code daily

blog.tintagel.pl

11–20 of 86 posts

Re: Reading OpenBSD source code daily

#11
I love this idea in part because it's the very opposite of the way I tend to work, which is to drive very hard to get a surface understanding of a thing in order to make a very targeted change. I learn lots along the way with this approach, but don't often get the deep, wholistic understanding of existing systems that only comes with repeated exposure over a long time.

Some kinds of understanding involve a no shortcuts grind. That sort of a grind is a big commitment though.

Re: Reading OpenBSD source code daily

#12
post #7
post #6

Great idea. What other code bases are there that lend themselves to this? Some kind of curated genius.com for source code would be interesting.

For operating systems I would recommend xv6: > https://pdos.csail.mit.edu/6.828/2016/xv6.html

With the caveat that xv6 is more artificial, it's a codebase for teaching not a living one.

Re: Reading OpenBSD source code daily

#13
post #3

I wonder where best to start for people who haven't taken an OS class before?

For a good base, I recommend the book "The Design and Implementation of the FreeBSD Operating System" by Marshall Kirk McKusick. It's really in depth and I was able to follow it without previously taking an OS course.

Re: Reading OpenBSD source code daily

#14
post #6

Great idea. What other code bases are there that lend themselves to this? Some kind of curated genius.com for source code would be interesting.

John Resig used Genius to annotate the jQuery source code. Seems to be broken now.

https://genius.it/johnresig.com/files/jquery-original.html

Re: Reading OpenBSD source code daily

#15
post #7

Earlier quoted context omitted.

For operating systems I would recommend xv6: > https://pdos.csail.mit.edu/6.828/2016/xv6.html

With the caveat that xv6 is more artificial, it's a codebase for teaching not a living one.

In the past every two years a new version was released - so I would not call it "not living". By personal correspondence with one of the xv6 authors concerning a somewhat larger patch for xv6 (which he liked), he told me that they consider to release a new version in fall 2017, which would be one year after the previous release.

Re: Reading OpenBSD source code daily

#16
post #9

Earlier quoted context omitted.

The best start would be to read a book about operating systems such as Tanenbaums. Reading the source of an OS has a really really low signal to noise ratio in getting important knowledge about operating systems due to implementation details an OS-specific peculiarities.

What about MINIX? Being a teaching operating system, do you think it may contain less nose and thus be more useful as reading material? (I mean, without the book)

Linus Torvalds started out studying MINIX. He was a Finnish programmer into working on kernels. He ended up completing one.

Re: Reading OpenBSD source code daily

#17
post #15

Earlier quoted context omitted.

With the caveat that xv6 is more artificial, it's a codebase for teaching not a living one.

In the past every two years a new version was released - so I would not call it "not living". By personal correspondence with one of the xv6 authors concerning a somewhat larger patch for xv6 (which he liked), he told me that they consider to release a new version in fall 2017, which would be one year after the previous release.

masklinn's claim still rings true. There's a difference between codebases designed mostly for being easy to understand and codebases designed to be optimal in performance, consistency with an existing style (esp if old), and portability. Getting used to reading one might not transfer well to the other kind since the patterns are different. Probably best to use one of its intended goal (learning how OS's work) and look at examples of the other kind when trying to absorb patterns seen in real-world codebases.

Re: Reading OpenBSD source code daily

#18
I read the emacs lisp source code in site-lisp/ every day. The goal is to understand one file about a week or so. It has made my emacs and lisp knowledge better, and made me aware of several nice emacs features (align-regexp, for example).

Re: Reading OpenBSD source code daily

#19

I love this idea in part because it's the very opposite of the way I tend to work, which is to drive very hard to get a surface understanding of a thing in order to make a very targeted change. I learn lots along the way with this approach, but don't often get the deep, wholistic understanding of existing systems that only comes with repeated exposure over a long time. Some kinds of understanding involve a no shortcu…

What you're hinting at is Minimalist Learning Theory.

You have a production bias to learn only what you need to immediately get your job done, rather than investing time to learn up front which could potentially be more efficient in the long run.

Post reply on HN