Open Source Extravaganza!

I’ve been quiet here lately. That’s what happens when a heavy workload blends into a long vacation.

To help myself get back in the swing of this blogging lark, I’m made today an “open source dump”. Basically, I went through all the stuff I hadn’t made publicly available before and added mirrors on github.

Most of this is incomplete, trivial, and most likely crap. Read on for links!

Continue reading

Haskell logo

Snippet Sunday: Mapping Over Large Numbers of I/O Resources

(This is the first in what will hopefully be a series of useful code snippets to solve problems. For each snippet, I’ll try to provide a basic solution to the problem, then ask my readers to post alternatives in the comments.)

Haskell provides some greatly composable functions in its standard Prelude library (accessible by default) that make performing operations on large lists of data very easy.

However, when dealing with certain resources (especially I/O resources, like file handles and network connections), these simple abstractions can get you in to trouble by easily exhausting available system resources.

What follows is a (very) simple method for mapping over large numbers of resources. It’s really just intended as an example for newcomers to Haskell, that may have encountered this problem.

Continue reading

Haskell logo

How is Haskell Working for You? (Survey Response)

The Commercial Haskell SIG recently sent out a survey through Haskellers.com. They plan on releasing the survey results to the public, but I found the questions interesting enough that I wanted to post my own response to it. Whether you agree or disagree with my responses, I think a conversation around the questions is highly relevant both to those just building an interest in Haskell as well as for those who have been practicing since Before Time Began.

For the curious, read on!

[Slight editing of survey responses was done for better readability. These responses are also highly subjective, of course – they are the personal thoughts of the author of this blog. :)]

Caution! If you received the survey and haven’t yet responded to it, please don’t read this post until you do so! I’d hate to see my writing skew their results.

Continue reading

Actions, Objects, and Context

Nouns

image00

Nouns describe things: objects.

  • The noun itself carries some description of the thing: “rabbit”
  • That description can be extended through adjectives: “dark rabbit”

Nouns have a limited context. They give you a concept of a thing at a particular snapshot in time. Without more context, they are limited.

Think of full sentences:

  • car
    • What does this mean? It doesn’t convey much information without more context.
    • If you Google “car”, you get a lot of very broad results – but does it help you solve your problem?
  • move car
    • Full context, assuming a car can move. Grammatically limited, but gives a broader idea.
    • You can Google “move car” and it gives very specific, contextually useful results.

Continue reading

When Worlds Collide: How Writing Fiction Intersects with Writing Code

I’ve recently become a big fan of author Trevor Schmidt’s science fiction novels. They’re pacing is perfect and the characters are wonderfully engaging. Despite his latest book being set in a truly alien environment, his writing is so immersive that you don’t even notice it. Trevor recently posted a guide to world-building for authors. As I read through his recommendations, I found a lot of his suggestions also apply to programming.

Continue reading

Haskell logo

Intro to Haskell’s conduit library (Conduit 101)

Haskell’s conduit library provides some deep capabilities for building transformative workflows, while providing many useful guarantees (such as constant memory usage – something that often bites Haskell developers). In this post, I’ll walk you through some simple examples of using conduit to transform text, but also demonstrate some useful variations on input and output.

Continue reading

Building APIs, Part 1: Halting-Driven Development

Far too often, we developers go to solve a problem and find ourselves in the mindless drudgery of writing boilerplate. Often, this boilerplate can distract us from the bigger picture of what we’re trying to accomplish.

This is a blog-ized version of a talk I gave recently. The talk was an interactive experience which doesn’t translate directly to text, but I’ll attempt to convey the same concepts.

If I fail, just remember: It’s December! Go play in the snow!

Continue reading