Will.Whim

A weblog by Will Fitzgerald

Monthly Archives: May 2011

Bloom filters in Go

I’ve written my second Go package to implement Bloom filters. It can be found at:

https://github.com/willf/bloom

It requires my bitset implementation:

https://github.com/willf/bitset

Enjoy!

Advertisements

Baby steps with Go

I’ve started teaching myself the Go programming language. I’m enjoying most aspects of it. It feels like a really modern C–that is, low level enough to be fast, but with lots of the bells and whistles one comes to expect in a modern programming language. It has lots of data types, an interesting alternative to object-oriented programming called interfaces, a reasonably-sized library, support for concurrency baked into the language, etc. The Go home page says it well:

The Go programming language is an open source project to make programmers more productive. Go is expressive, concise, clean, and efficient. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel type system enables flexible and modular program construction. Go compiles quickly to machine code yet has the convenience of garbage collection and the power of run-time reflection. It’s a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language.

It has a kind of persnickety feel to it that I kind of like. It practically insists on formatting code in certain style–a style that I used to use,  but from which I have weaned myself away because I became convinced that a different way was better. In doing so, you can dispense with some programming punctuation, and it ends up having a bit of a flavor of Python or Ruby.

I’ve been working a bit on a library for bit sets–there isn’t one in the core library–and have found the community quite helpful. This, of course, is a good sign for a language. The code I’ve been working on, with lots of kibitzing from the veteran Go language people, can be found at https://github.com/willf/bitset. One thing I like is that, in addition to the core language information, the Go website includes an essay on writing Go effectively, and how to write code that might be considered for inclusion in the standard libraries. It even has a standard unit testing library.

Singing with

This weekend my good friend Samuel Sommers and I traveled south to sing shape note music. It’s Sam’s usual practice to go south on the first Sunday in May and the Saturday before to sing in Huntsville, Alabama on the Saturday and then in Dutton, Alabama for the Dedication Sunday at Shady Grove church, and he graciously invited me along.

The massive storms and numerous tornadoes that hit Alabama changed our plans. We received an email from David Ivey saying that the Huntsville singing was cancelled because people were being asked to cancel meetings and there was no electricity at the venue. I was disappointed not to sing with the Iveys, but it opened up the opportunity to sing at Harrod’s Creek Church in Brownsboro, Kentucky (just outside Louisville). This was first singing there to be held without Bob Meek, the singing’s founder, and it was held in his memory. It was good to be able to see people gathered to remember Bob and sing the music he loved and so deeply supported, and to fellowship with Pat Meek and the other singers who were feeling his loss. Sam and I stayed Saturday only; I understand from others that the memorial on Sunday was very moving.

We weren’t sure what we should do about Sunday. Eventually, though, we got through to Brad Bahler of Indiana, who, along with wife Karen and son John, had gone down to stay with Syble and Bill Adams. Syble insisted that we come, though the church was without electricity. Mark Brown, who leads music at Shady Grove, had pointed out that when the church was built, it didn’t have electricity, so they probably could get along without it. We arrived a little after 9:30 a.m. on Sunday, and, after greeting the Adamses and their families, helped set up–not many people had arrived, and so we assumed there wouldn’t be many come. Decoration Day is the day families gather to clean the gravestones, place flowers on the graves, and sing in memory of the beloved dead. While we waited for Mark to come in to start the singing, we sang a few songs, including Martin with the words by Charles Wesley:

Jesus, Lover of my soul,
Let me to Thy bosom fly,
While the nearer waters roll,
While the tempest still is high!
Hide me, Oh my Savior, hide,
Till the storm of life is past;
Safe into the haven guide;
Oh receive my soul at last.

It was a liminal, holy space, between death and life, between memory and news, between worry and comfort, between safety and loss, between capriciousness and care. Everyone had a story about the storm’s destruction. No one from the church died in the storms, for which all were so grateful. The home of the church’s pastor, Brother Ben, was destroyed, the family having huddled underneath an overturned couch as their home was torn apart around them. One of Syble’s daughters and her son were driving home, in separate cars, but together, when the daughter saw a funnel cloud in her rear-view mirror. Her son, a new driver, was ahead of her, and stopped at a red light, which he didn’t run, because he was afraid what his mother would think. She finally signaled to him to go, hoping to outrace the tornado. Fortunately, the funnel went up into the sky, and hopped over them, and they were saved. People testified to the goodness of neighbors and the providence of God. One man deeply felt a survivor’s guilt for coming through without damage.

The memorial singing was shorter than usual, just the morning, but deeply felt. The usual “dinner on the grounds” was minimal, by Southern standards, but more than amply adequate, featuring ham sandwiches and peanut butter cake (Syble found time to make a cake sometime between when the electricity went on at her house around ten p.m. the night before and the start of the singing). Most people did not stay, but went back to their homes and neighbors. About a dozen of us ate together, the Adamses kindly showing us their hospitality, but also, I believe, glad to have us there, both as a respite from the storm terrors, but also as a reminder of the love that many felt for them.