Live data from Hacker News

Ask HN: What's the best source code you've read?

news.ycombinator.com

131–140 of 271 posts

Re: Ask HN: What's the best source code you've read?

#131

Maybe not revolutionary, but I think this article about static binary translation is a great introduction to the topic: http://www.gtoal.com/sbt/ (see also the "Virtual Machines" book by Smith and Nair, ISBN-13 978-1558609105, if you are interested in this topic). I can also recommend John Lions' "Commentary on the Sixth Edition Unix Operating System" - https://warsus.github.io/lions-/ , Douglas Comer's Xinu ( https:…

On the same note, the original Atmel8/16 chip datasheet. It made me fall in love with electronics

Re: Ask HN: What's the best source code you've read?

#134

It’s not the best, far from it, but it was fascinating to me so I will share. I used to work for a large newspaper. Engineering wasn’t the focus of the business, it was only a means to an end, it was just something they needed to have a competitive website. As a result, the churn rate was very high. But more interesting there was also a very high return rate. Engineers would come and go and return and leave again all…

i relate to this currently and that is a great way to think about it. thank you for posting this.

Re: Ask HN: What's the best source code you've read?

#135
Apple's Swift source looks nice[0]. So does Darwin[1].

They have done a lot of work on structure and documentation, since the docs are auto-generated.

I have taken a lot of inspiration from them.

The Adobe APIs[2] were also excellent, but I'm not sure they are open for browsing, anymore.

[0] https://github.com/apple/swift

[1] https://github.com/apple/darwin-xnu

[2] https://developer.adobe.com/photoshop/api/

Re: Ask HN: What's the best source code you've read?

#137
post #116

Surpised 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

Yeah, was going to post Nethack if no one else had. It’s so well written, I think even people who’ve never seen C before could understand what was going on.

Re: Ask HN: What's the best source code you've read?

#138
The Racket implementation for protocol buffers. The generated code is just an S-Expified version of protobuf source files, all macros which generate actual protobuf implementation at runtime lol. I don't know why I was surprised.

https://docs.racket-lang.org/generator/index.html

Can't find source code online. I browsed the code in emacs with racket-xp-mode go to definition after installing it via raco pkg install. Could probably use DrRacket instead of emacs/racket-xp-mode.

I had to read the source code to find out what the specific names of the proto creators, accessor, mutator functions would be.

Re: Ask HN: What's the best source code you've read?

#140
post #8

Peter Norvig's spell checker: https://norvig.com/spell-correct.html

PAIP is easily one of my favourite programming books. It’s chapter after chapter of excellently presented programming. Each chapter takes you through a problem, a solution (typically multiple iterations and extensions) with detailed explanations of what’s happening (often with historical details). Also, it introduced me to many different tools I can use to solve programming problems.
Post reply on HN