Inside 245-5D

Existential Pontification and Generalized Abstract Digressions

Computer Science

The new Reflections on Trusting Trust

In his classic essay Reflections on Trusting Trust, Ken Thompson describes a self-replicating compiler bug which is undetectable by source code inspection. The self-replication is made possible by the fact that most compilers are self-compiling: old versions of a compiler are used to compile new ones, and if the old version is malicious, it can […]

  • October 28, 2011

Obviously Correct

What do automatic memory management, static types and purity have in common? They are methods which take advantage of the fact that we can make programs obviously correct (for some partial definition of correctness) upon visual inspection. Code using automatic memory management is obviously correct for a class of memory bugs. Code using static types […]

  • October 24, 2011

Polyglot programming

Being back in town over MIT's Infinite Activities Period is making me think about what kind of short lecture I want to try teaching. I've been turning over the idea of a polyglot programming class in my head: the idea is that while most people feel really comfortable with only one or two programming languages, […]

  • October 12, 2011

Why you shouldn’t do a PhD in systems

The opinions presented in this post are not necessarily mine. I'm just one very confused undergraduate senior with a lot of soul searching to do. When I tell my friends, “I’m going to get a PhD,” I sometimes get the response, “Good for you!” But other times, I get the response, “Why would you want […]

  • September 26, 2011

A Year of Notebooking (Part 2)

This is notebook two. Max Schäfer: Refactoring Java Most Java refactoring tools built into IDEs like Eclipse are little more than glorified text manipulation macros. There are no guarantees that the result of your refactoring will have the same behavior as the original: you can even refactor code that doesn’t even compile! To prevent this, […]

  • June 22, 2011

The return of Hellenistic reasoning

I recently attended a talk which discussed extending proof assistants with diagrammatic reasoning support , helping to break the hegemony of symbolic systems that is predominant in this field. While the work is certainly novel in some respects, I can't also but help think that we've come back full circle to the Ancient Greeks, who […]

  • March 21, 2011

Spring Reading: 2011 edition

Books are expensive, but by the power of higher-education (also expensive, but differently so), vast oceans of books are available to an enterprising compsci. Here’s my reading list for the spring break lending period (many of which were recommended on #haskell: Concepts, Techniques, and Models of Computer Programming by Peter Van Roy and Seif Haridi. […]

  • March 18, 2011

Many-valued logics and bottom

I was flipping through An Introduction to Non-Classical Logic by Graham Priest and the section on many-valued logics caught my eye. Many-valued logics are logics with more than the usual two truth values true and false. The (strong) Kleene 3-valued logic, sets up the following truth table with 0, 1 and x (which is thought […]

  • March 11, 2011

Killer mutants attack (mutation gone wrong)

This is a collection of WTFs due to misuse of mutable state. We'll start off with some Java. What do you expect this snippet of code to do? Sensor Accel = sm.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); Sensor Orient = sm.getDefaultSensor(Sensor.TYPE_ORIENTATION); sm.registerListener((SensorEventListener) this, Accel, sm.SENSOR_DELAY_FASTEST); Ostensibly, it registers the current object to receive just accelerometer updates. But what if I […]

  • March 9, 2011

No one expects the Scott induction!

New to this series? Start at the beginning! Recursion is perhaps one of the first concepts you learn about when you learn functional programming (or, indeed, computer science, one hopes.) The classic example introduced is factorial: fact :: Int -> Int fact 0 = 1 -- base case fact n = n * fact (pred […]

  • December 27, 2010