Red Echo

October 31, 2009

Hive Mind Halloween


I had no costume inspiration of my own this year, so I decided to join Alison’s crew of bumblebees. I wanted something I could comfortably dance in: thus, my concept was “disco bee”. I cut two yards each of black and yellow metallic stretch material into five-inch strips, then stitched them back together, alternating colors to make stripes. From this I cut out a pair of pants, making each leg from a single piece so I wouldn’t have to match the stripes along an outside seam. I fitted the legs, made the yoke and waistband, adjusted it to fit comfortably, stitched it all together – then discovered I had left no way to actually get into my own pants! Frustration!

Time for a dinner break, with Ava, over at Jeff and Nika’s place. Nika happened to have a spare zipper, so I used a sharpie to turn it black, then stitched it in: hey-ya, the pants are done. I made a pair of sleeves from the remaining fabric, attached front and back with strips of elastic. I finished off the look with an abstract set of wings, repeating the striped look with layers of black and yellow fringe, stitched along the underside of each sleeve and across the shoulders. Top it off with a pair of springy antennae, and I was ready to go – 11:15 PM is a splendid time to leave for a late-night party!

The bumblebee project came out really well; there were at least 30 of us, enough that people clearly understood there was something going on. Shawn and Barry came dressed as bee-keepers. Hive Mind always has a lot of really elaborate costumes, and I felt good to be wearing something unique and polished. The party was so crowded, in fact, that I spent the first hour just standing in the hallway talking to friends as they passed by! It wasn’t until 2 AM that the crowds had thinned enough that I felt like dancing. But, hey, it was time-change night, so we got an extra hour of party in and I rocked out until 5 AM. It was a good night.

October 27, 2009

I’ve started poking around at connecting Radian to LLVM. The current backend translates the flowgraph to a linear intermediate code, then translates the LIC instructions to C source code, then passes that through gcc to get machine code. I’m not sure whether to leave the LIC pass in place, then convert to LLVM instead of C source code, or to emit LLVM IR from Radian’s data flow graph. The significant semantic difference is that LLVM IR includes type information, which is implicit in LIC.

While I think about this, I’m playing around with using Church encoding for booleans. Instead of including a “boolean” data type with two predefined values which represent true and false, then implementing a “branch” operation which chooses between two values based on a boolean value, true and false themselves become the implementation of the branching operation. It’s as though they were defined like this:

function true(thenclause, elseclause) = thenclause
function false(thenclause, elseclause) = elseclause

If you have a reference to one of these functions, you can use the function itself to perform the branch: you just call the boolean value, passing in the option you want to use for “true” and the option you want to use for “false”, and it returns the one that matches the boolean’s value.

This wouldn’t be appropriate in every language, but in a functional language like Radian the only thing you can do with a boolean value is to select which of two expressions you want to use. It makes sense to do away with the custom “branch” instruction and just use function invocation.

October 23, 2009

I cleaned up my serger and re-threaded it the other day, then spent a couple of hours making up a long-sleeved T-shirt. The collar came out wrong, again, as it has each time I’ve tried to make a crew-neck with knit fabric. The fabric always stretches out and the collar ends up enormous and floppy. I don’t get it. I can make all kinds of other collars but the crew-neck eludes me. It was good serger practice, though. Re-threading the machine takes all of two minutes now, and I am starting to understand how the tension controls work.

Radian, of course, is my other big free time project. I have a simple Hello World running now, and that means it is probably time to abandon my temporary C-source-code backend and start using LLVM. I’ve finished as much of the front-end language support as I’ll need for now, and it’s probably time to shift my focus toward the runtime environment. I need to build an IO interface, a garbage collector, and the core function library; using C as an intermediate step is just a hindrance here.

October 21, 2009

You can publish a Git repository on any old web server, without needing a special git daemon, using a command called ‘git-update-server-info’. This would be useful if you wanted to publish some code but lacked the ability to offer any old user an ssh login, perhaps because you are using a hosting service instead of running your own server. Here are a couple of how-to guides:
git-server for the poor: git-update-server-info, rsync, and remote repository
How to publish a Git repository
SourceForge FAQ for Git development

It is also possible to create a patch file with git which you can send via email. I am thinking about setting up an auto-build-verify system that checks a dedicated email inbox, downloads patch files, builds them on a temporary branch, runs a validation suite, and either pushes the changes up to another repository or sends back an email describing the errors that occurred.

We were working toward a system like that just before I left Real Software, using Buildbot. It was a big improvement over the ad-hoc practices we’d always used before, but it was still a reactive notifier rather than an active filter. You checked in code first, then the buildbot would run its tests to see whether you broke anything. It was much better than hearing about it from one’s irritated colleagues a day or two later, but still too fragile.

