I’m curious how software can be created and evolve over time. I’m afraid that at some point, we’ll realize there are issues with the software we’re using that can only be remedied by massive changes or a complete rewrite.

Are there any instances of this happening? Where something is designed with a flaw that doesn’t get realized until much later, necessitating scrapping the whole thing and starting from scratch?

109 points
*

Happens all the time on Linux. The current instance would be the shift from X11 to Wayland.

The first thing I noticed was when the audio system switched from OSS to ALSA.

permalink
report
reply
73 points

And then ALSA to all those barely functional audio daemons to PulseAudio, and then again to PipeWire. That sure one took a few tries to figure out right.

permalink
report
parent
reply
41 points

And the strangest thing about that is that neither PulseAudio nor Pipewire are replacing anything. ALSA and PulseAudio are still there while I handle my audio through Pipewire.

permalink
report
parent
reply
28 points
*

How is PulseAudio still there? I mean, sure the protocol is still there, but it’s handled by pipewire-pulse on most systems nowadays (KDE specifically requires PipeWire).

Also, PulseAudio was never designed to replace ALSA, it’s sitting on top of ALSA to abstract some complexity from the programs, that would arise if they were to use ALSA directly.

permalink
report
parent
reply
-1 points

And then from ALSA to PulseAudio haha

permalink
report
parent
reply
6 points

They’re at different layers of the audio stack though so not really replacing.

permalink
report
parent
reply
71 points

there are issues with the software we’re using that can only be remedied by massive changes or a complete rewrite.

I think this was the main reason for the Wayland project. So many issues with Xorg that it made more sense to start over, instead of trying to fix it in Xorg.

permalink
report
reply
1 point

And as I’ve understood and read about it, Wayland had been a near 10 years mess that ended up with a product as bad or perhaps worse than xorg.

Not trying to rain on either parade, but x is like the Hubble telescope if we added new upgrades to it every 2 months. Its way past its end of life, doing things it was never designed for.

Wayland seems… To be missing direction?

permalink
report
parent
reply
17 points

I do not want to fight and say you misunderstood. Let’s just say you have been very influenced by one perspective.

Wayland has taken a while to fully flesh out. Part of that has been delay by the original designers not wanting to compromise their vision. Most of it is just the time it takes to replace something mature ( X11 is 40 years old ). A lot of what feels like Wayland problems actually stem from applications not migrating yet.

While there are things yet to do, the design of Wayland is proving itself to be better fundamentally. There are already things Wayland can do that X11 likely never will ( like HDR ). Wayland is significantly more secure.

At this point, Wayland is either good enough or even superior for many people. It does not yet work perfectly for NVIDIA users which has more to do with NVIDIA’s choices than Wayland. Thankfully, it seems the biggest issues have been addressed and will come together around May.

The desktop environments and toolkits used in the most popular distros default to Wayland anlready and will be Wayland only soon. Pretty much all the second tier desktop environments have plans to get to Wayland.

We will exit 2024 with almost all distros using Wayland and the majority of users enjoying Wayland without issue.

X11 is going to be around for a long time but, on Linux, almost nobody will run it directly by 2026.

Wayland is hardly the Hubble.

permalink
report
parent
reply
2 points

Well, as I said, it’s what I read. If it’s better than that, great. Thanks for correcting me

Also, X is Hubble, not Wayland :)

permalink
report
parent
reply
4 points

I’ve been using Wayland on plasma 5 for a year or so now, and it looks like the recent Nvidia driver has merged, so it should be getting even better any minute now.

I’ve used it for streaming on Linux with pipewire, overall no complaints.

permalink
report
parent
reply
1 point

Wayland is the default for GNOME and KDE now, meaning before long it will become the default for the majority of all Linux users. And in addition, Xfce, Cinnamon and LXQt are also going to support it.

permalink
report
parent
reply
1 point
*

according to kagiGPT…
~~i have determined that wayland is the successor and technically minimal:
*Yes, it is possible to run simple GUI programs without a full desktop environment or window manager. According to the information in the memory:

You can run GUI programs with just an X server and the necessary libraries (such as QT or GTK), without needing a window manager or desktop environment installed. [1][2]

The X server handles the basic graphical functionality, like placing windows and handling events, while the window manager is responsible for managing the appearance and behavior of windows. [3][4]

Some users prefer this approach to avoid running a full desktop environment when they only need to launch a few GUI applications. [5][6]

However, the practical experience may not be as smooth as having a full desktop environment, as you may need to manually configure the environment for each GUI program. [7][8]*~~

however… firefox will not run without the full wayland compositor.

correction:

  1. Wayland is not a display server like X11, but rather a protocol that describes how applications communicate with a compositor directly. [1]

  2. Display servers using the Wayland protocol are called compositors, as they combine the roles of the X window manager, compositing manager, and display server. [2]

  3. A Wayland compositor combines the roles of the X window manager, compositing manager, and display server. Most major desktops support Wayland compositors. [3]

permalink
report
parent
reply
53 points

