Archive for October, 2007

Oct 13 2007

What goes in my repository?

Published by matt under Uncategorized

Pussywillow1
Pussy willows; from here.

When my younger brother was… younger, he once stuck a pussy willow bud up his nose. I mean, he didn’t just sorta stick the thing in his nose… he crammed it up deep somewhere in his nasal cavity. I’m surprised he didn’t loose the finger to the finger-biting monster that Shel Silverstein claims lives up there.

Inside everybody’s nose
There lives a sharp-toothed snail.
So if you stick your finger in,
He may bite off your nail.
Stick it farther up inside,
And he may bite your ring off.
Stick it all the way, and he
May bite the whole darn thing off.
(Shel Silverstein, Where the Sidewalk Ends)

Alas, no such biting happened. I do remember him screaming like the end was coming, however, when four adults held him down (one to each arm, one to his legs, and one to his head) while someone gingerly reached up and extracted the pussy willow with a pair of tweezers.

I figure he was around three years old. I would have been seven.

Good times, good times…

Of Pussy willows and Subversion

You see, this comes to mind because my students are using Subversion repositories for all of their coursework. They check things in, I check them out, and comment on their work. I then do a checkin, and they can read my comments right in their code. There’s no complex web-based system, no complex emailing of documents back-and-forth. It works reasonably well, I think.

Now, what should go in a repository? This is a reasonably tricky question.

  1. Code. When you’re working on programs, the source code goes in the repository.
  2. Documentation. Documentation (preferably written in plain text or LaTeX) should be in the repository. If you’re keen on using closed, proprietary tools, then Word Documents might end up in the repository.
  3. Required blobs. A “blob” is a binary document. JPEG images are binary. PDFs are binary in nature. It is a “required” blob if something else needs it to be generated (like a LaTeX document that has an image in it; the PNG or JPEG should be included in the repos).

That’s about it. That still isn’t very specific, so I’ll itemize one or two things that might not go in the repository, and why.

  1. PDFs. Generally, PDFs do not belong in the repository. That is, if you found an article that both you and your colleague are collaborating on, the repository is not where the PDF belongs. Why? Because the PDF is never going to change. You should just use a networked drive for this kind of “static” or “unchanging” data.
  2. Executables. Programs that you need as part of the process of building or manipulating your software should not, generally speaking, be part of the repository. If you have an EXE that, say, processes one of your files… it should also be in a shared drive. While it might be necessary, it (like the PDFs) will never change. Therefore, you should put it on a shared drive, and let people copy it from there.
  3. (By-)Products of a build process. Many programming environments generate many temporary files while building a piece of software. These temporary files that are generated in-between your source and executing on hardware should not be part of the repository. Only the source documents (the C files, and any project configuration files that are part of the IDE) should be in the repos. Temporary log files generated by the compiler should not be in the repos.

In short, only the files that you edit go in the repository. Any files that a program generates should not be in the repository.

Why?

Because your repository grows every time a file changes. If you store big, binary files (like executables produced by a compiler) in your repository, then every time you compile your program, the repos thinks a critical file has changed. In truth, we only want the source code to be tracked… not the output from the compiler. We especially don’t want the log files from the compiler checked in. We simply don’t care how those change from one commit to another, and our colleagues generally don’t care, either.

Now, like all things, there are times when these rules might be violated. For example, I asked my students to put a PDF of their report in the repository. This is because I didn’t want to deal with Microsoft Word documents. I’ll mark things directly into a copy of the PDFs. That is preferable, given the workflow that we’re dealing with, and the fact that some students are using Word, and some are using LaTeX. (I should just require TeX.) So, that “rule” about “no PDFs” was violated for a very specific reason. Likewise, I put PDFs in the class repository so they can easily read and print the documentation on whatever machine they are sitting at… not because it is the “right” thing to do.

So, what goes in your repository? Probably not pussy willow buds.

No responses yet

Oct 13 2007

Compilers: Some reflection

Published by matt under Uncategorized

Some time ago (but only a few posts ago), I ranted about the state of embedded systems development under Linux. If we break the rant down, it basically read like this:

How come I don’t have carrier-grade compilers for every single chip under the sun for free? This is ridiculous!

The truth is, these tools have a cost. GCC is a great resource, but the number of platforms that can be realistically supported through gratis development is actually, quite likely, small. One way that it could be done is if every hardware manufacturer employed one or more GCC developers to maintain back-ends for their CPUs. Perhaps some manufacturers do just that.

However, they’d also have to maintain drivers for the programmers that connect to their chips, and make sure that you could debug the hardware from GDB on Windows, Mac, and Linux—which is a non-trivial amount of work. So, now you’re maintaining a toolchain that goes from the compiler, to the linker, to the driver for the programmer… and there’s probably a standard library to maintain as well.

What I’m starting to see (from being in an engineering school) is that people don’t always have the mentality that they can build things themselves… when it comes to software. Because I wrote a linker for a weird little instruction set, and helped write a bytecode interpreter for that instruction set, II have a different perspective regarding the authoring of software than, say, your typical mechanical engineer. I have no real way to compare, but I suspect I sit down and think about the design and implementation of compilers or distributed systems in much the same way they think about… drivetrains and … moving… things. Or something.

I’ve been wrestling with getting the Transterpreter compiled for a particular MSP430 part. You see, there are a number of parts in the MSP430 family that GCC supports very well—and we have compiled and executed occam-pi programs on those CPUs just fine. But the development board I purchased for $120 has a CPU that is… less-well supported. As in, I need to build a patched version of binutils to get things working. I spent the better part of six hours last weekend debugging what was going wrong and attempting to get things running, and finally realized that my time was worth more than the cost of a tool.

