Concepts: Typeclasses for C++?

I’ve had a hypothesis for a while that C++ templates (paired at times with ADL) are an ad-hoc, unsound version of typeclasses. I’ve seen this hold for parser combinators, range base algorithms, and more. I’m also not the first to draw this comparison[1]. Concepts are supposed to bring soundness in through constrained templates. Concepts look awfully …

Repls, repls, everywhere

Have a new-years resolution to try out a new programming language, but in too much of a hurry to pick only one, or install anything? Online REPs and REPLs Today there’s 61 different languages on that list. That many, there’s gotta be at least one that strikes your fancy. Best batch execution site: ideone.com with 50 unique languages. …

Only a Mathematician would say

I came across a version of Dijkstra’s “Goto Considered Harmful” annotated by David Tribble. A lot has changed since then; the annotated version is perfect for acquiring the right context to read the paper. There was a particular line by the annotator that continues to amuse me: Dijkstra seems to imply that iterative looping (inductive) …

Bondage and Discipline Python

Python has an identity crisis sometimes. It starts with the premise, from Guido’s prior work on ABC, to make a simple but easy to understand language. But then turns around and cries out “one way to do it“, leaving the programmer perplexed as to how Guido van Rossum thought we should do things. For example, Guido hates …

The case of the different shifts

Larry Osterman has commented on an interesting edge case in the C/C++ standards, involving the underflow of the right shift operator. They reported that if they compiled code which calculated: 1130149156 >> -05701653 it generated different results on 32bit and 64bit operating systems. On 32bit machines it reported 0 but on 64bit machines, it reported …

Kindle programming (part 1)

I bought an Amazon Kindle 3G back in October. So far I’ve mostly been reading research papers on it (that 3rd gen eInk really is amazing), occasionally proggit. I applied for SDK access, but heard nothing back. So instead, I’m using the built in “experimental” web browser. It has canvas support, so I’m golden. As …

Quickrefs for Python and Vim

More quick reference booklets: Vim PocketMod draft 1 (new) Python PocketMod draft 1 (new) Scheme PocketMod draft 3 (updated) I don’t really need the qr for Python, but I thought it might be good to have ready should a friend a coworker wish to start learning Python. As for Vim, the reference is certainly terrible …