Category: systems

  • Pointer alias analysis in C

    Pointer alias analysis in C

    Perhaps there is some reason to provide a mechanism for asserting, in a particular patch of code, that the compiler is free to make optimistic assumptions about the kinds of aliasing that can occur. I don’t know any acceptable way of changing the language specification to express the possibility of this kind of optimization, and I…

  • Depressing and faintly terrifying days for the C standard

    Depressing and faintly terrifying days for the C standard

    C STANDARD UNDEFINED BEHAVIOR VERSUS WITTGENSTEIN 1. DEPRESSING AND FAINTLY TERRIFYING Chris Lattner, the architect of the Clang/LLVM C compiler explained the effects of the C standard’s “undefined behavior”(UB): UB is an inseperable part of C programming, […] this is a depressing and faintly terrifying thing. The tooling built around the C family of languages…

  • More UB madness from LLVM/Clang

    Via @johnregehr this further tale of  compiler “optimizations” that break correct C code without even a warning by deleting a necessary null pointer check. In this example, Bar contains a stack of Foos. Sometimes the Foo stack is empty, so sometimes getLastFoo returns null. The caller is supposed to check for that case, but the…

  • informal methods applied to networks and timeouts

    Distributed computation involves many interesting issues concerning shared data. Here I want to sketch out what networks look like using applied (informal) mathematics so we can look at some algorithms for consensus and data consistency. No  formal methods or category theory or metamathematics of any kind have been used in making this note. Start with…

  • Types considered harmful. From a remark by Wolfram.

    Types considered harmful. From a remark by Wolfram.

    Originally Nov 30, 2017. (revised 2021,2023) Russell introduced what is often viewed as his most original contribution to mathematical logic: his theory of types—which in essence tries to distinguish between sets, sets of sets, etc. by considering them to be of different “types”, and then restricts how they can be combined. I must say that…

  • C compiler developers are hostile to C programming

    From the LLVM developer mailing list this remarkable exchange in which Chris Lattner of LLVM says that the compiler use of undefined behavior (UB) is so “crappy” that the only solution is to abandon C programming (my bold). On Jul 7, 2017, at 1:40 PM, Peter Lawrence <peterl95124 at sbcglobal.net> wrote: > Chris, > The…

  • The C standard versus C and the mother of all hacks.

    The Kafkaesque interaction of the C standard and the main open source C compilers was concisely outlined by one of the main LLVM authors back in 2011: “knowing that INT_MAX+1 is undefined allows optimizing X+1 > X to “true”. Knowing the multiplication “cannot” overflow (because doing so would be undefined) allows optimizing X*2/2 to X…

  • The C standard committee effort to kill C continues

    Consider the following code: void f(void) { unsigned char x[1]; /* intentionally uninitialized */ x[0] ^= x[0]; printf(“%d\n”, x[0]); printf(“%d\n”, x[0]); return; } In this example, the unsigned char array x is intentionally uninitialized but cannot contain a trap representation because it has a character type. Consequently, the value is both indeterminate and an unspecified value. The bitwise exclusive…

  • Chang-Maxemchuk atomic broadcast

    The Chang-Maxemchuk algorithm (US Patent 4,725,834 ) solves atomic broadcast (and in-order broadcast) problems for distributed networks in a far simpler and more efficient way than some popular alternatives. In fact, the obscurity of this method is hard to understand given the current interest in distributed consensus. The basic idea is simple algebra. A source site or…

  • Data base design criteria: ease of use

    Regarding ease-of-use, it’s often struck me when reviewing data systems papers that the evaluation sections are full of performance and correctness criteria, but only rarely is there any discussion of how well a system helps its target users achieve their goals: how easy is it to build, maintain, and debug applications?; how easy is it…