Older blog entries for ksandstr (starting at number 29)

Thoughts on compilers and such

While prototyping miscellaneous stuff with O'Caml (it's quite a neat language for that [among other things], if you can mentally push aside the 31-bit signed integer thingy), I noticed that there are some rather common (in the semi-functional language world anyway) ways of further optimizing code that the ia32 compiler doesn't seem to know about. Closure inlining in a "map", "iter" or "init" construct and instantiation of certain functions where the function has been partially applied to a constant parameter that would cause significant strenght-reduction (or other) gains in the emitted code, just to name two. Then again, I haven't examined the output to see what the compiler does at different "-inline" levels, so there's no telling what I may be missing... I'm a bit surprised though that the compiler that gets second place for many weightings of the ``great computer language shootout'' scorecard doesn't implement the closure-loop inlining thing, seeing as function calls through a pointer are somewhat expensive when compared to function calls to a fixed address.

Maybe I'll take a look at the compiler's source later on, just for the hell of it.


Why do I always get most work done a couple of days before a deadline? And why is most of the work that I do right before said deadline of the "this bit was misdesigned in the first place, so I'll reimplement a better version of something equivalent in one fourth of the source lines" kind? Do I really suck that much? :-)

19 May 2002 (updated 19 May 2002 at 18:49 UTC) »

Phew. It's been a long time since the previous entry. Let's see if I can't make up for it.

Got a job. It seems nice enough, although I've been spending my working hours mostly on "the premises of the client", whatever that means. Forgot to check the employer for particular worthiness in the area of patent policy, but it doesn't seem that software patents are in any way central to anything they (we?) are doing. And having money under a rock somewhere is certainly very nice.

The laptop mentioned in the previous entry (an IBM 560Z) is actually pretty good. The only minor complaint is that I'm getting slightly worried over the fact that the fan in the left edge of the "keyboard part" only seems to function during early startup, i.e. after the machine starts to run LILO it stops and doesn't start again, ever. I've only had the keyboard get warm a couple of times, so this probably isn't all that significant. I'm slightly more worried that the early startup process doesn't display the "press F2 to enter setup" or whatever it was in the top edge of the screen like it used to (or am I misremembering things again?).

As for q:laruisku, I wrote a "DisplayKit" abstraction so that the program can select between a SDL framebuffer implementation of certain 2D drawing primitives and an OpenGL wrapper. This seems to be working pretty well this far, although I feel that the SDL framebuffer impl could have better low-level blitting loops... then again, I likely shouldn't pay so much attention to their particular efficiency at this stage of the project. Once I actually get something resembling a rocket game on the screen, I'll make the first source release, after all these years. "Release early", indeed.

Also, I took a look at the XPLC component framework thing. Apart from the somewhat disgusting IInterfaceNamingStyle (also the functionNamingStyle), I think it might be something worth keeping an eye out for. Assuming that the virtual method call ABI in G++ doesn't suddendly change, of course...

On the "life" side, since the last diary entry I tested for the 6. kyu grade at our Aikido dojo, exactly 3 months after I started training there. Looking back, I wasn't by far as nervous about it as I am about my upcoming 5. kyu test... I'm still finding it to be much fun, though, and my ukemis are getting such that I barely feel like I've been doing any when I get back home :-)

19 Nov 2001 (updated 19 Nov 2001 at 02:51 UTC) »


