Nobody has mentioned Knuth’s corpus of work in Pascal-Web for the TeX ecosystem. This is code written for an era where there wasn’t an ecosystem of libraries for common tasks and even things like being able to access a file in random access order couldn’t be counted on. Even 7-bit ASCII couldn’t be counted on as a given (EBCDIC-based IBM mainframes were a significant element of the computing landscape still). Against…
Ask HN: What's the best source code you've read?
241–250 of 271 posts
Re: Ask HN: What's the best source code you've read?
#242Earlier quoted context omitted.
I have shared this with Tanj. I had the privilege to work with him in Microsoft!
Awesome!! Would it be possible to release this bit of the library, if not the whole thing (for any definition you like of "whole thing") à la Movie Maker ( https://twitter.com/foone/status/1511808848729804803 )? More specifically there are two components to this question - it being OK for the code to be released, and the code itself being available to be released :). I'm specifically asking after the former; if noone…
Re: Ask HN: What's the best source code you've read?
#243Surpised no one has mentioned the Nethack source, small codebase going on close to 40 years. https://github.com/NetHack/NetHack/tree/NetHack-3.7/src
Re: Ask HN: What's the best source code you've read?
#244Re: Ask HN: What's the best source code you've read?
#245Earlier quoted context omitted.
Using Unicode symbols wisely in mathematical code is a godsend. I regularly use Julia, which favors this style, and find that this feature improves the readability of code enormously.
How do you then type these characters? google, copy, paste? Or is there a better workflow?
Re: Ask HN: What's the best source code you've read?
#246The 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/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/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/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)
Re: Ask HN: What's the best source code you've read?
#247Nobody has mentioned Knuth’s corpus of work in Pascal-Web for the TeX ecosystem. This is code written for an era where there wasn’t an ecosystem of libraries for common tasks and even things like being able to access a file in random access order couldn’t be counted on. Even 7-bit ASCII couldn’t be counted on as a given (EBCDIC-based IBM mainframes were a significant element of the computing landscape still). Against…
With the sorry state of latex engine error messages and the version number still approximating pi, e, something, it is no longer an ideal to me. It represents stagnation. Being bug-free may be good, but at some point feature development is needed. (I know TeX and LaTeX are not the same)
Probably the biggest mistake was the choice to abandon the idea of having a LaTeX 3 version with its implicit breaking of backwards compatibility. Backwards compatibility means that there’s a tangle of fragility that only grows with time which is part of why the error messages are so frequently bad. Changes are a fraught proposition. This is part of what inspired my decision to start work on finl.
Re: Ask HN: What's the best source code you've read?
#248Re: Ask HN: What's the best source code you've read?
#249Re: Ask HN: What's the best source code you've read?
#250Redis. After struggling with extending QBE I thought that was how C was written in general, but Redis restored my optimism.