Entries in the ‘Software Development’ Category:

Graham Scan in Haskell

This article follows how I developed an implementation of the Graham scan algorithm in Haskell, missteps and all. I think it’s valuable to see the process that others use, especially in a “weird” language like Haskell. At times, it can seem like most of what you’ve learned about developing software doesn’t apply to Haskell, but I think that’s just because the language allows so much of the scaffolding to be cut away once the software is finished. Reading Haskell code written by the masters can feel like looking at the Sistine chapel and wondering where they got such long paint brushes. This will be a step-by-step implementation as I developed it. I’m still learning too, so don’t take this as an example of excellent Haskell style.

Read the rest…

Tags: , , ,

Leave a Comment


Double Pendulum Simulation

I’ve been playing around with some of the new features in HTML5, particularly to see how the canvas stacks up to Flash. One of the things I wanted to test was javascript performance, so I ported this Flash toy I wrote a few years ago. It’s a physical simulation of a double pendulum system. It’s interactive, and it can export the line drawing it produces as a PNG.

How did canvas+JS do? The export was a lot easier: I had to write a PNG encoder in Actionscript for the original version! Pretty much everything else was harder. Canvas has features similar to Flash 5, and I missed modern Flash’s rich standard library. CSS layout is still somewhat inferior to Flex for GUI design, as the layout options are less flexible.

One of the appeals of canvas is mobile support, but I was disappointed by the performance on my Motorola Droid. Just clearing the background on a canvas larger than 500×200 took the frame rate to single digits, and I couldn’t find a reliable way to make the canvas fill the screen if other elements were present (I didn’t look too hard, since a canvas that large was unusable). The javascript performance was fine, it was just the drawing that caused problems. Let me know if you get better results on different hardware, I’d love to know that this can work better.

Overall, canvas shows promise, but I don’t think it’s ready to replace Flash for complex graphical applications.

Tags: , , , ,

Leave a Comment


Windows vs. Unix File System Semantics – Conifer Systems

This is a great summary of the low-level API differences between Windows and Linux file systems.

Windows vs. Unix File System Semantics – Conifer Systems.

Tags: , ,

Leave a Comment


Practical Haskell: scripting with types

Starting with a simple shell script, Don Stewart shows how Haskell can be readable, safe, and robust in this slide show.

Practical Haskell: scripting with types « Control.Monad.Writer.

Tags: ,

Leave a Comment


Fox & Geese in Haskell: Part 2

Last time we looked at how the board is represented in the little Fox & Geese game I wrote in Haskell. This time, I’ll cover the machinery that makes the game go: moving pieces, jumping, and validating moves. The code for this part is available in my GitHub repo under tag v0.1.2.

Read the rest…

Tags: , ,

Comments (3)


Fox & Geese in Haskell: Part 1

My next project for learning Haskell is Fox & Geese. This game has simple rules and mechanics, and it doesn’t need fancy graphics. It is pretty easy to implement a simple version quickly, so I can focus more on Haskell than details of the game. I’ll go over this in a series of posts. In part 1 I’ll talk about how I represent the game board in Haskell, and in later parts I’ll discuss input handling, drawing, and game mechanics.

Read the rest…

Tags: ,

Comments (1)


Monad Transformers

Two easy introductions to monad transformers in Haskell.

The first is a PDF, Monad Transformers Step by Step, that builds up complex functionality step by step using monad transformers.  It shows in detail how to combine transformers, and why you would want to, two things which had thoroughly confused me.

The second is another brief post from A Neighborhood of Infinity, Grok Haskell Monad Transformers.  This shows how to work with a stack of monad transformers using lift.

Tags: , ,

Leave a Comment


A Bit About Monads

Here’s a great, understandable introduction to monads.  He builds up monads as solutions to common problems.  I love explanations like that!

A Neighborhood of Infinity: You Could Have Invented Monads! (And Maybe You Already Have.).

Tags: ,

Leave a Comment


Haskell Life

I’m starting to pick up Haskell again, and this time it’s finally clicking for me. Believe it or not, Learn You A Haskell explains monads in a way that actually makes sense! While I’m learning Haskell, I’m going to be making some dumb little projects. What better way to make sure I understand how they work than by explaining them on here? And who knows, maybe you’ll catch the Haskell bug, too.

The first project is a simple implementation of Conway’s game of life. The full source is at GitHub. There isn’t much to life, really. All we have to do is read or generate a starting grid, apply the rules to make grid N+1 from grid N, then draw a grid on the screen.

Read the rest…

Tags: , ,

Leave a Comment


Spin: The Game

Spin is a new Flash game I’ve been noodling on for a little while. It’s a Puzzle Bobble type game, except that the balls can freely spin like a pinwheel. The rotation is physically accurate, so as balls fall off of the board it changes speed and direction. When a ball hits the board the ball’s momentum is transferred to it, so if the board is turning slowly you can speed it up or make it turn the other way by firing the balls at it.

The feature list was miles long, but I’m getting too busy to work on it. Look forward to a second version when I can get back to it.

Tags: ,

Leave a Comment