-
Power in the small, properties at large
The fight between imperative and functional programming is a special case of a larger tradeoff, which Ted Kaminski describes as power vs properties.
-
An example of why software composition is hard
Combining two concepts into a program is rarely as simple as
import A; import B;
. Almost always, when you combine two libraries, additional code must be written to handle their interaction. The following example comes from Wolfgang Scholz. I learned about it from the paper An Overview of Feature-Oriented Software Development, by Apel and Kästner. -
The History of the Frame Problem
This is my synopsis of the paper, “The History of the Frame Problem”.
-
Automatic redis through static differentiation
A new project, “Incremental λ-Calculus”, obviates my previous posts on automatic redis. The team has created an algorithm, called static differentiation, which performs a source to source translation on functions in the simply typed lambda calculs. The resulting function takes twice as many arguments as the previous program, with every other argument being a diff, or derivative, on the previous argument. When further optimizations are applied to the source, such as constant reduction and dead code elimination, the non-derivative arguments can sometimes be removed entirely. Here is an example from the paper:
-
Using unsafeInterleaveIO to lift haskell's lazy semantics into a toy interpreter
The main challenge of writing a lazy interpreter is sharing structure: in particular, making sure that an individual closure is not evaluated more than once. Obvious but tedious solutions in Haskell include using
IORef
s and monadic state. The interpreter below uses a completely different tactic: exploitingunsafeInterleaveIO
. All function arguments are evaluated “right away”, but in the context of anunsafeInterleaveIO
(so, in fact, they are actually not evaluated right away). With this hack, we get to write an interpreter which looks like an interpreter for a strict functional language, but actually behaves lazily (by lifting haskell’s own lazy semantics into our interpreter).