Monthly Archives: March 2012

An Interesting CPP Bug

The C preprocessor, being a dumb text-manipulating tool that does not understand the syntactic structure of the underlying program, is often a hiding place for subtle headache-inducing bugs. I’ve been bitten such bugs myself and one bug I had a … Continue reading

Posted in Computers | Tagged , , , | 3 Comments

Faking Dependent Types in C++

It is possible to have some kind of dependent typing in C++ using templates. The “solution” isn’t elegant or usable, but I found it mildly interesting so I’ll try to explain it here. The C++ type system with templates is … Continue reading

Posted in Computers | Tagged , | 6 Comments

TSA in the sky with diamonds

An anti-drug article [1] was written and published by some IIT Kharagpur students in one of our campus newspapers. I think the article is rubbish and here’s why. I think the article should, in principle, offend any self-respecting individual due … Continue reading

Posted in Rest | Tagged , , | 4 Comments

Type-Safe Tic-tac-toe

I recently had occasion to screw around Haskell’s type system. The end goal was to produce a Tic-tac-toe game in which all type-correct moves are legal and where all illegal moves produce type errors. I decided call the following moves … Continue reading

Posted in Computers | Tagged , , | Leave a comment