There is some Rust code that needs to be rewritten in C.

permalink
report
reply
40 points
*

Bold

permalink
report
parent
reply
27 points

Italics

permalink
report
parent
reply
12 points

I feel tracked… Better strike this all through

permalink
report
parent
reply
19 points

Strange. I’m not exactly keeping track. But isn’t the current going in just the opposite direction? Seems like tons of utilities are being rewritten in Rust to avoid memory safety bugs

permalink
report
parent
reply
9 points

You got it right, the person you replied to made a joke.

permalink
report
parent
reply
-2 points

The more the code is used, the faster it ought to be. A function for an OS kernel shouldn’t be written in Python, but a calculator doesn’t need to be written in assembly, that kind of thing.

I can’t really speak for Rust myself but to explain the comment, the performance gains of a language closer to assembly can be worth the headache of dealing with unsafe and harder to debug languages.

Linux, for instance, uses some assembly for the parts of it that need to be blazing fast. Confirming assembly code as bug-free, no leaks, all that, is just worth the performance sometimes.

But yeah I dunno in what cases rust is faster than C/C++.

permalink
report
parent
reply
13 points
*

C/C++ isn’t really faster than Rust. That’s the attraction of Rust; safety AND speed.

Of course it also depends on the job.

https://benchmarksgame-team.pages.debian.net/benchmarksgame/box-plot-summary-charts.html

permalink
report
parent
reply
1 point

Rust is faster than C. Iterators and mutable noalias can be optimized better. There’s still FORTRAN code in use because it’s noalias and therefore faster

permalink
report
parent
reply
1 point

But yeah I dunno in what cases rust is faster than C/C++.

First of all C and C++ are very different, C is faster than C++. Rust is not intrinsically faster than C in the same way that C is faster than C++, however there’s a huge difference, safety.

Imagine the following C function:

void do_something(Person* person);

Are you sure that you can pass NULL? Or that it won’t delete your object? Or delete later? Or anything, you need to know what the function does to be sure and/or perform lots of tests, e.g. the proper use of that function might be something like:

if( person ) {
  person_uses++;
  do_something(person);
}

...

if( --person_uses == 0 )
  free( person )

That’s a lot more calls than just calling the function, but it’s also a lot more secure.

In C++ this is somewhat solved by using smart pointers, e.g.

void do_something(std::unique_ptr<Person> person);
void something_else(std::shared_ptr<Person> person);

That’s a lot more secure and readable, but also a lot slower. Rust achieves the C++ level of security and readability using only the equivalent of a single C call by performing pre-compile analysis and making the assembly both fast and secure.

Can the same thing be done on C? Absolutely, you could use macros instead of ifs and counters and have a very fast and safe code but not easy to read at all. The thing is Rust makes it easy to write fast and safe code, C is faster but safe C is slower, and since you always want safe code Rust ends up being faster for most applications.

permalink
report
parent
reply
-12 points
*

Agree, call me unreasonable or whatever but I just don’t like Rust nor the community behind it. Stop trying to reinvent the wheel! Rust makes everything complicated.

On the other hand… Zig 😘

permalink
report
parent
reply
4 points

Also look into Hare, Odin and Vale. They’re all neat ideas.

permalink
report
parent
reply
2 points

Zig!!

permalink
report
parent
reply
1 point

Zig!!

permalink
report
parent
reply
51 points
*

Starting anything from scratch is a huge risk these days. At best you’ll have something like the python 2 -> 3 rewrite overhaul (leaving scraps of legacy code all over the place), at worst you’ll have something like gnome/kde (where the community schisms rather than adopting a new standard). I would say that most of the time, there are only two ways to get a new standard to reach mass adoption.

  1. Retrofit everything. Extend old APIs where possible. Build your new layer on top of https, or javascript, or ascii, or something else that already has widespread adoption. Make a clear upgrade path for old users, but maintain compatibility for as long as possible.

  2. Buy 99% of the market and declare yourself king (cough cough chromium).

permalink
report
reply
18 points

Python 3 wasn’t a rewrite, it just broke compatibility with Python 2.

permalink
report
parent
reply
4 points

In a good way. Using a non-verified bytes type for strings was such a giant source of bugs. Text is complicated and pretending it isn’t won’t get you far.

permalink
report
parent
reply
45 points

The entire thing. It needs to be completely rewritten in rust, complete with unit tests and Miri in CI, and converted to a high performance microkernel. Everything evolves into a crab /s

permalink
report
reply
10 points

I laughed waay too hard at this.

A PM said something similar earlier this week during a performance meeting: “I heard rust was fast. Maybe we should rewrite the software in that?”

permalink
report
parent
reply
5 points

They must have been a former Duke Nukem Forever project manager

permalink
report
parent
reply
3 points

Why not Ironclad( written in Ada) ? https://ironclad.nongnu.org/

permalink
report
parent
reply
3 points

Had me in the first half ngl

permalink
report
parent
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 9.5K

    Monthly active users

  • 6.1K

    Posts

  • 170K

    Comments