Fun with Flemish

Posted on 2008-07-05 by Luke Palmer.
Categories: General.

I am having such a good time out here in Antwerp, I decided to stay another week. Actually this decision was not so much related to the city as to the project, but the city ain’t bad either.

Anygma moved me from the bed & breakfast I was staying at last week to an apartment they had rented for some of our art director’s students. The students haven’t arrived yet (I kind of want them to have, since it’s a bit lonely/boring). As I complained last time, I haven’t had a way to plug in my laptop, so my computer use has been constrained to work. Today I thought I would go into town and get a power converter.

Almost everybody here can speak English, but where’s the fun in that? I figure I will learn more Flemish if I don’t have something to fall back on. So as I was going into town I resolved not to talk to anybody in English. Navigating the tram system to get downtown was pretty easy—all the trains are numbered and color-coded.

Downtown was a huge, wide street with shops on either side and thousands of people walking around. It looked like a carnival. That illusion was amplified by waffle and ice cream stands on the street corners (I got a waffle covered with chocolate ice cream and fudge sauce—delicious!). However, other than the high density of people, it was all quite familiar. I found a large electronics store and grabbed the adapter, and went to stand in line to buy it. A woman who worked there babbled something in Flemish to me and pointed to another line. I knew she was saying that this one was about to close or something and I should wait in the other one.

It’s pretty interesting how much I can comprehend without understanding a word of Flemish. Communication is much more than words.

After I bought the converter, I got lost in town. I knew I was going to Groenplaats, so I asked a woman on the street, “Groenplaats?” and pointed my fingers back and forth, and she pointed me in the right direction. I walked a bit that way and didn’t find it, and that’s when my plan was foiled! I did the same thing to a guy tending a shop, and he gave me directions in Flemish. To the blank stare on my face he responded “do you speak English?”. I shook my head confusedly. “Well what do you speak normally?” Daft! He got me! In my embarrassment I responded “I speak English but I’m trying not to!” He gave me English directions… darn.

And now I am safely back at the apartment, using my computer (hooray!), able to call people with Skype (hooray!).

It’s still fun being out here. A bit tiring, but great fun. The Anygma project is amazingly cool, Conal Elliott has opened my eyes to a new approach to software design (well, maybe not totally new, but he pushed me into the pool that I was dipping my toes into). The rest of the team is smart, competent, and open-minded, and great fun to work with. The food is absolutely delicious, the strangers are kind and helpful, there are many beautiful women to look at. My adolescent reservations about moving out here are now shadowed by my excitement for this place.

Apparently I do not want to be in Antwerp

Posted on 2008-07-01 by Luke Palmer.
Categories: General.

Because VISA is not here! It was a bit distressing coming here with only 15€ in my pocket and finding out that people don’t take credit cards the way everybody does in the USA. Anyway, there was a bank that understood my card and could give me cash.

This is my first time out of the USA (barring Canada), so I’m enjoying observing the differences. Although there are some interesting points, it’s more similar than I expected.

  • The outlets are those weird european ones, so I can’t plug in my computer (without ganking an adapter from a coworker). I was going to go to a store and buy one, but
  • Stores close at or around 17:00! How am I supposed to satisfy my electronics craving after dinner?
  • People write times in 24-hour format, there’s no AM/PM.
  • There is a different meme at stoplights on foot. In the USA, each person or group of people presses the button. Here, it seems that people only press the button if there’s nobody already waiting. That is, they trust people to have already pushed it… which makes sense.
  • I always like trying new weird food. This is made easier when one cannot read the menus.
  • “Met” means “with” in Dutch. Other words have other meanings.
  • A glass of water costs 1.50€ at restaurants. That could be related to the fact that tap water in this country is not what I would consider drinkable.

It’s actually not that hard to get around not being able to read anything. It’s fun being here.

New Job

Posted on 2008-06-18 by Luke Palmer.
Categories: General.

So I am now officially working for Anygma. It’s a very… interesting situation.

So far, the team has been great to work with. It’s always nice communicating with smart people who “get” software and don’t have any strange overarhicitectural fantasies. Well, I guess we have yet to find that out, but so far so good.

The project is really interesting, too! I wish I could talk more about it.

Typically I’m starting work around 1AM (which is 9AM in Belgium). Today was the first day I got a “decent work day” in, going until 8ish. The environment is nice; sitting here in my comfy chair or couch with a blanket and a kitty on my lap, discussing linguistic (as opposed to formal) aspects of programming languages!

