RossBencina
Joined 12 years ago
Joined 12 years ago
https://www.exploringbinary.com/visual-c-plus-plus-strtod-st...
https://lemire.me/blog/2026/02/01/converting-floats-to-strin...
typedef struct {
double d;
int err;
} Ret;
Ret foo(void) {
Ret r = { 0.0, 43};
return r;
}
int main() {
Ret r = foo();
}
You can't return a bare fixed-size array though.As far as I understand, inspecting the compiled binaries in any way would violate clean-room principles. At a minimum you'd need (A) one set of agents documenting the behavior of the executing binaries, e.g. manipulating the UI, and reviewing documentation and training manuals, and (B) a second set of agents whose only input is the output of the first set of agents. I'm not sure whether testing the real and AI generated agent side by side with equivalent inputs would constitute clean-room, although it might be legal.
I agree that a large part of the value of a product stems from "thousands of tiny design, engineering, and product decisions." But I don't agree with your conclusion. If the goal is to replicate the behavior of an existing piece of software then all you need to do is observe the behavior and replicate it. You don't need to engineer it in the same way, or arrive at it by making the same engineering and design decisions. Of-course in the end all you have is the replica, not the engineering and design heritage, product management, or the teams to carry the work forward. But that is the same problem open source "clones" of commercial products have often suffered from.
That may be true. Serious question though: even if most devs wanted to develop formally verified code, do you think that it is reasonable to suggest that the typical systems developer could do it with today's tools? I don't mean verified protocols (TLA+) or verified algorithms (SPIN) I mean end-to-end verified code, a-la seL4. I got the impression that this is still very specialised work. Perhaps things have advanced since I last checked.
I think Indian Hill (C, not C++) was the first one I ever read: https://www2.cs.arizona.edu/~mccann/cstyle.html
Looks like there is an updated version (1997) here: https://www.cs.cornell.edu/people/egs/comp303/tutorials/csty...
Paul Haeberli's "The SGI C Source Compliance Requirements" is hard to forget: https://www.graficaobscura.com/ccode/index.html
I wonder whether there is a centralised historical archive of C/C++ style guides?
The modern staples are covered here, I guess:
That said, the depth that I read at mostly depends on why I am reading something. Most papers I don't read in depth, but whether I initially only read the abstract or skim the whole paper depends a lot on a lot of factors (paper content, length, ease of access to full text, whether I am triaging a lot of papers at once, how interested I am in the specific paper (usually based on the title and/or authors, maybe the abstract), etc.).
I read in multiple passes of increasing depth. Zeroth reading is more-or-less triage: is the paper worth reading at all? First reading would generally be start-to-finish. I underline and/or mark up the margins with particularly interesting/important sections and also star key references based on the author's commentary.
If it's an algorithm or math-heavy paper either I only care about the gist and I don't go deeper, or I dig in with further readings and study to properly understand the details. That could be relatively quick, or it could be a whole rabbit hole if I need to learn some background. Sometimes it takes a while for the importance of a paper to dawn on me, in which case I come back later and read in more depth.
With the references I generally only follow those with relevance to my research goals. For example the authors might have detailed a technique in an earlier paper, or they might have cited other relevant work that I was not aware of.
Different fields use different standard forms or styles for abstracts. If you have not already done so you can get a feel for this by looking at a random sample of the top 100 most-cited papers in your field (or your target conferences, journals, arxiv categories) and quickly compare to top 100 in a couple of disparate fields (e.g. biochemistry, economics, anthropology, mathematics).
Of course, there are good reasons to read a paper besides the quality and content of the abstract. Consequently, there are well known papers with non-standard abstracts. I recommend mastering the basics first.