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 …
Category Archives: Uncategorized
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) …
Quickrefs update: Common Lisp
I’ve got a fairly terrible draft of a quickref sheet for Common Lisp. This should be enough to recall the most common/needed commands, but it’s fairly terrible at this point. That said, it might be useful for someone out there: CL-PocketMod draft 1 For reference, the prior quickrefs are here: [link]
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 …
Eval in Python
I’ll just leave this here for you: Wait what. Python compiles? That is correct. CPython and PyPy (the implementations worth caring about currently) are in fact creating a code object from the string you pass to exec or eval before executing it. And that’s just one of the things many people don’t know about the exec statement. …
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 …
Scheme Quick Reference
For your Scheme quick reference needs: As a PocketMod, a 6-letter booklet you can print at home. Print, fold, and cut. Also, source available, posted on codepad.org. Reformat as needed. A while back I had explored the problem of the “ideal” programming language quick-reference card.