Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

[LEARNING] Well-written open source codebases

Name: Anonymous 2013-02-14 17:59

ITT we post examples of well-written open source codebases to learn or draw inspiration from. Please restrict your suggestions to codebases that you have actually spent some time reading.

I'm fond of reading bits of the earlier, C-based idTech engines, and they're often held up by others in the blogosphere as an example of good C, so they'll be what I'm recommending.

https://github.com/id-Software

This guy has written some pretty detailed code reviews of the engines that serve as excellent high-level introductions before you start peeking in the source, if you'd like to study the techniques used by the engines themselves and not just the structure of their code.

http://fabiensanglard.net/

I'm interested in seeing some recommendations for dynamic languages like Lua. My idea of how to properly structure a program is limited to idiomatic C at the moment, which makes writing Lua programs feel somewhat awkward to me.

Name: Anonymous 2013-02-17 14:05

The official Lua implementation is a really high quality ANSI C codebase. The average /prog/rider should be more than capable of digging into it:

~/lua-5.1.5/src$ cloc ./
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C                               32           2014            742          11081
C/C++ Header                    23            827            793           1506
make                             1             36             12            134
-------------------------------------------------------------------------------
SUM:                            56           2877           1547          12721
-------------------------------------------------------------------------------


LuaJIT is also a fascinating implementation (and probably the program to study if you want to write a fast interpreter/JIT), but all of the platform-specific assembly and whatnot makes it a lot more difficult to comprehend.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List