Skip to content

Category Archives: Uncategorized

the compiler is always right

09-May-14

I think everybody who programs has had a bug in one of their programs that they were positive was the compiler’s fault.  (Perhaps “it’s the operating system’s fault” or “it’s the hardware’s fault”, though these are less common.) At this point, you learn the rules of programming: The compiler is always right. If the compiler […]

my code search engine

06-May-14

Christian Legnitto wrote a blog post where he mentioned Firefox developers being forced to deal with “crufty code-search tools” (and many other perceived suboptimalities in the development process).  I’m looking forward to reading his followup, but I also thought it was worth blogging about what I use for my day-to-day code search needs. I use […]

getting older

29-Apr-14

I have been reading The Eighth Day of Creation by Horace Freeland Judson, which is a superb book, and thought this passage was relevant to writing software as well as scientific research: At lunch one day in Paris, early in December of 1975, I asked Monod whether he missed doing research directly. “Oh, I miss […]

finding addresses of virtual functions

20-Feb-14

Somebody on #developers this morning wanted to know if there was an easy way to find the address of the virtual function that would be called on a given object…without a debugger. Perhaps this address could be printed to a logfile for later analysis. Perhaps it just sounds like an interesting exercise. Since my first […]

space saving miscellany

29-Jan-14

Yesterday’s post on space saving techniques generated a few comments.  It seemed worthwhile to highlight a few of the comments for a wider audience. Various people have pointed out that clang and GCC support a -Wpadded option to warn when padding is necessary inside of a structure.  Visual C++ supports warning C4280 that does the […]

finding space savings

28-Jan-14

My last post talked about trimming down JSJitInfo.  But it left the question of how one might find things like this unanswered (and even unasked!).  Herein follows a short list of my strategies, with a large amount of explanation, for finding things that take up too much space. The first thing to look at is […]

packing structures for fun and profit

17-Jan-14

When the DOM bindings code first started generating information for the JavaScript JIT about getters and setters, the generated information was rather sparse. JSJitInfo, the container for such information, looked like this: struct JSJitInfo { JSJitPropertyOp op; uint32_t protoID; uint32_t depth; bool isInfallible; bool isConstant; }; On a 32-bit platform, sizeof(JSJitInfo) was 16. You could […]

on old releases

09-Jan-14

Gregory Szorc recently wrote a laundry list of reasons for ditching support for old Python releases.  I think this list of reasons to upgrade misses the larger point in providing software for other people: You do not get to tell your users what to do. Maybe those users don’t have sufficient control over their working […]

reading binary structures with python

06-Dec-13

Last week, I wanted to parse some Mach-O files with Python.  “Oh sure,” you think, “just use the struct module and this will be a breeze.”  I have, however, tried to do that: class MyBinaryBlob: def __init__(self, buf, offset): self.f1, self.f2 = struct.unpack_from(“BB”, buf, offset) and such an approach involves a great deal of copy-and-pasted […]

my git workflow

21-Nov-13

Mark Hammond recently started an etherpad about how people work with git. Rather than commenting there, I thought I’d blog about my workflow instead. First piece: magit.  If you use emacs and git, and you don’t use magit, you are missing out.  Highly recommended.  I don’t use the git command line for common operations anymore; […]