2 ms·
> This is innovative and kind of brilliant, I'm impressed! As someone who is not the author of this blog post, I'm glad you are impressed: I wrote pretty much
by lelanthran 2y ago
> This is innovative and kind of brilliant, I'm impressed!
As someone who is not the author of this blog post, I'm glad you are impressed: I wrote pretty much the same thing around 7 years ago: https://www.lelanthran.com/chap2/content.html https://www.lelanthran.com/chap2/content.html
The difference with mine is that I intended for the library to be endian-independent, so usable over a network transmission to a different endian machine.[1]
Great minds ... (everyone knows how the rest of it goes).
[1] I also eschewed using `%` for the format string specifiers, because (in my words at the time):
> Our parameterised functions must take a specification that tells it how each field should be written, very similar to the printf and scanf family of functions. While it is indeed possible to reuse the standard format specifiers as our own field specifiers it might not be a good idea to do so as this would break The Principle of Least Astonishment.1 This is because anyone who is changing the code and who sees a string literal with well-known format specifiers such as %02x and %c would naturally (but incorrectly) assume that all format specifiers are supported. We do not wish to confuse the reader.