It was much harder to break the build at Microsoft, where no change could be committed until it included a new test suite and had been shown to pass every existing test. This was unfortunately a completely manual process and thus extremely time-consuming, but it did create an unusual degree of confidence in the checkins, when they finally did happen.

Grunt work is a waste of human time: that’s what robots are for. I want to send my code off to the build system whenever I think it’s ready, let it do the repetitive validation, and then either pass the code on to the development trunk or let me know what went wrong. If I screw up, I’ll have a chance to fix it before I waste anyone else’s time dealing with the problem, and I’ll know that code I pull from the trunk will always work as far as the test suite is concerned.

Home pages for some interesting programming languages:

Python: python.org
Perl: perl.org (does not appear to be an official home page, but this is close)
Ruby: ruby-lang.org
Scala: scala-lang.org
Clojure: clojure.org
Factor: factorcode.org
Haskell: haskell.org
Erlang: erlang.org
OCaml: caml.inria.fr

October 19, 2009

I finished the jacket on Saturday, in time to wear it out to Sara’s cocktail party. I just now had Ava snap a few photos of me wearing it so I could post one here, but for some reason I came out looking like I was in a really terrible mood, so I’ll have to get some more taken later. I’m fairly well contented with the results: it’s imperfect, of course, but I learned some things while making it that will undoubtedly serve me well in future projects, and I ended up with a garment that will easily accomplish its intended purpose.

October 18, 2009

New shelves: tidy sewing table


October 15, 2009

early autumn


October 14, 2009

That cold pretty much wiped me out all last week. I’m feeling fine now.

I haven’t finished the jacket yet. The pockets came out perfectly, but I made some pretty significant mistakes when laying out the lining and had to get some more material. I also decided to tear out the old collar and make a new one, and to take advantage of the pocket construction to fit some extra material into the hip seams. This took a lot of extra time but the jacket looks a lot better and fits more comfortably, so I think it was worthwhile. The jacket started as a sort of casual experiment but has become something I could wear regularly.

My new job is going fine. The company’s in crunch mode and everything is a bit chaotic, but I’m working away and not letting myself get too stressed out. It’s nice working at home again.

I’ve been putting a lot of my free time into Radian lately. I’ve built a simple object system, with member dispatch, inheritance, instance variables, and parameterized constructors. There are no mutator methods yet (all methods are “const”, in C++ terms), but it should be enough to build a primitive console-IO module. I expect I will have a working “Hello world” by the end of the month.

October 4, 2009

I came down with a cold Friday night, so I’ve been taking it easy this weekend. I mostly stayed in bed yesterday, though I did rouse myself for a few hours to play the opening set upstairs at Jason Baker’s party. I kept the tempo in line with my energy level – about 75-80 bpm – which seemed to work well for the upstairs room’s “sprawl out and relax” appeal. I didn’t last long after the set was over, though, and crawled into bed shortly after midnight.

Today I’ve been casually poking along at my current sewing project, the black & tan jacket. I’ve fussed around with some scrap denim making welt pockets for practice, and after I’ve brewed another cup of tea I’ll see about applying the technique. Perhaps after that’s done I’ll work on the lining.

The jacket has some fit issues: it’s narrower around the hips than I’d intended, the shoulders are a little tight, and the collar didn’t come out the way I’d planned. It’s a little disappointing, I’ll admit, but the goal of this project was more to get myself back in the practice of sewing than to construct a specific garment, and I’ve certainly learned some things in the process. Perhaps I’ll work out some way to adjust the fit, too.

October 1, 2009

The new jacket is coming along well. I have been making it up as I go rather than using a pattern, and though it looks somewhat more severe than I’d intended, it’s pretty much coming out according to plan: a hip-length, four-button jacket with a banded collar and a single vent, done in heavy canvas, black with tan details. It’ll be lined, and I’m planning a pair of welt pockets with flaps. I haven’t decided what to do with the cuffs yet – perhaps turned-back with contrasting fabric, perhaps a strap…

Depression as an adaptive trait

This Scientific American article suggests that depression is less a mental disorder than an adaptation for deep analytical thinking:

This analytical style of thought, of course, can be very productive. Each component is not as difficult, so the problem becomes more tractable. Indeed, when you are faced with a difficult problem, such as a math problem, feeling depressed is often a useful response that may help you analyze and solve it. For instance, in some of our research, we have found evidence that people who get more depressed while they are working on complex problems in an intelligence test tend to score higher on the test.