lunes, 15 de noviembre de 2010

My thoughts on the switch to wayland

Like anybody cares for what I think, right? Anyway... I made a comment in one of these wayland-related news at linuxtoday and Carla Shroder took the time to ask me:

"...why all that extra complexity to go back to where we were in the first place?"

That's a fair question. By the way, my love to you, Carla. You haven't sent me a comment about pythogoras that I asked you for but I still love you and care for you. :-D

Anyways... the thing is this:

Wayland is going to replace X in Ubuntu and Fedora. That's quite a remarkable statement to make. We are talking about X, the same X that has been there since I started using GNU/Linux about 9 years ago and even many years before that cosmic event, if you will.

But all the GUI applications for UNIX at the time use X, so that means it's going to be a really troublesome change, isn't it? Also, there are really cool and extremely useful features in X like Network Transparency (think of export DISPLAY=blablah:0.0 or ssh -X, pleople) that would disappear from the face of the earth (I'm wondering what I would show my Windows-loving friends now when I start showing them the wonders of GNU/Linux if I don't have network transparency. I'll have to think about that).

As I was saying, I'll (try to) tackle those two questions.

First off, this means a major reworking to get all applications to render on wayland, isn't it? I think it can be solved by hacking the lower layer APIs like Qt or GTK or even at a lower level like wrapping the Wayland API for clients around the X API (update: I think it's viceversa... but you get the concept, don't you?). Then not much work would have to be done on the higher layers (or so the fairy tale theories of software development say). That means applications won't be hurt that much. I'm not implying that it's going to be easy but not much work will have to be required from us mere mortals in that case. Also it means that the switch could be done overnight to start using Wayland.

Then there are things built inside X that would be gone once Wayland makes its debut, right (to be read as "Network Transparency")? What I've read around (won't provide any links but it's very logical) is that X could still use Wayland as just another graphics interface and then you will have X running on top of Wayland and (tadaaaaaaaaaaaaaaaaa) you would get Network Transparency back faster than you can say "mi moto alpina derrapante" (that's a nice joke in spanish... people who are learning spanish should give me a call so that I tell you about it and have a laugh).

But then Carla makes the final killing point: Is all this hassle really worth it?

In all honesty, I don't know. It's still too early in the game to make up my mind weather it will be worth it or not. But if X's complexity/overhead can be cut down and get a faster/lighter/snappier/sexier/whatever-you-consider-important-er environment to spend your time onto, then it could be worth it in the end... specially if (as I said) it won't require much work but on the lower layer APIs.

Now I don't know if switching to Wayland will be really worth it, but was it reading this article worth it after all? I truly hope so.

7 comentarios:

  1. Wouldn't it be easier to just develop some kind of "direct rendermode" for X(which would disable the networktransparency and additionele protocol overhead) ? this way the network transparency would be just one option away...

  2. Adding a Wayland "backend" for X simply means you can still run an "X" server on the machine, like for example, you can on OS/X or even Microsoft Windows with MingX. It does not mean you can ssh -X to your box and run firefox or any other application rebuild for wayland remotely because the backend to the screen would no longer be speaking X protocol but rather directly to wayland, just like you cannot do this for applications on OS/X or Microsoft Windows. It means the only way to "remote" applications would be to remote the entire desktop in something like RDP which I truly despise.

    With that the real useful and I feel both under-appreciated and under-utilized benefits of network transparency and being able to network separate application compute from application display will be lost and replaced with a strangled vision based on what I feel is a broken and far more limited paradigm.
    I would rather see a desktop that finally fully utilizes X rather than trying to follow that limited vision.

  3. Correct me if I'm wrong, but couldn't you create a lightweight program that acts as a Wayland backend (a drm network module, if you will), which takes the output of Wayland and sends it across the network in an X compatible way (or any other way)?

  4. Eh, I guess that would be like the "entire desktop" approach dyfet mentioned. Alternatively, you could create a network mode/module for the toolkit you're using (GTK, Qt, etc), which handles input/output over a network. It's certainly not ideal, since you'd have to create an interface for that in the toolkit, but if it's already there or easy to add, then I guess it's an option.

  5. I think one approach would to be to use Wayland as a "video driver" for X. So that everything still runs as an X app, but wayland is doing all the actual screen drawing. This allows X to still exist on the machine, enables remote apps and doesn't require all the apps to be "fixed" for Wayland.

  6. @Kevin: It's my understanding that this is the way they're going to run with things as they go towards this. There have already been demonstrations of headless X11 sessions (two desktop level ones, actually) running in parallel on Wayland.

    The people that're going on and on about X11 not working, losing network connectivity, etc. need to cool their jets. Wayland's STILL in it's infancy, X11 has two parts to it, and there's NOTHING saying you can't add some of the "missing" parts to Wayland to "gain back" network transparency.

    I use NX for a lot of things and not having something along the lines of network transparency will break everything for me as well. I don't have my underwear in knots yet about it because of the things I said above at the beginning of this rant.

    Why? Because you and I both don't know anything more than it's a compositor server and it empowers things that X11 just can't do right at the moment- and couldn't easily be made to do either. That doesn't mean you can't add X11's functionality a' la CORBA in the manner Berlin/Fresco tried to do (Though I wouldn't have used the ORB they added to their implementation woes...). The main reason that that project didn't move very much forward was that it was 1-2 people working on it with not much assistance in the community given to it. This is not to say X11 can't, now that we're shedding some of it's baggage, move to be what is needed either.

    We just don't know and won't know until we do the work. And going "the sky is falling" or "no" because it doesn't give you your pet functionality NOW is bogus.

  7. I think that Wayland is a great thing. Not that I've seen it running yet. But the concept itself.

    The problems with proprietary software is that there it is a 'one ring to rule them all' solution. The implementation of Wayland as an alternative to X has meant a lot of hard work, to produce a product that duplicates functionality that already exists, but does it in a different way. What's learned from Wayland will have an effect on X. By competing, the two will drive each other to greater and greater heights.

    Think of it as evolution in action.