The Architecture of Open Source Applications
aosabook.org
aosabook.org
- SQLAlchemy by Michael Bayer: https://www.aosabook.org/en/sqlalchemy.html (nice observation of core language on top of SQL, then the separate declarative/orm system)
- LLVM by Chris Lattner: https://www.aosabook.org/en/llvm.html
- Audacity by James Crook: https://www.aosabook.org/en/audacity.html (interesting mentionings of wxwigets)
Note that pretty much everything in volume 1 and 2 is interesting, though!
What would be nice to see, non-exhaustive:
- Blender: Especially 2.80, an analysis of its GUI/widgets, integrated python scripting, and everything else (wiring into graphics cards, rendering, shapes). There's a lot of stuff that could be covered
- Gimp / Inkscape / Krita
- Saltstack / Ansible / Fabric or PyInvoke : These have nice abstractions on top of system functionality / programs and delivery magic that'd be fun to go into
- GTK, QT
- Tiling window managers, e.g. i3, swaywm, awesome
- Wayland, Xorg
- Kdevelop, VSCode, Atom, Electron
- React, Vue, Angular (it'd be nce to see more js)
- Android SDK
- Unity3D SDK, Unreal SDK
- .NET Core
- black (python formatter), clang-format, prettier
- docutils, sphinx, pandoc
- systemd, mesa, cairo, pulseaudio
- implementations of python (cpython), typescript, lua, luajit, haskell ghc, swift
As an extreme example, seeing ten spaghetti codebases does not teach you much more than the first. But expanding your mind by studying new patterns and paradigms, skillfully and elegantly woven, will build upon everything you’ve already mastered.
Seeing a clusterfuck of microservices blooming darkly in the midst of a project, watching time being wasted sorting it out every bloody time more code was checked in, sucking precious time from the rest of the projct - you can learn a lot immediately.
Lesson: don't use them without good reason.
Or seeing a function that takes a geographical area and returns a list of progressively larger areas that enclose it eg. give buenos aries, it returns argentina, south america, america, the world. But note that the function does not return its input (buenos aries) which caused every bloody call of that function to have extra code to add it back in because it was needed.
Lesson 1: the output of a function like this is always likely to need its input for our app, so provide the input with the output.
Lesson 2: If it's evident a function isn't quite adequate, provide a wrapper function that does what's needed so the users don't have to write workaround code every time.
> skillfully and elegantly woven
(giggle). Not on my planet!
(This coming from someone writing C++ since 2002)
Have you tried SWIG?
No, it's what you get when you need an object system that works across FFI boundaries.
If the GIMP authors would have used C++ in 1995 they would be stuck with a legacy codebase now that would be ridiculed because it's not "modern C++" - a term that has designated about 3 different programming styles during that time.
Even the Qt developers found that 1995 C++ was insufficient for a UI toolkit and augmented it with a custom "moc" pre-compiler and build tools.
Example for me... lwIP. One of the worst APIs I’ve ever used, but it works damn near perfectly once you hack through it.
Maybe that says something. It certainly doesn’t make the code or behavior any easier to understand, though.
I guess that’s why many company’s are going with the “code is meant to be read, not written” thing
It's not the fault of the authors of course, in my experience there's not many organisations interested in explaining stuff like this out in the open.
It would be great to see the architecture of: - a large scale distributed system - a typical web app with UI, web tier, data tier maybe thrown in some eventing for good measure. - maybe anything else that needs to talk across a network all the time.
Nick Craver from Stackoverflow does a great job of explaining this for how SO do it, any other good examples would be great.
https://stackshare.io/uber-technologies/uber
https://stackshare.io/stack-history-timeline-unicorns-ipos-o...
https://stackshare.io/circleci/how-circleci-processes-4-5-mi...
Although is a library for a small niche is interesting how Luigi Ballabio explains the process with some comments of why some decisions have been taken and some corrections/modifications that happened in the library.
https://www.implementingquantlib.com/posts/implementing-quan...