News for hackers. Stuff that matters.
Re:Why Is SQLite Coded in C? (2017) by pcwalton on Wednesday March 14, 2018 @02:13PM (#16586964)
No, it doesn't. Maybe it did in 1978, but modern C compilers have to go to heroic lengths to do things like alias analysis that would be easier if the aliasing rules of C weren't so subtle. In Java the question of "can pointer A alias pointer B" is simple (unless typeof A derives typeof B or vice versa, the answer is no). In C, due to TBAA, it's hideously complex.
Re:Why Is SQLite Coded in C? (2017) by jcranmer on Wednesday March 14, 2018 @04:38PM (#16588080)
If you look at software engineering and static analysis papers for a language like Java, there's often a discussion about using stuff like 2-object, 3-call site context sensitive alias analyses built on more or less fairly standardized Datalog rules. If you look at C or C++, the response is generally "you want a precise alias analysis? fall down in riotous laughter".

The rules for TBAA are complex, and many C/C++ programs violate those rules because it's so hard to actually make sure you're not violating them, and half of the purpose of using C/C++ is actually to be able to do the kind of type-punning that TBAA prohibits.

Re:Why Is SQLite Coded in C? (2017) by boomlinde on Wednesday March 14, 2018 @07:01PM (#16589132)
I mean writing a compiler that fulfills the specification. Whether a design complicates the implementation of alias analysis doesn't really change whether it is simple.