Probably Dance

I can program and like games

Month: June, 2015

Another explanation for the Fermi Paradox

I just finished a science fiction book (The Algebraist by Iain M. Banks) in which people travel through space, but there is no faster than light travel. That is except if there is a wormhole connecting the solar system that you’re in with where you want to go. If there isn’t, it will probably take hundreds of years to transport the other end of a wormhole to where you want to go.

The long travel times offer another explanation for the Fermi Paradox. (in addition to all the explanations already in that article) If you lived in a spaceship and heard that there might be a young civilization on a rocky planet somewhere that is just emerging out of their evolutionary phase, would you spend hundreds of years to have a look? (While knowing that that new species is probably pretty boring and that you’ve probably seen five other species like it before and you already don’t like hanging out with those all that much)

You probably wouldn’t. Nobody would. And the proof lies in the fact that there are still hundreds of uncontacted tribes around the world. (Wikipedia) Now that I’ve told you that there are hundreds of uncontacted tribes around the world, will you go out and try to contact them? Probably not. Too many reasons against it, too few reasons for it.

And in space everything takes a heck of a lot longer, so no wonder that nobody has bothered to say hi.

Ideas for a Programming Language Part 4: Reactive Programming

Reactive programming has been around for a long time. It’s a paradigm oriented around data flows. The usual example is a spreadsheet: If cell B refers to cell A, then cell B updates automatically when I change the value in cell A. If ten cells refer to cell A, then all those ten cells change automatically. This is as opposed to C++, where if I compute ten variables using variable X, then if I change variable X, I have to manually write code to make sure that the other ten variables get updated.

What’s changed recently is that there are a few interesting approaches that make this paradigm more widely useful. Functional Reactive Programming (FRP) is a useful approach which is spreading, with popular libraries available for pretty much all languages. For an illustration of FRP and how it can be used in an imperative style I recommend reading Deprecating the Observer Pattern.

What really convinced me though that a lot more code should be reactive is a javascript library called Knockout. Which makes it so easy to write reactive code, you’d be stupid to ever write manual state propagation code.

Read the rest of this entry »