From: Mathieu Bouchard Date: 2001-10-27T13:33:37+09:00 Subject: [ruby-talk:23593] Re: GUI / was [ANN] RubyInRubyParser 0.1-pre-alpha On Fri, 26 Oct 2001, markus liedl wrote: > > having a native window with a canvas which Ruby draws on using the BitBlt > > operation. From there we can think about a GUI toolkit like Squeak's, and > > other things like that. > matju, and experiences with Java Swing will tell you that this solution is > not fast, and will never be. To be precise: Bypassing what the X11 server has to offer you is not faster because even if your language is faster than C, the X11 server can (be considered to) draw faster than your own processor, because it's your gateway to the graphics accelerator. For people who still don't care about the accelerator, then using the NArray extension would be a way to get decent blitting speeds in Ruby. This may be a viable solution nowadays, though not one I'd approve of (I'm an old fart already). Squeak was slowish last time I tried it. > I was surprised, but Swings slowness does not depend on the hardware > it runs one, it's just slow. (I have impressions from using Swing on a > k6-2 350, P3 650, athlon 1.4) Ok, if this is true, then it is possible that Swing's got serious problems with its event queues and timers and such. This is pure speculation: I have not programmed on Swing. But I've used a Swing application for some time now. Looking at java.awt.Graphics you can see that AWT supports many acceleration features (polygons and text) of X11 and Win32, which is a good reason for Swing not to be slow, and also means Swing doesn't use BitBlt. I mean, unless you do text antialiasing (which is rather harsh on the eyes, though better than scaling a bitmap-font!) > matju's ideas say: get compatibility by the X11 protocol ( which may not be > what windows-guys like). Or compatibility with a X11 API. For example, you could write a package that emulates most of the RubyX11 interface on top of Win32, and raises NotImplementedError for the rest. I've been told that the Win32 drawing API is fairly rich, so the drawing speed wouldn't be a problem. The problem will be in the mismatch of non-graphical or less-graphical features. ________________________________________________________________ Mathieu Bouchard http://hostname.2y.net/~matju