Educational, well-written FOSS projects to read, study or discuss

Posted by Godot on Programmers See other posts from Programmers or by Godot
Published on 2011-06-04T17:04:47Z Indexed on 2011/11/15 18:07 UTC
Read the original article Hit count: 355

Filed under:
|

Before you say it: yes, this "question" has been asked other times. However, I could not fine many of such questions and not that easily, and those I found had similar results. What I'm trying to say that there are no comprehensive lists of well written Open Source projects, so I decided to set some requirements for the entries (one or possibly more):

  • Idiomatic use of the language in which they are written
  • The project should be lightweight. Not as in "a few kbs", as in "clean" and possibly following the UNIX philosophy, making an efficient use of resources and performing its duty and nothing more. No code bloat, most importantly. Projects like Firefox and GNOME wouldn't qualify, for example.
  • Minimal reliance on external, non-standard libraries, with exceptions for some common FOSS libraries (curses, Xlib, OpenGL and possibly "usual suspects" like gtk+, webkit and Boost). Reliance on well-written libraries is welcome.
  • No reliance on proprietary software - for obvious reasons (programs that rely on XNA, DirectX, Cocoa and similar, for example).
  • Well-documented code is welcome.

Include link to web interfaces to their repositories if possible.

Here are some sample projects that often pop up in these threads:

Operating Systems

  • Plan 9 from Bell Labs: More or less, the official "sequel" to UNIX. Written in C by the same people who invented C!
  • NetBSD: The most portable BSD implementation, written in C and also a good example of portable and organized code.

Network and Databases

  • Sqlite: Extremely lightweight and extremely efficient, one of the best pieces of C software I've seen. Count the lines yourself!
  • Lighttpd: A small but pretty reliable web server written in C.

Programming languages and VMs

  • Lua: extremely lightweight multi-paradigm programming language. Written in C.
  • Tiny C Compiler: Really tiny C compiler. Not really comparable to GCC or Clang but does its job.
  • PyPy: A Python implementation written in Python.
  • Pharo: OK, I admit it, I'm not really a Smalltalk expert but Pharo is a fork of Squeak and looked rather interesting.
  • Stackless Python - An implementation of Python that doesn't rely on the C call stack - written in C (with some parts in Python)

Games and 3D:

  • Angband: One of the most accessible roguelike codebases around here, written in C.
  • Ogre3D: Cross-platform 3D engine. Gets bloated if you don't skip the platform-specific implementation code, otherwise is a pretty solid example of good C++ OO.
  • Simon Tatham's Portable Puzzle Collection: Title says it all.

Other - dwm: Lightweight window manager. Written in C.

Emulation and Reverse Engineering - Bochs: x86 emulator, written in C++ and tiny enough. - MAME: If you want to see C at one of its lowest levels, MAME is for you. May not be as clean as the other projects but it can teach you A LOT.

Before you ask: I didn't mention Linux because it has become quite bloated in the last few years, Linus has also confirmed it. Nonetheless, it'd be a great educational read the same, even if for other reasons. Same for GCC.

Feel free to edit or wikify my post. I hope you won't lock my question, I'm only trying to organize a little community effort for the good of all those people who want to enhance their coding skills.

© Programmers or respective owner

Related posts about portability

Related posts about study