Older blog entries for crhodes (starting at number 61)

10 Jan 2004 (updated 12 Jan 2004 at 17:38 UTC) »

First, I started doing this diary weblog thing, and it was good. Nobody much noticed what I was doing, but it warmed my ego, and gave me a place to note little things that I discovered. Then I noticed that it seemed to be taking off; what was more surprising to me at the time was that they seemed to be being read.

Now, I'm actively being sought out, along with a number of people (well, online presences) with aligned interests. My wisdom is now being disseminated to a wider world out there. I'd better be more careful what I say.

(The irony of a diary entry free of Lisp content, discussing a Lisp diary aggregator, is not lost on me).

8 Jan 2004 (updated 8 Jan 2004 at 13:31 UTC) »


I spend time fighting SourceForge's Compile Farm (actually, I have few complaints about this aspect of their service; I think I'm getting more than I pay for) to build two different versions of SBCL for MacOS X, so that I can investigate the problems of RUN-PROGRAM on the PPC.

However, I can't reproduce the problem. At all. No matter how hard I try, all my RUN-PROGRAMs work fine.

<chandler> Krystof: is the machine you're trying to duplicate it on a dual-processor machine?
<chandler> Krystof: if so, you won't be able to

So. How annoying. SourceForge's Compile Farm machines are clearly too good...

Alright, alright, an update. Not that this will make people complaining that this previously good "lisp rss feed" has dried up, because...

... I am currently finding out what real people do in real jobs. In one of these amusing setups where I get responsibility but no tangible benefits (i.e. scads of $$$) I am working in Derivative Research for a French subsidiary of a major British(ish) Bank. It's kind of interesting; I've learnt a lot about approximating integrals. Living in France has its compensations, too.

While we're at it, I have to revise for my viva. Seriously. And the schedule isn't ideal; I finish my stage on Friday 12th of December; my viva is tentatively scheduled for Saturday 13th of December in a different country. Lucky Eurostar is now really fast.

All this means that lisp work requiring more than superficial thought is going to proceed slowly for at least the next few weeks. Simple things that I'm doing: a better INHIBIT-WARNINGS, better bignum printing, and applying other peoples' patches.

Thesis minus 0 days.

Good thing it's ready, eh? Actually, it went to the binders on Wednesday, so it was with a certain amount of relief that I closed down that emacs instance on Thursday morning and was not told that I had unsaved changes in any buffers, and would I like to save the changes?

Now, all I need to do is find something to do with the rest of my life. Oh yes, and contend with Saruman the viva voce examination.

* most-positive-fixnum


Well, that one was satisfyingly straightforward. Known suboptimalities:

* (1+ most-positive-fixnum)

-100000000000000000*,,,*')*1207959552 * (compile nil '(lambda () 1))

INTERNAL ERROR * (gc) fatal error encountered in SBCL pid 30918: GC invariant lost, file "gc-common.c", line 277

I think it's safe to say that it's not quite working yet.

The lisp system I work on, SBCL, sometimes shows its age. Although SBCL per se has only been around for five years or so, it is an evolution from CMUCL, itself an offshoot from Spice Lisp, which was started in the early 1980s, borrowing from the heritage of 1970s lisps.

Given this history, it's not entirely surprising that the codebase (200kloc of lisp, plus about 10kloc of C and assembler) isn't 64-bit aware. However, today's applications are definitely nudging the space requirements; Lisp is apparently "big in bioinformatics", and fairly obviously there they'll want to be dealing with large databases.

So, a couple of months ago, Dan and I had a quick hack at porting our existing alpha backend (which was originally crafted as a 32-bit application) to be fully 64-bit. We got far enough to be executing plenty of lisp code, but not quite up to the point that the REPL was functional.

Time passed. Various bugs in the alpha backend were fixed, and so (why not?) I tried again yesterday, merging the previous branch with CVS HEAD. After conflict resolution, the addition of the necessary specialized array types, and three or more bugfixes (plus commenting out of things that break weirdly):

/about to set up restarts in TOPLEVEL-REPL
/entering REPL
* (* 2 3)

6 * most-positive-fixnum


Waitaminute! That doesn't look nicely big enough for a 64-bit lisp. Well, not quite everything is working, despite getting to the REPL; here, the printing routines are slightly broken. The most positive fixnum is meant to be (1- (ash 1 60)) (leaving four bits for tagging objects); that number is 1152921504606846975. So, compare and contrast


Other things that appear not to work include the compiler itself; clearly, the utility of a compiler-only implementation of 64-bit lisp without a functioning compiler might be viewed as "limited". Since I'm technically unemployed at this point, I'm taking offers of funding...

Thesis minus 8 days.

I tell a lie: it wasn't that bad after all.

Thesis minus 23 days.

Ow ow ow.

There are days when it might be better not to get out of bed, at least in a metaphorical sense.

On the plus side, we are now thesis minus 28 days. Is that a plus? that doesn't sound like a plus. can't wait 'till it's over, though, and I have some free time, or a job, or something of that sort.


Bugs bugs bugs... some of which were nastily difficult to track down. Particular embarrassments:

  • (ash (1- (ash 1 32)) -40) no longer returns 1;
  • (round 1.3) no longer trashes the stack;
  • (truncate 291351647815394962053040658028983955 10000000000000000000000000) now returns 29135164781, not 29135164782.

How does one find how to fix these bugs? Sometimes by observing strangenesses, and applying binary search to the system until the problem's origin is sufficiently well localized. Sometimes, though, just by thinking very hard...

It is at times like this, though, that the benefits of a test suite are very obvious — if only because some fixes can be deferred on some architectures, while remaining secure in the knowledge that the issue won't be lost.

Inevitably, as one gets nearer to the end of one's funding for any given project (in my case: doctoral studies) one finds less time for peripheral activities. In my case, the first out of the window was keeping this diary up to date: I can offer no apology to the masses of addicted readers other than "sorry". Somewhat more painfully, I've let my music lapse (apart from paying gigs or favours); I haven't even found time to bash through piano duets with another physicist.

I haven't yet managed to kick the Lisp compiler addiction, though. Highlights of the last two months: MacOS X port merged; implementing an ANSIly-correct (stupid) array type structure without any impact on user code; improvement in compiler diagnostic handlability; and a data structure improvement leading to a 25% performance increase in the compiler.

Microoptimizations are the most fun, though; right now, I'm working on implementing automatic detection of when modular arithmetic (as is the default in e.g. C, where overflow wraps round) is wanted, and also optimizing constant multiplies (which, on the x86 processor, is a tricky problem). Obviously, what I should be doing is writing up my thesis...

52 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!