ezyang’s blog

the arc of software bends towards understanding

Programming

Graphs not grids: How caches are corrupting young algorithms designers and how to fix it

Subtitle: Massively multithreaded processors make your undergraduate CS education relevant again. Quicksort. Divide and conquer. Search trees. These and other algorithms form the basis for a classic undergraduate algorithms class, where the big ideas of algorithm design are laid bare for all to see, and the performance model is one instruction, one time unit. “One […]

  • July 12, 2010

MVC and Purity

Attention conservation notice. Purely functional programming demonstrates the same practices recommended by object-oriented MVC practice. Model-View-Controller is a widely used object-oriented design pattern for organizing functionality in an application with a user interface. I first ran across it in my early days programming web applications. The Model/View separation made deep intuitive sense to me as […]

  • July 2, 2010

The secret to successful autogenerated docs

I've had a rather successful tenure with autogenerated documentation, both as a writer and a reader. So when Jacob Kaplan Moss's articles on writing “great documentation” resurfaced on Reddit and had some harsh words about auto-generated documentation, I sat back a moment and thought about why autogenerated documentation leave developers with a bad taste in […]

  • June 21, 2010

Static Analysis for everyday (not-PhD) man

Bjarne Stroustrup once boasted, "C++ is a multi-paradigm programming language that supports Object-Oriented and other useful styles of programming. If what you are looking for is something that forces you to do things in exactly one way, C++ isn't it." But as Taras Glek wryly notes, most of the static analysis and coding standards for […]

  • June 9, 2010

Databases are categories

Update. The video of the talk can be found here: Galois Tech Talks on Vimeo: Categories are Databases. On Thursday Dr. David Spivak presented Categories are Databases as a Galois tech talk. His slides are here, and are dramatically more accessible than the paper Simplicial databases. Here is a short attempt to introduce this idea […]

  • June 4, 2010

Bug boogie: Git and symlinks

Git is very careful about your files: unless you tell it to be explicitly destructive, it will refuse to write over files that it doesn't know about, instead giving an error like: Untracked working tree file 'foobar' would be overwritten by merge. In my work with Wizard, I frequently need to perform merges on working […]

  • June 2, 2010

Design Patterns in Haskell

Attention Conservation Notice. A listing of how Gang of Four design patterns might be equivalently implemented in Haskell. A phrasebook for object-oriented programmers dealing with functional programming concepts. In their introduction to seminal work Design Patterns, the Gang of Four say, "The choice of programming language is important because it influences one's point of view. […]

  • May 3, 2010

Art. Code. Math. (And mit-scheme)

I was in rehearsal today, doodling away second oboe for Saint Saens' Organ Symphony for the nth time, and it occurred to me: I've listened to and played this piece of music enough times to know the full overall flow as well as a good chunk of the orchestral parts, not just mine. So when […]

  • April 30, 2010

The Problem with xUnit

Tagline: Assertions considered not ideal. I think automated tests are great. I used two particular flavors of test, the unit test and the integration test, extensively in HTML Purifier and they're the only reason why I feel comfortable making changes to code that I first wrote in High School. The automated tests let me hack […]

  • April 26, 2010

Creative catamorphisms

The bag of programming tricks that has served us so well for the last 50 years is the wrong way to think going forward and must be thrown out. Last week, Guy Steele came in and did a guest lecture "The Future is Parallel: What's a Programmer to Do?" for my advanced symbolic class (6.945). […]

  • April 23, 2010