Rowley Associates produce the Crossworks line of compilers for a number of embedded processors, including the MSP430 family of devices. Lets look at their prices:

Version Cost
Commercial $1495
Educational $299
Personal $149

Right now, I’m too busy to chase after broken builds of binutils. Six hours of my time, valued at $25/hour, is the cost of a compiler that handles the CPU I’m trying to build for, as well as many others. And not only that, but the IDE and tools will work on Windows and Linux… and soon my Mac.

In other words, I get the IDE on Windows, Mac, and Linux for $149. My problems of getting my software to compile on the MSP430FG4619 simply go away. Does this help the next person who comes along and wants to run the Transterpreter on this chip? No. However, they’ll have the same options I currently have:

  1. Get the GCC-based tools to work
  2. Buy the compiler

If I had infinite time, I would get the GCC toolchain working. But I don’t. I just want the devboard to work, so I can test and demo our VM on a small platform. And because other projects I’m involved in leverage the MSP430, the compiler won’t hurt there, either.

So, as soon as I get another hour or two free, I’m buying the Crossworks tools. I’m no longer a grad student with infinite time—and this is a battle I can afford to win with cash.

Comments Off

Oct 10 2007

students are for pushing

Published by matt under Uncategorized

So, after class, I discussed student projects with a few groups for almost roughly an hour, and then went running. Because Rachel (one of my students) said she was going, I thought “I should do that, too.” What with the new shoes and all, I thought I should use them.

So, I managed to jog out from campus towards town keeping pace with Rachel, but then needed to walk for a bit. She ran a fairly fast pace on the way out. (Read: way too fast for me at this stage!)

20071010-Jogging-Route1

The first part of the run

She took off at 100m pace at that point, and soon had made the turn around in the town center and caught back up. I took off jogging again, and decided I could clear the campus gates, but probably not make it all the way back up the “hill” to campus.

20071010-Jogging-Route2
The run back

It was 1.5 miles out and 1.25 miles back (according to Google), so that’s almost three miles of running. I feel reasonably good now, which I take as a good sign. It was a touch too much for the second time out in too long, but it could have been much worse. Mostly, that’s because I kept telling Rachel to slow down the whole way back…

Students are for pushing. Perhaps, sometimes, to get us out and off our bum.

(And I should probably get some reflective bits if I’m going to go jogging in the dark.)

2 responses so far

Oct 07 2007

Good Shoes

Published by matt under Uncategorized

For the last few months, I’ve been avoiding jogging. This is not because I don’t enjoy it—instead, it was because of evil shoes.

M9160 220
Chuck Taylor All Stars: Evil Shoes

These cheap canvas high-tops had bad support for walking and, as far as I could tell, put pressure on the base of my Achilles tendon, causing it to rub. After a 2-3 weeks of regular wear, I realized that my feet hurt. This was bad.

I switched shoes as best I could, but the budget was tight as we were leaving England. So, I made do with whatever crap I could put on my feet—this wasn’t usually ideal. And, I had to stop jogging, because that hurt, too.

Fast forward several months. I got some new daily-wear shoes, and have been trying to monitor my Achilles, occasionally icing it when I thought it was warranted. Most days, I walk in and out of Olin, which is a 2-mile walk each way. So, I’ve been getting around 4 miles of walking per day, and things have been feeling good.

Now, I’ve been meaning to get out and get some new running shoes for a while. And Friday, two students went running by, which kinda reminded me that I needed to get off my duff and get some shoes. So I asked Alison where to go for shoes; she said: Marathon Sports in Wellesley.

Now, why did I ask Alison? Because, like Christina, both are running the Portland (Maine) marathon today. Christina is running the full, and Alison is out to run the half-marathon slowly. (I haven’t figured out the technical reasons for this yet, but I’m sure she’ll explain it to me again.) Back to the point: I went to Marathon Sports, and exactly what I wanted to happen, did.

At Marathon Sports, a very helpful staff member (Jessica) watched my stride and gait, and she recommended shoes based on the way I actually walked. It turns out my feet are slightly crenelated (or something like that), and so I need more instep support than some others. Jessica recommended a number of shoes which I tried on, each time taking them outside to jog around a bit, and found what I felt were the most comfortable of the bunch I was offered.

A973884C7D4230A770642A1Aa3F78F2B
The Brooks Trance 7

I ended up purchasing the Brooks Trance 7. This is, I will say, the first time I went out to simply buy the right shoe for my feet, and not the cheapest thing I could go jogging in. The shoe just felt right. I described the sensation as “running beach sand that is somewhere between wet and dry, at the edge of the wave-line… it’s soft, and gives just the perfect amount.”

Jessica said that was probably the shoe for me, then.

So, today I took my new shoes out for a run.

20071008-Jogging-Route.Pdf

Sunday’s Run (1.3 miles; entire loop, 2 miles)

I didn’t run as far today as Alison and Christina are going to run. It scares me to think they are running 13x or 26x times further than I did. However, I took a slow pace, and just wanted to jog until I felt I had jogged far enough. There were some small inclines on the run, which were just enough to remind me how truly out-of-shape I am. BUT! I was out exercising, and it felt good. Maybe, in a few months, I’ll be able to go jogging with Alison or Christina, and keep up for a while. On a short run. Like 5k or something.

I walked home from there, stretched, and will now clean myself up a bit and have some lunch.

It felt good.

6 responses so far