News for hackers. Stuff that matters.
Re:Ask HN: How do I learn C properly? by Paperweight on Sunday March 08, 2020 @03:39PM (#22520057)
Perhaps better than a book, can anyone authoritatively point to a few small-and-readable but best-in-class open-source C projects to use as a reference?
Re:Ask HN: How do I learn C properly? by kick on Sunday March 08, 2020 @03:55PM (#22520160)
* tweetnacl.cr.yp.to

Crypto library in the size of a hundred tweets [ https://twitter.com/tweetnacl ] by the only person with a genuine claim to being able to write safe C & company.

* https://github.com/mit-pdos/xv6-public

&

* https://github.com/mit-pdos/xv6-riscv

UNIX v6 clone in ANSI C by influential Plan 9-era Bell Laboratories employee and now influential Google employee Russ Cox, along with influential computer virus author and son of one of the original UNIX authors Robert T. Morrison; entire source code fits in under a hundred pages of well-typeset documents [ warning, old copy, you should generate a modern one: https://pdos.csail.mit.edu/6.828/2011/xv6/xv6-rev6.pdf ].

Re:Ask HN: How do I learn C properly? by DyslexicAtheist on Sunday March 08, 2020 @04:00PM (#22520193)
not recent projects but everything that DJB implemented is absolutely elegant, low on bugs and great as a lesson for how to write secure C. e.g. qmail, djbdns, daemontools, there is a lot of ideas there you can learn from: https://cr.yp.to/

It also helps to build up (and refactor) your toolset over time, memory handling wrappers, logging, I/O, daemonize (https://github.com/jirihnidek/daemon) etc, so that you don't have to keep reinventing the wheel.

if I'd recommend one book then it's: https://en.wikipedia.org/wiki/Advanced_Programming_in_the_Un...

Re:Ask HN: How do I learn C properly? by vyskocilm on Sunday March 08, 2020 @04:07PM (#22520234)
Any C based project of zeromq project like https://github.com/zeromq/czmq is worth to read. Pieter Hintjens started a book explaining all the design decisions there https://hintjens.gitbooks.io/scalable-c/ Sadly he didn't have a time to finish the book.
Re:Ask HN: How do I learn C properly? by diego_moita on Sunday March 08, 2020 @03:42PM (#22520075)
Lua and Sqlite sources are excellent.
Re:Ask HN: How do I learn C properly? by elliotec on Sunday March 08, 2020 @03:46PM (#22520095)
Linux as well. The comment culture of C devs really help with understanding all of it.
Re:Ask HN: How do I learn C properly? by mlvljr on Sunday March 08, 2020 @03:54PM (#22520143)
There was a book featured in a HN post about a year ago - an older Linux source with extra commentary, used by students in China, I think (book is in English)
Re:Ask HN: How do I learn C properly? by 2OEH8eoCRo0 on Sunday March 08, 2020 @04:11PM (#22520262)
Re:Ask HN: How do I learn C properly? by mlvljr on Sunday March 08, 2020 @03:41PM (#22520068)
Sqlite