by elric · 5y ago · 0 comments
Reducing technical debt by rewriting everything from scratch (almost?) never works. It's the baby and the bathwater. It's the sort of thing that seems attractive to junior developers, but more seasoned folks know that the legacy system contains years of embedded knowledge and workarounds for "real world" issues. The new, conceptually beautiful system always fails to capture that embedded knowledge, and ends up breaking many things in many ways for many people.
Perhaps we did need a new display server, perhaps Wayland is conceptually better than Xorg, but it'll be many years before it reaches feature parity, if it ever does.
You make it sound like Wayland has been pushed by some script kiddies, when in fact the lead developers on Wayland are the actual Xorg maintainers.
To me, the migration from X11 to Wayland looks similar to the switch from DOS-based Windows to Windows NT. At the time, lots of programs were broken by the move because they assumed you could meddle in other application's internal memory. But breaking those applications was not malicious intent on the side of the Windows devs. It was a legimitate move towards a more sustainable architecture. I'm not intimately familiar with X11 internals, but my read of the situation is that X11 just exposes too many internals in its interfaces, and therefore it becomes increasingly impossible to adapt it to contemporary needs (in this case, application sandboxing).
Daniel Stone[0] incredibly funny and educational talk[1] from 2013 could help many critics who missed the 3 decade long ongoing discussion of why X is bad. We've talked about this already in the mid 90ies (when there were no alternatives) and now 8 years after this popular linux.conf.au talk, people still having troubles understanding why X has always been a terrible tradeoff for both security and performance (well for literally everything).
[0] https://www.fooishbar.org/about/
[1] The Real Story Behind Wayland and X https://www.youtube.com/watch?v=RIctzAQOe44
edit: BUT X IS THE UNIX WAY! << so what is the 1 thing X does, and what is it doing well?
> so what is the 1 thing X does, and what is it doing well?
It provides functional and well-established(accepted standard) graphics server technology/libraries for any application that uses graphics.
I don't care if it takes 10 liters of blood to compile one version of X or whatever. I'm a user. All I care is that my desktop works as robustly as did it yesterday or 5 years ago. If that's not happening, I'm not interested in macros, classes, variables, declarations, structs, or any other geeky CS technobabble. That's irrelevant. And a product that advertises itself as being created to be convenient for the people developing it is a paradox. Don't develop it, then. Makes things even easier.
-- from https://www.dedoimedo.com/computers/fedora-25-wayland-vs-xor...
It's not just the internals of X11 that are the problem, it's that the entire concept was baked in a different time. The major innovation of the X11 server was that, well, it's a server. It can be completely decoupled from the client, even physically if you use it over tcp. That was kinda nice, but then came GPUs, and direct rendering. The name of the game is now violating every single abstraction that stands between a userland app drawing directly to the display with only a GPU and a single graphics api in between. It was definitely not junior developers who rewrote the entire kernel graphics stack to move from frame buffers to direct rendering.
Computer graphics are pretty tough if you think about how many bits/s are being transferred to your 4k display at 60hz and how little latency we will tolerate. It's not like network data where we can afford to encapsulate it five times over and abstract it and forget about the contents.
Any criticism of Wayland should be with regard to what is next. Hell I'm not even convinced we need a display server, let's talk about that. I'm not going to take anyone seriously who says X11 is better, and because of a few insignificant issues like taking a damn screen cap (really? and that works fine now btw).
Take for example, Mac OS 9 -> 10. Complete rewrite. One of the best decisions in computing history. And especially relevant here because the display server was one of the babies they threw out the window or whatever, and the quartz compositor was born.
Application sandboxing is not a need I have or one that I want my display manager to solve.
But incompatibility vs the architecture disallows features like screen sharing, automation or accessibility means I will not ever have it installed anywhere.
I can't tell people want to do, but those features seem very "contemporary" to me.
Perhaps it's because I use linux as my work desktop. I suppose if this is the feature I should just migrate to OSX.
Because I need video conferencing. I don't need a sandbox. I already am selective about what I install and most of those things aren't even desktop applications.
in X any application can turn into a keylogger, and you don't need a GUI for it, as long as the program can "speak X" it will be able to read the shared memory of all other programs the X server manages.
Not being able to participate in video conferencing and desktop sharing is an employment risk.
Im a picky person though. I already use i3, but also have NVidia gpu's. I don't mind spending some money on another real GPU (will it work with AMD).
I understand the frustration of the developers too. But screen sharing or my custom screenshot tool.. are things that will make me recompile if needed for days before I give up and abandon linux for the desktop.
I realize I'm spoiled, but I do wonder if this is the direction things are going who is going to be that hypothetical user that cares?
I think very few people involved underestimate the work involved to replace X, and that it is going to be many years before it is somehow done.
Many seasoned Xorg developers work on Wayland. All the decades of lessons form Xorg _were_ carried over to Wayland.
I'm sure many lessons from Xorg were carried over to Wayland, but "all" is an insane exaggeration. And I'm sure many new mistakes were introduced. It's inevitable with any new system.
All of them are either working on Wayland or moved on. There are no Xorg developers.
There will be some loss of lessons with almost no doubt.
Rewrites don't work when the following two statements are both true:
- the rewrite should achieve feature parity at a higher generaly quality
- the people who're doing the rewrite don't have most or all the knowledge that people working on the legacy system had (this could be written docs, automated tests, or just actual people hanging around)
The Wayland developers are the same people who have been building all these workarounds for xorg for decades. This isn't a new thing coming out of nowhere. When the old guard is telling you that their own work needs to be replaced, I'd listen.
>Perhaps we did need a new display server, perhaps Wayland is conceptually better than Xorg, but it'll be many years before it reaches feature parity, if it ever does.
Good thing nobody forces you to use it and it's just one click away on the login screen from switching to xorg. In the meantime people who want to hack on the project can do so and ship their changes to users to test them plus those who do suffer from xorg issues( because yes, xorg doesn't do well on a lot of things that aren't even that modern despite all the workarounds for the "real world" issues it has) can use wayland right away.
I'm afraid that's where the Linux desktop is today. Linux as a platform actually sucks for running "untrusted" software. And "untrusted" doesn't just mean proprietary games. It also just means "can I please run the alpha version of this cool open source project without being afraid that it'll fuck up my whole home directory?"
Android does a hacky thing where each program is its own "user". But then, having multiple (human) users is confusing (I don't know how Android does this, actually).
I don't know if Wayland will succeed. In fact, I'm rather pessimistic about it. But I'm also pessimistic about desktop Linux "succeeding" (staying reasonably useful even to nerds) if Wayland doesn't.
And for the sandboxing it uses SELinux which is available on desktop as well. It's just a royal PITA to configure. This is why many people don't bother with it. But in a highly restricted environment like a smartphone it's a lot easier.
I wouldn't call that a 'hacky' thing, it's just using it in a very different environment.
I used to think that, and then I started using Fedora. They have put a lot of effort into their SeLinux policies. I do all sorts of things with my workstation and very rarely have to care. In the last 6 months the only thing I have had to do is add ":z" to a bind mount running a podman container so that labelling happened correctly.
The point was intended to be that Linux is becoming more and more lacking as a personal computing platform, relative to the gains elsewhere in the space. The display server is one part of that- the entire user/group permission model is another part.
The part of Android that is "hacky" is using a separate user for every app. That's obviously not what the Linux/Unix guys had in mind for the user mechanism, thus it's a "hack". It's not necessarily a bad thing and it's totally hidden from the UX of your typical Android user, so it's fine. Just interesting.
The problem was not the protocol, but that the Wayland devs explicitly wanted to throw out a whole lot of functionality people actually depend on without having put thought into replacements.
I haven't followed the development at all but, Xorg is 16 years old and Wayland is 12. It seems counterintuitive that feature parity could not be attained in this time unless it's for philosophical reasons.
Edit: Thanks for pointing out that Xorg is actually much older. My argument indeed doesn't hold.
Wayland's latest release "mostly contains bug fixes and minor protocol updates." [0]. That is ~12 months worth of changes. Pretty similar to 1.18. It isn't like the protocol is a hotbed of massive changes, it looks largely complete according to the release notes.
[0] https://lists.freedesktop.org/archives/wayland-devel/2021-Ja...
Xorg is a fork of Xfree86, which was released in 1991 (https://en.wikipedia.org/wiki/XFree86).
Xorg is a fork of Xfree86 which started in 1991 but feature parity minus the cruft has been reached years ago. Some people disagree about what is cruft however.
For example, I view 90% of the list in the posted articles to be minor softwares relying on undesirable behaviour and unwilling to adapt (the remaining 10% being misrepresentation of actually solved issues listed in bad faith). The original author would obviously disagree.
Then again, I consider X.org to be and always have been completely unusable. How can people accept to use a display manager with constant screen tearing is beside me.
If the goal is to have a different display protocol that a significant fraction of the possible user base can’t reasonably use as their root display because it provides yet another way in which “Linux isn’t ready for this to be the year of the desktop”, that’s a perfectly reasonable aim, but it seems like Wayland is targeting replacing X, in which case supporting screen sharing (and recording) is probably not an ignorable “minor feature degradation”.
I never even noticed it, and I never quite understood what people are on about with this. I had to go to YouTube to watch a demo video to see what it really looks like. And if I try it, then yes, I suppose I see some tearing if I move a window and pay close attention to it. But I never even noticed on my own, and am not bothered by it in the slightest.
Would it be better without it? Sure. But the amount of effort to eliminate what I experience as basically a non-issue is a poor trade-off IMO.
The goal of Wayland is "every frame perfect", which means I consider it broken by design. I want imperfect frames right away, not perfect frames later.
I'm not saying this isn't true, but I always find it interesting when I see people complain about screen tearing.
How often does it actually happen to you, and under which circumstances?
Personally I've been using computers since 1995, (Windows and Linux) and I practically never encounter screen tearing. And this is on a wide variety of hardware. Spread evenly over intel, nvidia, and AMD.
The rare times I did encounter it, was only on one PC with an ancient nvidia graphics card (running Arch linux, bspwm). And it would only ever (if even) happen right before a restart after updating the nvidia drivers.
>> How often does it actually happen to you, and under which circumstances?
It happens every time I Watch a video on X, which is really annoying. It also happens when dragging large windows on my 4k. Wayland is fantastic in this regard.
Scrolling, moving windows, resizing windows, approximately constantly.
That's solved by using a compositing window manager such as Compton.
see: https://imgur.com/a/lDfObqw
It's in the advanced settings.
Silky smooth Xorg web browsing and video at no extra compositor cost.
Is this really a problem for people?
Agreed but this is one of those "almost" exceptions.
1. Is the code built to 40+ year old requirements, many of which are irrelevant today?
2. Is it hard to make it work for today's requirements without widespread fundamental changes?
3. Is the code a huge pile of foo that's damn near impossible to navigate, much less understand, much less debug?
4. Would a hypothetical program that solved today's requirements (with an architecture where the most important backwards compatibility features could be hooked in as needed) be smaller, simpler, and easier to maintain by newcomers?
If the answer to all of the above is "hell yes!", you might want to think about a wholesale rewrite.
Maybe we've worked on different projects, but sometimes the legacy is just that things were done differently in the past, and the APIs available were crap.
The lesson here is that writing a direct replacement system rarely succeeds because the new system will hardly be able to implement all the features in a reasonable time. Instead you should take a step back and develop a completely new system that follows actual user requirements and gets rid of all the dead code.