Got myself a cheapish used laptop for about 670 euros -- a ThinkPad 570Z. Debian GNU/Linux installed from over the network with the 3-disk "compact" set on the first try (which is also a first for me -- I usually end up messing something up at first...). The keyboard on this thing is nice enough for some typing (although the auditory feedback just isn't there) and the 800x600 TFT screen doesn't seem to be causing me any head or neck aches so far. It remains to be seen if this laptop is any good for long hacking sessions -- the battery seems to last for about two and a half hours when the CPU is mostly idle.


q:laruisku is coming along pretty well, I think -- I took the easy route and neatly encapsulated the Airhook reliable datagram protocol so that I could concentrate on the structure of the actual game instead of spending an awful lot of time on a problem that has already been satisfactorily solved. Now I'll just have to figure out how to encapsulate the physics model in a clean way and make the server transmit sufficient game state information so that the client can actually draw frames that actually look like something... Then I'll start posting CVS snapshots on my home page, or something. Hopefully I won't get tired of this project before I release something that actually works.


I quit my new job after I found out that my new potential employer has a patent policy that's incompatible with what I personally believe in. That's one more thing I'll have to remember to ask about in the next interview... I'm just hoping that this was really the right thing to do, as I seem to have hit a few snags in finding a new job; there aren't that many openings for a generic C/C++/perl programmer here at this particular time, especially with the few (i.e. none, apart from some work experience) formal qualifications that I have. I suppose it'll just take me a bit longer to find a worthy employer...
7 Oct 2001 (updated 7 Oct 2001 at 18:46 UTC) »

So, they've started bombing Afganistan. Bastards, complete, utter, goddamn, motherfucking, inbred bastards, the lot of them.

I'm giving the U.S. state-terrorist retributive operation a new name -- "Operation Indirect Genocide". Guess how many times the number of people are going to die of hunger, disease and other stuff that tends to occur when about six million refugees are on the move than died at WTC? I expect the total bodycount will be somewhere between 4,000,000 and 9,000,000. "A battle between Good and Evil", in-fucking-deed.

I don't get it. Why put XML into everything under the sun? Haven't we already tried the "one size fits all" approach to programming languages, operating systems, desktop environments, operating system kernel designs and pretty much everything else? Why try it on data formats? What's so wrong with the format of the Makefile that we know and love that you'd want to move to a format that is about as much fun to write by hand as COBOL (I'm referring to the ant Java build tool, not that I'd touch Java code in the near future, thankyouverymuch)?

Sigh. Will we ever learn?

I restarted the old q:laruisku (that's something like ``cannonball syringe'' in english, for a rough translation) project, a network-playable rocket game in the spirit of Turboraketti and Gravity Force 2. Maybe I'll start putting up CVS snapshots at some point, once I get the client to actually display something... This time I'll definitely use OpenGL for the display -- wasting a couple of weeks writing alpha-blending rasterization functions for a SDL framebuffer surface isn't something I'm particularly planning to do.

11 Sep 2001 (updated 19 Sep 2001 at 21:07 UTC) »

Somebody set up U.S. the bomb

So. Last I heard, the bodycount is up to about 10k dead (estimated and rising). In a city of seven million, I'm not worried for my half-sister's daughter who happens to be in NYC at this very moment (she also phoned her mother some time ago, so we know she's alive though stuck on manhattan for the time being...).

Let's instead take a look at what has happened: A major landmark (of U.S. economic might, among other things) was destroyed by what is arguably but a display of power. The party responsible probably wants to show the world that the U.S. is not as invulnerable as they may appear. After all, the terrorists probably could have used a biological, chemical or nuclear weapon in the attack if they'd wanted bad enough (or had been fucking crazy enough) -- from what I've heard, there are more than 100 warheads unaccounted for in Russia so at least some of them may be in the hands of the so-called "rogue states". The same must hold for at least some of the biological and chemical weapons developed in Russia during the cold war.

All in all, what happened today was far from the worst case. I'm just hoping that dubya and his perceived military might have noticed this as well. From what I can tell (from the media), that isn't going to happen -- it'd be "admitting defeat to the terrorists", "putting our collective hands up", "letting foreign nationals dictate U.S. policy" or some equivalent nationalist rhetoric.

What surprises me though, among other things, that the attack came relatively early -- I'd have estimated that certain parties in the middle east and around there would not have done this sort of thing for at least a couple of years more.

(personally, I'm waiting for the death threats to roll in after this diary entry is posted. to reduce the count, I've [wisely?] not titled this with the old <nelson>Ha ha!</nelson> "almost smells like schadenfreude" joke.)


Browsed through the PVM manual and rewrote my small experimental still image vector quantization encoder so that it'll quantize input vectors against a codebook in parallel. It seems to scale pretty well, at least for the asymmetric 5-processor setup I have here (two of which share a bus). The master architecture doesn't keep all the CPUs occupied 100% of the time (minus communication overhead) though -- I'm a bit uncertain whether fixing this is something worth pouring time into as the under-utilization only happens between quantization iterations.

Update: fixed the "terrorists win!" link.

A word of advice:
If you have to wear glasses most of the time you're at the computer, do not, under any circumstance, give them up completely for a couple of days.

I did that, assuming that my older pair would be sufficient for the couple of days it takes for the current pair to get repaired. It turns out that the old, "backup" glasses have a left-side lens that's at -4.25, the same as the more recent pair's left lens, but the right one is 1.25 units off (-2.00, while I really need -3.25). The net result is that I either get a splitting headache after wearing the backup pair for more than 30 minutes at a time or don't wear the damn things at all (which makes me pretty much unable to get on a bus [unless there's other people who'll signal the right bus to stop] or walk anywhere that's not familiar).

I've been paging through the CORBA object trading service spec (most recent I could find on the omg.org website). The appendixes don't go to sufficient detail about the query constraint language to implement which makes me wonder about OMG's policies regarding proprietary extensions -- I mean, if I were to implement the language, I'd probably make a compatible but more general variant of the OMG trading constraint language (assuming that's what is described by the document I've been smo^Wreading). Maybe I'm just not looking hard enough and there's a proper specification of the TCL hiding somewhere...

In retrospect, I shouldn't have created a project for Reiska. Like before, the project sprouted metric assloads of over-engineered "but it'll be useful at some point" crap, thus becoming too large for my poor brain to handle. Perhaps one day I'll learn not to do that, somehow...

Damn. Perhaps a better "new project" policy would have been "wait until the first freshmeat.net announcement", or something.

jschauma: You're not delete'ing a char *, right? ISTR a previous coworker who got bitten by mistakenly using delete on an integer array (allocated with new int[count]) when he should've used delete[]. Maybe Solaris has one of those relatively rare C++ libraries that actually care about the distinction?

17 Jul 2001 (updated 17 Jul 2001 at 21:33 UTC) »


Got back to work on Reiska after about a week with OCaml. Getting back to C after working on a nontrivial (for me, anyway) project in a new-ish language feels like getting a cast off your leg, finally being able to walk unaided again. Whew. I'll definitely get back to OCaml one day or another; I got the Freenet 0.3 style crypto layer stuff working pretty well, with only a couple of C wrappers for Twofish and Rijndael encryption (I did have to write a partial wrapper for the mpz_* functions in GNU MP for the Diffie-Hellman key agreement stuff though - maybe I'll be able to rewrite it for numerix or Big_int someday.). I've a nagging feeling that GNU MP doesn't particularly enjoy having the mpz_ts garbage collected, compacted and otherwise shoved around - this could be the reason why the simple test server (connection acceptor would be a better term) seems to segfault after a couple hundred test connections. I haven't a clue how to fix this, so I'll go into procastrination mode, perhaps hack Reiska a bit more...


Got myself an optical, cordless mouse (one of those Logitech mice). The weight is quite a bit more than what I'd have expected from an optical mouse, though the two AA batteries aren't light either. It's also a little too sensitive for my tastes, but that may just be a configuration problem in XF86 (gpm works fine). The price was a bit on the expensive side, but if this mouse lasts me say 2 years it'll have been worth it (normally I go through two mice per year).

Life (still don't have one)

Finally went and bought myself a pair of sunglass thingies that clip to the sides of my glasses. Didn't have a good reason to wear them though, it started raining which then turned into a full thunderstorm, complete with lightning and 2-second power outages. Since I don't have an UPS (I'm in finland fer crying out loud, we don't get any non-lightning related power outages!), it was fsck(8) time for all three PCs. Lost a 36-day uptime on the firewall, too. Damn.

20 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!