Custom Memory Allocation in dxcompiler

This post describes the implementation of the custom memory allocator in dxcompiler. At some point, the information here will likely make it into the repo itself along with other design notes. Motivation The DirectX Shader Compiler is mostly meant for offline usage, that is, compiling during the build process and not while the game or…


Not Your Father’s Debugger

In case you missed it, the Debugging Tools for Windows blog recently posted about the new SDK and the availability of JavaScript extensibility. I used something like this a few years ago to do all sorts of interesting things, and I can definitely see myself doing more of this in the future. Something I learned…


Interrupting shader compilation

Unfortunately, there really isn’t a way to interrupt compilation once it has started. Why would you ever want to do that? Well, if you’re doing compilation (and you really should try to compile offline, although it’s impossible in some cases), the user may decide to switch to a different application while you’re busy. At that…


datajs formats for OData flavored with simplicity

Alex has just uploaded the intermediate formats on the datajs CodePlex Wiki. These describe the shape of results provided by reading OData as well as the expected format to send data back to the server. Like I mentioned before, these values do not have any classes or prototypes associated with them – you can simply…


Math is hard, let’s go shopping

For better or for worse, the phrase “Math is hard, let’s go shopping” is one that I use every now and then during design meetings. There are typically two situations that will prompt this. We’re about to do something hard to implement that’s not worth it. Sometimes adding just a bit more of functionality to…


Design style for OData in datajs

The datajs source code is out there for the world to see. Today I wanted to share a bit about what style we use and why we decided upon it. After years of writing for the .NET framework, one of my first impulses is to start thinking in terms of objects. However there are a…


API Design: how to lie less

So I wrote a bit last week about the importance of not lying through your APIs, but I didn’t offer any examples on how to improve the examples I gave. Let’s take one at a time and consider how they might get improved. The first case we had was the mis-named API. public static void…


Design evolution

Today is the last post from a couple of design thoughts I’ve been writing down, and it addressed what happens with components over time. The natural tendency of systems is to gain more capabilities over time. The path of least resistance is often to extend the existing components by making them do more work. So…


Abstraction levels and dependencies

As a follow-up from yesterday’s post about not lying, I wanted to discuss a bit some thoughts on abstraction levels. At first, it would appear that high-level methods lie a lot. When you ask a SqlConnection object to Open, it actually does a bunch of work: look at the connection string, possibly using the web.config…


API Design Rule: First, Don’t Lie

Today’s post is about a very simple rule for API design: don’t lie. This seems relatively straightforward, but there are a number of ways in which APIs may end up lying or misleading their consumers. What do I mean by lying? The obvious case is an API that doesn’t do what it says it will….