by ferguess_k · 1y ago · 0 comments
Or, what's so wrong with anything so people need to replace it with something else instead of improving it?
Let's say I'm an old man favoring improving existing stuffs instead of starting from scratch. I like debugging and wish to work as a sys programmer specialized in debugging and fixing/improving legacy codebase. But again I'm not really a sys programmer so I'm probably on the wrong side.
He later worked for Nokia, Intel and eventually his own startup related to VR.
During his time as a Google summer of code student, his project was to paralelize X code so it could run in multiple threads, making better use of modern hardware with many cores. His project failed. The reason: X code was so bad that paralelizing and making it thread-safe required so many locks that it ran slower! It was a better idea to start from scratch. I remember, at the time, taking a look at the source code and asking him why there was a X86 emulator built-in in X source code. His answer was that that was required to run some video BIOS on non-x86 computers, namely Sun workstations. That was the level of legacy code in X.
This is just an illustration of many problems X had. Vignatti was one of the X devs that migrated to wayland development. Many other core X devs did the same. People saying that X is fixable, that it can be improved or what else... These people may be right, but I trust X core developers more than these people when the subject is X development.
1. Security - Any program using X11 can read keystrokes, passwords, or the contents of any other window. Fixing this would break all existing X11 applications.
2. Performance - X11's client-server model doesn't work with hardware accelerated graphics, requiring hacks to get around. X11 is basically stuck with this legacy.
The ground-up re-design of X11 to fix those two issues is Wayland.
https://www.x.org/archive/X11R7.5/doc/security/XACE-Spec.htm...
If you can't trust the process don't run it. If you have to run it, isolate all of it.
Wayland gives you neither the freedom to safely tailor your security policy, nor the security guarantees to warrant its inflexibility.
If you do it further down the stack, you break accessibility and automation even more... this has been tried. Doesn't work.
The end goal is to have actually working Android-like sandboxing rather than some broken firejail crap.
This is a feature not an issue. And it's how every computer that hasn't tried to take away control from its users has worked. I WANT my programs to be empowered to act on my behalf. If you want a gimped platform to run untrusted apps go buy a phone.
> 2. Performance - X11's client-server model doesn't work with hardware accelerated graphics, requiring hacks to get around. X11 is basically stuck with this legacy.
It works very well in fact. What you call hacks is something you probably cannot comprehend: Actual long term backwards compatibility. All programs should strive to have more of that, but especially central ones like the display server.
> The ground-up re-design of X11 to fix those two issues is Wayland.
It does limit what programs can do and breaks backwards compatibility, yes. That's the problem.
> 1. Security
Linux (and Unix before it) has always had security mechanisms built in. File permissions, setuid bits, namespaces. Any old program shouldn't be able to access /etc/passwd, and likewise the `<input type="password">` in my browser should be protected. Wayland's problem isn't that it tried to add security, but that the design and development process went horrifically wrong so that 17 years after the first release, people still have trouble with screen sharing.
> 2. Performance
The client-server model is obsolete and unsupported by modern applications (and nowadays there are easier ways to do remote GUI access) and keeping it was just a big pile of tech debt.
The problem wasn't that Wayland tried to fix things, it's that the process took 17 years and still isn't finished or particularly successful. My uneducated guess at why Wayland failed to succeed is that it went for extreme modularity and refused to say (back in like 2009) "Here's the security mechanism everyone has to use to take screenshots, etc. If this breaks your spacebar heater, sucks to be you." Rather than just define a single API where 99% of graphical applications and desktop utilities can do the sorts of things they already do on Windows and MacOS, and call it 1.0, instead they built a sprawling monument to bikeshedding and over-engineering.
I tend to agree. I have long attributed the mess that is wayland-protocols in large part to the fact that they didn’t define a security mechanism or permission model in place from the start.
They seemed to assume, at first, that it was reasonable to prevent all programs from doing what any program could abuse. Had they instead acknowledged that some programs need to be granted the ability to take actions that otherwise risk insecurity, they wouldn’t have needed to try to distort the protocols to fit the lacking security model of Wayland (or, in some cases, wouldn’t have needed to circumvent Wayland entirely to achieve their ends).
The last time I looked into it, I found out I would have to deal with each compositor separately. On top of that, the target apps would have to be written with the new API in mind.
IIRC: this isn't quite correct, there was an extension called XACE that can block this. Probably Xorg didn't implement it and desktops didn't have support for it though.
https://www.x.org/archive/X11R7.5/doc/security/XACE-Spec.htm...
I really wish they would figure this out. It just feels like with Threadripper etc the time is perfect for a return of thin-clients/not-so-dummy terminals running X11-like applications over the network on a server. Especially for development where many of us are running under-powered laptops and could use the boost to compilation from a beefy machine.
I wasn't talking about X11, just that capability.
Never heard of Waypipe before, but it was mentioned in a sibling comment, and that might be exactly what I'm looking for.
If anything, the variety of alternative solutions for that today -- everything from single-app to high-res full-desktop game streaming -- are much more robust and viable on modern networks than the X approach ever was, even if it was a neat-o "freebie" thing that fell out of its design. You get what you pay for, I guess.
When you start to consider things such as HDR, hardware planes (important if you want energy efficient video decoding) etc, the protocol just doesn't make that kind of thing easy, compared to Wayland which does by it's use of surfaces etc.
Is the security extension from 1996, which has a section on keyboard security
and its crazy to me that this anyone can claim X11 can't be off loaded, which its been doing for decades. From all the crazy blt/pattern HW acceleration to GL/vulcan implementations to the fact that the entire server can be on the other side of a network pipe, meaning it could be anywhere, including entirely encapsulated on a graphics card/smart nic/etc.
And if your talking about the xlib serialization, that was largely fixed with XCB.
Nobody is stopping you from pulling together a group and working on all this free software, forging forth on Xorg, and forking or maintaining the DEs to work with X11 as long as you want to maintain it. I think the group of people who wants to do that will be quite small, because I've really only seen the sentiment from people who have never actually hacked on an X11 codebase and worked with the protocols themselves. You can want X11 to stay alive, but you can't really demand the people who don't want to work on it anymore to keep working on it.
The redesign also reflects their priorities. The best analogy I can come up with is imagine a small group of people maintaining an old car frame and mechanical workings. They work hard to keep the engine running, but it's in a chassis with leaf springs and direct steering. It also has lots of vestigial things like a hand-crank even though most people have been using an electric starter for years. Other people use this as a platform to make complete cars with body &c. but this is both too much and too old for the small group to maintain themselves.
So they build a new, more modern engine and wait for other people to build a car around it, which is more sustainable amount of work for them. Lots of other people complain that the engine isn't a car, and when they use the engine with one brand of car, the brakes don't work and when they use it with another brand of car, the steering doesn't work. This makes sense, since previously the underlying platform implemented much of those, but now it doesn't and everyone is figuring out how to build those and couple them to the new engine.
Eventually you reach the point where each brand has created its own brakes, suspension &c. that mostly work about the same, but the only actual common component is the engine now. That's about where we are today.
Isn't wayland just soem protocol? so did the ex X11 devs wrote soem specifications and then soem went to GNOME< some to KDE and others are just editing the specifications ?
I think the issue is that there is no wayland library that a DE can use so everyone is forced to implement it as part of the DE , so the end result is a lot of missing features and incompatibility.
I could be wrong, I still run Linux but I decided years ago to stop following the Linux drama, I will use Kubuntu LTS and hopefully when it drops X11 the Wayland implementation and the X11 fallback would be usable.
> The wayland protocol is essentially only about input handling and buffer management
So sending input to clients and managing the buffers needed is what wayland implements. Everything else is either done in the clients (e.g. rendering) or the compositor (pretty much everything else).
Note that this is a subset of what X11 did (though rendering had pretty much already moved to the client for modern applications). X11, of course, handled input, and it also provided an IPC mechanism (which is how clients e.g. communicated things to the WM). Wayland, at its core, is just those two things.
1) it would really be nice to renovate that old house in the city center of an old Italian town! Oh but hold and behold: you'd have to spend hours, days, months, even years (I am not kidding) just waiting for approval and agreeing on what you can and cannot do with the house. And it would cost twice as much as building a new one. And the new one would have better insulation and a modern layout, and be exactly like you want. That's why it's not always the case to fix and improve an existing thing.
2) it would really be nice to fix that car from the '60ies. Oh but hold and behold: the design doesn't really allow you to have all the safety measures of modern cars. And the maximum speed is going go be 65mph on a good day. And it's going to cost you twice as much as a new car, OR you'd have to learn tons of mechanical stuff to be able to fix it yourself. That's why it's not always the case to fix and improve existing things.
3) it's just more fun to build new things (at least for some people). It's open source. People do this for free, to learn and enjoy their time. They can do whatever they want, and they decided to go with the shiny new thing. Is it better than fixing and improving an existing technology? I don't know. But apparently it's more fun! :)
Ah you mean like in the wayland-protocols repo? :)
(not disagreeing with your actual point though)
not claiming that it applies here, but I wrote some small programs where writing my own library from scratch too less time than I spend on trying to understand existing one
In another case I was unaware that existing solution exists and I tried writing my own one (then migrated when I realized that surely this kind of thing was done and people on local hackerspace chat pointed out that it sounds like Ansible).
For that matter running joke on hackerspace chat is about spending 500 PLN and 20 hours on building a chair to save 400 PLN. Because in this case hobby playing with a wood was actual point, not maximum effectiveness.
Similarly, this year I planted basil - and fixed costs for pots etc are large enough that it will never make economic sense. But looking at plants growing from seed (and then eaten prematurely by some caterpillars) was really cool. LARPing a farmer and seeing how plant grows from tiny seed to about 50 cm plant was really cool and I recommend it.
Not saying that is what happened here, but sometimes the answer is because the old one is just not fun to work on anymore.
There is some interesting reasoning behind that (which I will let more learned people expand on) but since I'm not doing the work I'm pretty zen about just accepting the decisions of the people who did.
This 12 years old video explains it better than anything I ever seen:
Tech debt. The X11 dev have thrown the towel and have prefered working on something they deemed more maintainable.