September 2022 Links
Some ways to get better at debugging
Always-nice Julia post, links to troubleshooting papers:
- Towards a Framework for Teaching Debugging, Jan 2019 (paywalled)
- Learning to Troubleshoot: A New Theory-Based Design Architecture, June 2006 (free)
Reminded me of my favourite troubleshooting paper:
To get access to paywalled papers, try Unpaywall browser extension, Sci-Hub website. You can also see if your local government library offers memberships, call a librarian to check, they love talking about papers :) Failing that, many universities offer cheap paid library access to non-students.
The x86-64 processor (aka amd64, x64): Whirlwind tour
After a massive series on aarch64, based Raymond starts on amd64.
Doom 32X Resurrection - Engine optimizations, part 1
There’s a ROM Hack for Doom 32X which improves it a lot. This walks through how.
Integers in C
A fun quiz on signed/unsigned behaviour, and a set of supporting blog posts:
- https://www.acepace.net/integerQuiz/
- A Guide to Undefined Behavior in C and C++, Part 1
- A Guide to Undefined Behavior in C and C++, Part 2
- A Guide to Undefined Behavior in C and C++, Part 3
Ask HN: What’s the best source code you’ve read?
The top comments here turned into an impromptu reunion of the Turbo C runtime authors, which is totally awesome.
I always love reading musl libc which is simultaneiously very readable and very efficient. I think it takes real talent to write code like this.
John Regehr agrees in his blog post about Teaching C:
Musl, in particular, is a good match for teaching since it contains lots of cute little functions that can be understood in isolation. From any such function we can launch a discussion about tradeoffs between portability, efficiency, maintainability, testability, etc. If Rich Felker (the Musl author) did something a certain way, there’s probably a good reason for it and we should be able to puzzle it out.
In the HN thread about that post, we find some nice C safety rules:
- The Power of 10: Rules for Developing Safety-Critical Code
- The Ultimate Question of Programming, Refactoring, and Everything
- Computer Systems: A Programmer’s Perspective, 3/E (CS:APP3e)
- the original HN thread about Teaching C
- and the classes which arose from it (some exam questions available):
Back to the original post, apparently redis is quite good too. I’m vaguely aware that’s some sort of caching thing. The website has a section “Use cases” which is very nice of them.
Castlevania: SotN World Record Explained
The 16:26 speedrun explained. It’s always great to see these. The amount of precision required to pull these movements off.
glibc Fortification Levels
A set of posts which describe the glibc _FORTIFY_SOURCE
macro.
- Mar 2014 - Enhance application security with
FORTIFY_SOURCE
- Apr 2021 - Broadening compiler checks for buffer overflows in
_FORTIFY_SOURCE
- Sep 2022 - GCC’s new fortification level: The gains and costs
How To Write Unmaintainable Code
Proably very old, but I hadn’t laughed this much in ages
Effects of Grill Patterns on Fan Performance/Noise
Cool tests showing those wire fan grills are probably the best.
Architecture of Consoles
“A practical analysis by Rodrigo Copetti”. In-depth look at consoles from NES to Wii.
Banned functions in git
strcpy, strcat, strncpy, strncat, sprintf, vsprintf, gmtime, localtime, ctime, ctime_r, asctime, asctime_r
The commit log for this was a good read, and introduced me to their strbuf
API:
and their wrappers for some replacement functions:
A history of ARM, part 1
programmer-calculator
Found while browsing the ncurses
tag on GitHub.
Allows bitwise operations and displays multiple number formats. Nice.