On Sat, 20 Oct 2001, Kero van Gelder wrote:

> > > (btw, X is over a network, how's that on ``native''? :)
> > Performance-wise, on average, X11 sockets are faster than equivalent
> > Win32 system-calls, which in turn is faster than X11-on-Win32. That is
> > when plain Xlib is used (I don't claim that "RubyX11" is any fast.)
> native == speed, but networking (in whatever way) is an extra layer !=
> speed.

The question is whether the display server is to be put in the Kernel or
outside the Kernel. In the first case you have only two context switches;
in the latter, you usually need six; this is the difference you see.

The other difference is that in X11 you can bundle several calls together.
Typically, you do 6 context-switches per 4k of passed arguments, no matter
how many calls. In Xlib, this bundling is mostly done for calls that have
no return value. In RubyX11, you can do this bundling also on calls that
return values (but on other aspects, RubyX11 has high overhead, so RubyX11
is only faster than Xlib when calling over higher-latency connections)

> Apparently, I'm wrong.
> Sometimes, being wrong is better.

If you're wrong in the same way as everybody else, it can help you make
friends. That's how the world works.

> > Each Window has a property Hash in which Clients can store and read 
> > arbitrary data. Clients may get notified about changes in those
> > hashes. If this is overkill, then you can send user-events to windows.
> Sounds like I need to read some documentation.

One bitch about X11 documentation is that it's somewhat convoluted and
badly organized. With the experience I have of X11, I'd say the X11
authors were quite good at designing the protocol, but not much at
expressing it (doc and code) in a concise way.

> Window managers are NOT exchangable. There are simply too many of them
> and some of them do not implement everything or behave well in
> ``regular'' cases.

Yes, true. Window management should have been a _library_ first; but then,
there is still not a single default object system for C, and I think this
is to blame for how much of X11 programming (Xlib,Xt,etc) is done in a
retarded way, as whenever you write a complex enough library you have to
reinvent many things all along, and whenever you use complex enough
libraries you may have serious difficulty to make them talk together.

Incidentally, this is the rationale behind my RubyX11 and Hybris projects,
and the reason I started coding in Ruby at all. (but those are hobby
projects so they're not progressing very fast)

________________________________________________________________
Mathieu Bouchard                   http://hostname.2y.net/~matju