Tuesday, September 19, 2006

Ich bin ein Berliner

Ich bin ein Berliner - which, for those of you who don't know, is German for I'm a complete moron.

I've spent the last twoFridays trying to get Scheme installed on my AMD-64 Linux computer. Due in no small part to message board posts like this one - I bought in to the assumption that there simply wasn't much out there for Scheme on 64-bit Linux. And indeed, each time I tried to build an installation, I would get segmentation fault errors.

Well, today after Friedman's class I was walking with Giancarlo to Ballantine, where he teaches Intro to PowerPoint (aka let's trick lots of freshmen into giving the CS Department $$$ for something they could figure out for themselves in 15min.) or something similar - and this came up in conversation. He said that was just bad programming, that there shouldn't really be any difference. And then it occurred to me that I hadn't actually tried to install Petite Chez Scheme on my computer just because all the packages are labeled "intel Linux." I assumed it wouldn't work. So today I gave it a try and guess what?


Approximately 5 seconds for the download, even less than that for the RPM install. I tested it on last week's homework (which seemed like a good idea because it makes use of some fairly involved code) and it spit out the right answer in milliseconds.

I feel like a complete fool. All that time, and the bugger actually worked. I guess when they say it's for "Intel Linux" what they really mean is that it's not actually specifically for "Intel Linux." Who knew? Maybe "Intel" means something besides "Intel."

The key seems to be this: DON'T BUILD FROM SOURCE!!! In a few minutes I'm going to try with DrScheme too - because I remember (again) that I built from source rather than just using the precompiled package. Apparently, the precompiled package is set to go on a number of platforms, so that's the "big workaround." When you build from source, the compiler has a chance to notice that the package isn't "compatible" in the strictest sense of the term, hence the segmentation fault errors. This is, of course, just a theory. I'm not really gonna go test it (by now uninstalling Petite and then reinstalling it from source) because I'm happy enough with things just working. (I guess I'll get my answer, though, when I try again with DrScheme, which I did try to install from source earlier.)

This being Linux, though, there's naturally another headache - which is that I can't get the Scheme Widget Library to install. It seems to think it needs Tcl/Tk 3.8 - but I know for a fact that it should work on newer versions of Tcl/Tk (which I have installed already I know - because I not only updated it today, but also installed it several months ago so that I could do GUI programming in Perl) - because the TA for Friedman's class says so. Although - I guess he could be grossly misinformed. He gave the lecture today instead of Freidman, and it was easily the worst lecture presentation I've ever seen in my life. I mean, generally when you say that what you mean is that the lecturer was unprepared. But this was even worse than that becuase Gilead actually WAS prepared, just in all the wrong ways. He had all the relevant code written, but rather than having it in the Scheme interpreter ready to go, he had it in something else that wasn't easy to cut-and-paste from (it looked like Latex, actually!!!) - so he spent most of the time typing in the program he had already prepared, and then having it not work because he either hadn't tested it before class or hadn't typed something right or...well, you get the picture. Rather than a class we had a debugging session. So I don't even know how to rate that. I mean, where on the scale of dumbass things to do does bothering to prepare, but preparing wrong fall?

It actually ended up being helpful though - I'm being too hard on him. Something about his speaking style made it all OK (which wasn't the case with Bob Port's horrendous CogX presentation last year - to which he arrived 20min. late and without his slides) - and he somehow managed, in all the chaos, to slip in pretty much everything we need to know for the next homework assignment (which is ueber-cool, by the way! Blog post on that likely tomorrow...). Maybe "surreal" is a better word for it than "crappy."

But whatever the status of his lecture, it says on the webpage - which he got directly from the Chez Scheme people - and remember, the top dog (R. Kent Dybvig) is at IU, so Gilead knows him personally - that Chez runs on versions of Tcl/Tk that are 3.8 OR HIGHER. So I don't know why this isn't working - but I'm sort of afraid to install 3.8 now for fear of breaking my GUIs in Perl. Although, if ir really comes to choosing between doing GUI programming in Scheme and GUI programming in Perl, Scheme obviously wins. (I don't really like Perl - for no good reason. There's nothing wrong with it particularly, it just annoys me.)

Alright, well - I feel like a class A idiot now. But then again, I'm happy to have a working version of COOL Scheme (and not loser Scheme like this Gauche stuff I got last week). Petite Chez is one of the standards, so I'm in.

Now to see if I can get DrScheme going. If I can, I at least have a GUI library in Scheme (though not, admittedly, really the one I wanted).

[Update - It turns out that the Scheme Widget Library requires full Chez Scheme, rather than just Petite Chez Scheme - i.e. is not free. Apparently it runs on Windoze without full Chez, though. (Actually, I know this already - I have an old version on my (now more or less retired) Windoze laptop.) DrScheme definitely doesn't work on AMD Linux. I tried it every possible way - segmentation fault errors all the way down. Ah well, it's nice to have Petite! And I have DrScheme on the Mac laptop anyway, so no huge loss. This just gives me another project- getting an interface of my own from Scheme to Tk... Yeah, like that's ever gonna happen...]


Post a Comment

<< Home