3 ms·
Perhaps not the "best" source code I've ever read, but libVF.io had some beautiful code for what's generally gnarly system-glue code. The libVF.io iommu setup
by elcritch 4y ago
Perhaps not the "best" source code I've ever read, but libVF.io had some beautiful code for what's generally gnarly system-glue code.
The libVF.io iommu setup code is a good example and inspires me to think that system-glue code doesn't need to be gross or impenetrable:
https://github.com/Arc-Compute/LibVF.IO/blob/master/src/libvfio/control/iommu.nim https://github.com/Arc-Compute/LibVF.IO/blob/master/src/libv...
Another one I've appreciated reading (and learned more about 2d graphics from) is Pixie, a 2d graphics library written in Nim. It's strongly affected how I write similar code.
Here's the implementation of a fair subset of SVG paths:
https://github.com/treeform/pixie/blob/master/src/pixie/paths.nim https://github.com/treeform/pixie/blob/master/src/pixie/path...
And one last one for basic algorithms which I'd use to teach intro to data structures any day:
https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/algorithm.nim https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/al...
Of course Knuth's original code is still some of the best classic code. K&R's original C book is a classic.
(edited formatting and tweak descriptions)