news
Programming Leftovers
-
Alex Gaynor ☛ Is it correct?
If I ask you if some code is correct, there are broadly two things I could be asking: (1) does this code have the desired behavior for the set of inputs that users will provide, and (2) does it have the desired behavior for all possible inputs. In general, we care about (1) because that defines the sort of experience users will have, and we care about (2) for security.1 All other things being equal, (2) is a better property of course – it’s strictly more correctness than (1) offers. Alas, proving to ourselves that code is correct for all possible inputs is harder than proving it’s correct for some specific set of inputs – the latter can be done with a test suite, while the former requires something more. As a result, the verification we do for most software is a hybrid: testing to ensure the code has the right behavior on the set of inputs we care about, and other more expensive techniques to ensure it doesn’t have security vulnerabilities (with adversarially chosen inputs).
-
Ben Joffe ☛ A faster way to convert a timestamp ➜ Hour, Min, Sec
This is in contrast to most date libraries which take around 16 cpu-cycles to compute.
The speed gain will come from two main ideas (in order of importance):
1. A non-obvious reordering of the calculation steps, breaking the dependency chain.
2. Optional math tricks, including converting a base-60 clock into binary-friendly base-64. -
Suhas Kashyap ☛ Internationalization (i18n) and Localization (l10n)
Consider this scenario: You're a person from the US, staying in Canada, and looking to book a hotel room in Jaipur, India from my Travel site. You're looking at a card like this: [...]
-
Rust
-
Rust Blog ☛ The Rust Programming Language Blog: Rust debugging survey 2026 results
One of the biggest challenges Rust developers report in our annual surveys is a subpar debugging experience. So, back in February, we ran our first Rust Debugging Survey, in the hopes of identifying how Rust developers are using debuggers and what problems they are facing when doing so. We received over 2,300 responses, and we'd like to thank everyone who took the time to participate in the survey!
In this report, we'll go over some of the results of the survey.
-