I’m using FogBugz to track my time and tasks. It’s working well, nice and lightweight.

Freewrite no. 25

Posted on 2008-06-09 by Luke Palmer.
Categories: Compositions, Music.

Long before I started this blog, I decided to adapt the idea of a writer’s freewrites to music. The exact definition has mutated over the years, but nowadays I define a freewrite as a piece which I compose in one sitting, generally (but not rigidly) avoiding backtracking. That makes it a sort of compositional improvisation.

Yesterday I took two hours to do a freewrite using two of Karen’s instruments: oboe and marimba (instruments I definitely did not focus on in the past). It’s a two minute, four piece ensemble for oboe, marimba, violin, and cello.

Freewrite no. 25: (mp3 / pdf)

Opus 3: Symphonic Serenade

Posted on by Luke Palmer.
Categories: Compositions, Music.

Two weeks ago I completed my symphonic serenade, which I now dub opus 3. In previous posts I referred to the second movement as symphonic poem no. 1, and the third movement as symphonic poem no. 2. I wrote a third and crammed the three of them into a logical movement structure, where they form a somewhat coherent piece.

In total, this serenade took me about 90 hours over six weeks. It forms my largest, most complex piece to date, and although parts of it are somewhat juvenile and the scores are messy, I am quite proud of it. Its runtime is 22 minutes. It is also listed on my music page.

  1. Molto allegro (mp3 / pdf)
  2. Adagio (mp3 / pdf)
  3. Allegro, Andante (mp3 / pdf)

Education (two senses)

Posted on 2008-06-08 by Luke Palmer.
Categories: Personal.

Woo! This is post #500!

Recently I had the realization that I don’t want to be a professional programmer. I just made a commitment to program professionally for a while in Belgium, in Haskell, doing FRP (yeah, pretty freaking awesome!), and I’m not about to bail on that. But after that job has run its course, I suspect I won’t be wanting another one.

It’s not because I don’t like programming anymore. Programming is still a wonderful way to keep my mind agile, and I like it very much. Creating or learning a new abstraction requires head-breaking leaps, it’s exciting to master a new concept, and I still feel passionately about the future of programming languages (particularly the completely yet-unrealized potential of dependent types). But such are the pursuits of an academic, not a professional.

When I started college, I wanted to be a professor. It didn’t take long to realize that my work ethic was not insane enough to be a professor. Nevertheless, every semester since my sophomore year I was a TA. I skipped around teaching physics, calculus, and computer science. I was good at it and I loved doing it. It was a delightful sanctuary from the stress of studenthood.

After the fall semester of 2006, I became fed up with school’s bullshit (in fact, an elective voice class of all things was the one to push me over the edge—it’s a long story) and intended to take a year-long hiatus from school to work at NetDevil, a local game studio. That I did, quitting the job seven months later due to the ridiculous “crunch time” (read: mandatory unpaid overtime) policies.

And here we are, mid 2008 and I have not resumed school, and the next year does not expect my return.

It’s unclear what happens next. Maybe I spend a year in Belgium as a programmer, maybe longer. But after that, I don’t know. However, teaching looks to be in my future. And looking back on all my teaching experience in college, there is one thing that will always stand out: physics.

Physics is miraculous to teach. The subject’s depth and beauty has made a zealous atheist like me reconsider God’s nonexistence (converting me, if you will, into an agnostic :-). There is nothing more pleasing than being in the presence of a student who asks question after question as he begins to behold the mathematical masterpiece (except perhaps seeing more of the masterpiece yourself, which students have helped me to do!). I witnessed this with two or three students each semester.

Students come into physics often with a truckload of preconceptions about how the world works. This differs from mathematics and computer science, where the most prominent preconception is that they will not understand (a difficult one to work with). Physics also differs from those two subjects in that the tools to disprove themselves are placed right under the students’ noses. I have experienced the moving, haunting situation where I predicted the outcome of a physical situation and then observed it go down completely unlike I expected. To help a student with a misconception, you don’t tell them they’re wrong, you help them devise an experiment to disprove themselves.

Talking about it excites me, it makes me remember and long for that experience. I can see myself, even with my restless, wandering soul, doing that for the rest of my life. But there is a brief international diversion to explore first, it seems.

Last Comic Standing

Posted on 2008-06-06 by Luke Palmer.
Categories: General.

