Earlier quoted context omitted.
Minix, not being as 'real world' as the BSD's or Linux, is even more readable, if you're just interested in a quick glance at how an OS works.
From Minix' site: MINIX 1 and 2 were intended as teaching tools; MINIX 3 adds the new goal of being usable as a serious system on resource-limited and embedded computers and for applications requiring high reliability. Is Minix 3 still readable, or do you recommend Minix 2?
Ask HN: What source code is worth studying?
71–80 of 117 posts
Re: Ask HN: What source code is worth studying?
#72One way to find code worth reading is to select inspiring developers and look at their code. Most of the developers in "Coders At Work" for example, have Open Source code we can look at learn from. The best code I've seen: - Common Lisp - "Paradigms of Artificial Intelligence Programming" by Peter Norvig and "On Lisp" by Paul Graham C - "C Interfaces and Implementations" and "LCC- a compiler for ANSI C" both by David…
Re: Ask HN: What source code is worth studying?
#73If you're an iPhone developer, Joe Hewitt's three20 is the best open-source codebase I know of: http://github.com/joehewitt/three20
Joe tends to do things his own way, which works out fine, but does tend to depart from most people's Cocoa/Touch code.
Re: Ask HN: What source code is worth studying?
#74Qmail: http://cr.yp.to/qmail.html It feels well organized almost throughout, and it's a joy to experience the clarity of thought that went into it. In fact, most of djb's code has a similar feeling to it. Arthur Whitney's code: http://www.nsl.com/papers/origins.htm Being able to read this (and not merely decode it, but read it, in a manner similar to how you would read a book) will broaden your horizons like nothing…
Re: Ask HN: What source code is worth studying?
#75Re: Ask HN: What source code is worth studying?
#76One way to find code worth reading is to select inspiring developers and look at their code. Most of the developers in "Coders At Work" for example, have Open Source code we can look at learn from. The best code I've seen: - Common Lisp - "Paradigms of Artificial Intelligence Programming" by Peter Norvig and "On Lisp" by Paul Graham C - "C Interfaces and Implementations" and "LCC- a compiler for ANSI C" both by David…
For haskell I would recommend Xmonad. The code is short, lots of interesting functionality including a well written plug-in system. http://xmonad.org/
Re: Ask HN: What source code is worth studying?
#77I'm going to get downvoted for picking a non-open source option but... The NT kernel is the most beautiful piece of code I've seen. Dave Cutler and team wrote some very, very elegant code that anyone (even if you're not a kernel hacker) can understand. If I need 'code inspiration', I spend some time looking through their code. Now, the NT kernel itself doesn't have source out there but for folks who are students, you…
Re: Ask HN: What source code is worth studying?
#78Re: Ask HN: What source code is worth studying?
#79I'm going to get downvoted for picking a non-open source option but... The NT kernel is the most beautiful piece of code I've seen. Dave Cutler and team wrote some very, very elegant code that anyone (even if you're not a kernel hacker) can understand. If I need 'code inspiration', I spend some time looking through their code. Now, the NT kernel itself doesn't have source out there but for folks who are students, you…
The overall impression was that it was hacked together in the worst sense of the word. Like there were several teams developing it that did not communicate with each other. Pieces of the kernel are forced together rather than fit snugly by design. I cannot stress enough how mind-boggingly repulsive it was to work with it. And that's not even touching NDIS, the networking module, which can be used for scaring some serious shit out of young programmers.
If you put BSD or Linux code side by side with NT, look me in the eye and tell me that NT kernel is "the most beautiful piece of code you've seen", you will need to see a head doctor.
Re: Ask HN: What source code is worth studying?
#80Earlier quoted context omitted.
for an easier time, your favorite language interpreter's source code ... interpreters are easier to comprehend than compilers, since you can 'follow along' with the flow of execution in the main interpreter loop just like you're executing a program ... e.g., creating stack frames, allocating heap memory, assigning variables, etc.
This really depends on the language. Ruby's code is (or at least was) quite nice. It is pretty much OO written in plain C. By contrast Perl makes very heavy use of macros for portability, to an extent that may induce brain lock in many people, and makes your debugger very hard to follow. This is not to say that its use of macros is a bad thing in the end, but it is a definite shock.
Check out the regex compilation module: http://cpansearch.perl.org/src/GBARR/perl5.005_03/regcomp.c
And execution: http://cpansearch.perl.org/src/GBARR/perl5.005_03/regexec.c