generators with continuations

I didn’t understand continuations until I read somewhere about the connection between generators and continuations. The idea kept gnawing at me until I went ahead and tried to make a generator with continuations and that’s when things clicked into place. So without further ado here is a step by step guide on how to implement generators in Ruby with callcc. Continue reading

invariant arguments and rants

Here’s a test I use to figure out if the latest rant on programming language X has any substance. Take every sentence where language X is used and replace it with some other one like ‘Go’, ‘Java’, ‘Ruby’, ‘Python’, or whichever one is your favorite. If the rant remains coherent then the argument the author is putting forth is language invariant. In other words there is nothing specific about the given programming language holding it together.

I’m not the first one to notice the invariant nature of programming language arguments. Someone has already created a website to generate these rants: Automated Rant Generator.

principles of discourse

Colorless green dreams sleep furiously.
– Noam Chomsky

If I know the answer I’ll tell you the answer, and if I don’t, I’ll just respond, cleverly.
– Donald Rumsfeld

Combine those two and suddenly all programming language discussions start to make sense. Everything is syntactically correct, semantically irrelevant, and phrased as cleverly as possible.

exploring a problem solving design space

This post started out as

because I was trying to write about designing a DSL that deals with variables with multiple values. Continue reading

How does Ruby do X?

The answer can usually be found with ruby -rdebug or ruby -rtracer. There is also the trick with RUBYOPT. If you are executing something with bundler then you can run RUBYOPT="-rdebug" bundle exec ${command} and you will be dropped in the debugger as usual.