I have a love/hate relationship with stand-up comedy. Most comics are mediocre, with one or two jokes in a half hour set that make me roll on the floor, where the rest mostly bore me. The only counterexamples I can think of right now are Demetri Martin and the late Mitch Hedberg, who hit me with 80 or 90 percent of their material.

On the other hand, I can’t stand Chris Rock and those like him (George Carlin somewhat included in this category), who ostentatiously vomit political and ethical opinions which sound like they’re edgy but everyone agrees with. I didn’t go to a comedy show to hear a liberal sermon (I, too, agree with most of said opinions).

Anyway, where I’m going with this: I just watched Last Comic Standing on Hulu. I was thoroughly impressed: about 80% of the jokes made me laugh out loud (possibly to the extent of waking up my roommate). However, I completely disliked the presentation. It was presented like American Idol: they showed bad comics telling bad jokes and getting rejected by the judges, they showed the good comics boringly telling the camera about themselves (but two of them were quite hillarious in this process), they even did the “who will go on to the next round” needlessly long dramatic pauses with nary a single amusing moment.

I’m watching a comedy show, I don’t want to get to know the comics as people and cheer when they are selected and feel bad for them when they are rejected. It’s a comedy show, I want to laugh my ass off!

So: skip the two semi-final nomination segments, there is nothing good there. The rest has spatterings of pretty funny stuff, and the two live show segments are hillarious. And NBC, stop with the mindless filler!

Flow

Posted on 2008-06-03 by Luke Palmer.
Categories: Personal.

Flow is my cat. She’s more like a person to me today than ever before.

Originally Flow belonged to Namaste, and now that he has moved away it’s unclear who the owner is. It’s almost like she belongs to this house.

I had my music program open on my computer and was about to start writing a song when Flow walked onto the couch next to me. She put her paws on my lap and lay down. Normally I would have pet her a few times and continued working.

I’ve been thinking a lot about a particular girl recently. Today I fantasized, what if that girl had sat down close next to me and rest her head on my shoulder? I wouldn’t simply hug her and go back to working; she just asked me for some affection!

So instead of seeing “that’s a cat”, I interpreted Flow’s actions as I would a human’s. I closed my computer and sat next to her, petting her softly and listening to her purr. I felt close to her, like she was my friend and she understood me. At the least, I understood her.

OO is not the One True Paradigm, but Haskell still sucks at it

Posted on 2008-05-29 by Luke Palmer.
Categories: Code, Haskell, Perl.

I just read osfameron’s Readable Perl talk. It’s a pretty typical language advocation talk, nothing special, but it reminded me of Perl. Those who have not been reading my blog since 2005 may not know that I used to be a Perl nut. I was even on the Perl 6 design team, attended several design mettings with Larry Wall (and a couple other notable geniuses), had the Perl 6 syntax memorized, …. Quite insane I was.

I have been pondering recently about the cognitive mismatch between OO and functional approaches. The two have been fused in languages, see O’Caml, but I argue that code in such a fused language will mostly end up looking like one or the other, not a beautiful balance as we would like.

My thesis is that the two support different models of the universe. The functional approach supports a “mathematical” view, where we know a lot about the structure of our data; the object approach supports an “empirical” view, where we know a lot about the data itself. Let’s use something I was playing with today as an example: the SK calculus.

The obvious functional approach is to define a data type representing the cases of the AST:

data AST = S | K | AST :@ AST

(The :@ is the name of an infix constructor; i.e. it is just a node with two subtrees)

Then to implement a function that, say, reduces the top level of a tree, we can analyze the data by pattern matching:

reduce (S :@ x :@ y :@ z) = Just $ x :@ z :@ (y :@ z)
reduce (K :@ x :@ y)      = Just $ x
reduce _                  = Nothing

Here we know a lot about what kind of argument reduce will get. Whatever it gets, we know that it will be either an S, a K, or an application. We then define what it means to reduce data of this form.

Now I could half-bake a standard OO retort showing how much incredibly better functional programming is by how awkward this would be in a typical OO language (and it would be). But that’s trying to apply the functional world-view, that we know a lot about the structure of our data, to an OO setting. I think a good OO design for this same problem would take quite a different form. I see it something like this:

