About that beta 4 of 3.2

You know what happens when good intentions meet reality? I do. I wanted to fix the bug that simple-sphere has on 64 bit Linux. It works fine on 32 bit Linux. I can’t find it. In gdb comparisons, everything looks ok and I’ve done a lot of looking at the C code. That first blur 30 trips the bug. Setting it to 26 works. That is not good news to me. The code is kind of strange because I don’t know what a gaussion blur is or what 26 or 30 means. I guess it’s the center point of a rgb schmering (to make up a word). Why not check the Shoes manual?

That’s when reality stepped forward, kicked me to the ground, kicked me once more and is patiently waiting for me to get up before continuing the beating. Blur isn’t in the Shoes manual. There are a number of things not in the manual. I also noticed the manual was behaving strangely. Open the console window and it’s an ASCII-8BIT vs UTF-8 complaint. So my hack with 3.2b2 and ruby 1.9.3 didn’t work for long. I’m disappointed but not that surprized. Hacks are hacks. Naturally, I went poking around in ftsearchrt.c. There are many things in there that just don’t work it a unicode world. The sort code is just the beginning (and it can sort oddly – I’ve seen that). One solution would be to update all the C code to use wide characters or utf variants for string handling. Ick. Even worse, there are FIXME and TODO comments about changes to 64 bit that need to be done. I really don’t like that path.

Most of it is just passing back and forth with RubyVM API. Perhaps pure ruby would work? So I looked at what the Shoes4 folks have done with the manual. Indeed, it’s pretty much along the lines of what I was thinking I would have to do. Once you discover that the manual is samples/simple-manual.rb it displays OK (garish colors, but it lays out OK and the colors should be tuneable). Sadly, the search function runs out of memory (default jruby alloc) or coughs up an exeception. I filed bug #604 because I’m a team player. Right? Should be fixable. It’s a good place for me to start with.

From a Red Shoes 3.2 perspective it would require distributing Nokogiri as a Shoes gem since it has a native compile component. It’s like the hpricot gem that Shoes used to distribute but I don’t in 3.2. Welcome back. That gem dependency is no big deal for building Shoes from source on Linux so I can test the newer manual code my default dist build without have to cross compile an extension/gem. I might need to change the names of files and maybe some modules but hopefully anything I learn/fix will be transferrable to Shoes4. And vice versa. I like that their manual is (mostly) just a Shoes app. I really like the idea of ditching ftsearchrt. Does it sound like a lot of work? Yes, it is a lot of work and could conflict with Shoes4. Is it the right path? I think it might be.

Leave a Reply

Your email address will not be published. Required fields are marked *