-
C is not a serious programming language
The C Standards process over the last few decades has addressed both optimization and pointer type safety largely through a concept called “undefined behavior”. The idea is that instead of positive rules for what compilers and programmers can do, the Standard will identify some program behavior as something compilers can interpret how they want —…
-
Dennis Ritchie on alias analysis in the C programming language 1988
This 1998 note by Dennis Ritchie from comp.lang.c (and also here ) is very current since the concept of noalias has definitely crept back into the standard. I have reproduced it verbatim, but lightly formatted for readability. For further reading try Linus Torvalds (pre-nice ) note, John Regehr’s paper on alias and this proposal for…
-
C89 Standard
A text version of a non-final draft is below. Here’s the pdf of the final version. (This foreword is not a part of American National Standard for Information Systems — Programming Language C, X3.???-1988.) American National Standard Programming Language C specifies the syntax and semantics of programs written in the C programming language. It specifies…
-
Semiotics of functional programming
In contrast to the usual imperative languages (e.g., C, Fortran, and Ada), in which variables represent cells in memory that can be modified using the assignment operator = (or :=), functional languages view the use of the = operator as an expression of an equation. For example, if a functional program contains the declaration let…
-
undefined behavior and the purpose of C

The C programming language is designed to let programmers work at both low and high levels. In particular, for applications like operating system development, cryptography, numerical methods, and network processing, programmers can go back and forth between treating data as representing abstract types and as machine addressable sequences of bits, between abstract operations and low…
-
Spanner in the works
The developers of Google’s Spanner database built an interesting system but chose to build their own clock synchronization technology instead of getting a more precise off the shelf solution and chose to make extensive use of the notoriously complex Paxos distributed consensus algorithm even though they were incorporating clock sync into their system. Whatever the…
-
Practical uses of synchronized clocks -Liskov

-
Three modest proposals for the C standard WG14

Note: these were sent to WG14 as official proposals. See also a longer paper, something on alias and Torvalds remarks and Regehr’s paper. 6.12 Proposal to clarify undefined behavior range for implementations [N 2278] 6.13 Proposal to make aliasing consistent [N 2279] 6.14 Proposal to limit optimization to C semantics [N 2280] I’m going to write…
-
Vector optimization with C aliasing
One of the common defenses of the abuse of “undefined behavior” by C compilers, and the stupid aliasing rules in the standard is that those things are necessary for optimizations, like using vector operations. Here’s an example of where gcc ignores the standard and does what the C language semantics require while taking advantage of…