interface Combinator {
    int arguments();
    AST apply(AST[] args);
}
class S implements Combinator {
    override int arguments() { return 3; }
    override AST apply(AST[] args) {
        return new Apply(new Apply(args[0], args[2]), new Apply(args[1], args[2]);
    }
}
class K implements Combinator {
    override int arguments() { return 2; }
    override AST apply(AST[] args) {
        return args[0];
    }
}
...

While I gave a working Haskell program above in four lines, my “good” OO solution (in whatever language this is… looks like C#) has much more than that and is not even complete. I have left out the definition of Apply and the function which actually does the reduction. But I’m not bashing OO here (but please do understand if I bash OO syntax, which as the years go by seems to get more and more verbose). Instead it’s just that this problem is very well-suited to functional programming.

But this program has very different properties from the Haskell version. In particular, it is easy to add a new combinator, a new object, that does something different. Whereas in the Haskell program, adding a new primitive combinator would change the assumptions of every function that worked with combinators. Conversely, adding data manipulation functions which depend on particulars, namely whether something is an S or a K (or whatever else), involves touching every object to add that method. Whereas in Haskell, we can just add a new function. Astute readers will recognize this as the famous “expression problem”.

This trade-off starts to affect the way we proceed. If we were to implement identical functionality in the two programs, our approaches will diverge greatly. For example, today I added a function to invert an application. In Haskell, I just enumerated by cases: this is how you invert an S-reduction, this is how you invert a K-reduction, etc.

In the OO program I wouldn’t add a visitor though, that would be stupid. Instead I would create a new node type for variables, apply the transformation to a number of variables equal to the number of expected arguments, and analyze the positions of the variables in the result. I would end up with a function that can invert any combinator. That is, the natural next step in the OO example is to write more generic code than in the functional example.

Anyway, there’s what I consider a nice side-by-side comparison of the two approaches. Maybe by analyzing these two examples and where they led, you can start to see what I’m saying about the two cognitive models.

And this brings me back to Perl. The slides I read mentioned Moose, an object model module for Perl. It is rich: supports inheritance, role composition, privacy, coersion, and many other tools. I think an OO system needs to have these tools: the OO world view counts on data having many facets, capabilities, constituents, and concerns itself with what is possible when you know about certain ones. An OO programmer must be an expert at creating data with many facets, capabilities, and constituents. This is contrasted to functional programming where everything is known about the data, and the focus is on manipulating it.

Haskell has no support for these tools. Its type system, although powerful, is too static. Haskell provides too many guarantees for OO to work; it wants to know too much about what’s going on. Similarly I don’t consider C++, Java, C# to be “powerful” OO languages. In fact, I might go so far as to say a language with static types and OO is not properly embracing the philosophy. You’re creating rich, smart data. If your superclass guaranteed that a particular method was const, i.e. does not change the object it was called on, how are you supposed to smartly cache the results of that function? Well, with the mutable hack. But that’s a hack, essentially telling the type system that it should go take a hike because you know what you’re doing.

Perl and Smalltalk “get it”, in my opinion. They have simple models, but provide tools for looking inside and changing data on the fly. They are about creating and manipulating smart data, leaving the guarantees up to the naming of the methods and their intended use, because trying to force guarantees would restrict their ability to be smart. If you want guarantees, use Haskell; it will almost prove your code is correct for you. But Haskell has no smart data, that’s the only way it can provide guarantees. You can’t have case analysis of data structures and objects that can reverse-engineer your function at the same time.

That’s it: when you’re in OO, don’t design functionally. Keep your guarantees wide open, and focus on making smart objects.

The Moment last Monday

Posted on 2008-05-28 by Luke Palmer.
Categories: Music, The Moment.

Last Monday, “The Moment” (def: Nolan and whoever else) had a jam session at my house. I got my whole rig out, indicating this was a special occasion (first jam in more than a month).

  • 1 - Great funky track. It’s rough going now and then, but has some incredible passages, and is definitely listenable on the whole.
  • 2
  • 3
  • 4
  • 5
  • 6 - High energy rock/funk.
  • 7 - My favorite of the session. A trance track with nice vocals.
  • 8 - My “Charlie Hunter” moment (okay, that is an overstatement), playing a complex solo and bass at the same time :-)
  • 9
  • 10

The lineup:

  • Nolan McFadden - guitar, vocal
  • Willow - vocal, percussion
  • Will - drums
  • Luke - keyboard/bass

As the lineup implies, my left hand was on “bass” throughout the session. This was the first time I’ve had to cover the bass part, and I thoroughly enjoyed it (and it overloaded me, indication that I improved greatly that night).