News for hackers. Stuff that matters.
Re:Exploring System76's New Rust Based Desktop Environment by ijidak on Thursday January 13, 2022 @03:36PM (#29926474)
I know we developers love our languages.

But I'm always skeptical when underlying language choice is featured prominently as a selling point for any new project.

It tells me, this is a technology-first, users-second enthusiast project.

And thus, I'll be surprised if it tackles the deepest issues users need solved.

That doesn't mean it isn't cool as a proof of concept for a new or popular language.

It just makes me question to what extent it's going to solve the deepest problems with similar or older projects it is competing against.

Re:Exploring System76's New Rust Based Desktop Environment by SkyMarshal on Thursday January 13, 2022 @05:40PM (#29928006)
> But I'm always skeptical when underlying language choice is featured prominently as a selling point for any new project.

> It tells me, this is a technology-first, users-second enthusiast project.

> And thus, I'll be surprised if it tackles the deepest issues users need solved.

Some of the deepest issues that users need solved are ones that Rust was designed to solve at the language and compiler level.

1. System stability and memory efficiency, zero or fewer crashes due to memory-safety or thread-safety problems.

2. Security and assurance via the elimination of entire classes of attack vectors like buffer overflows.

3. Highly performant, responsive applications that are a joy to use.

Solving problems at the compiler level eliminates the reliance on fallible programmers to do so. People also tend to discount maintaining those solutions over years of dev team turnover, startup failures, etc. Building those solutions, capabilities, and constraints into the language itself makes maintenance over the entire product lifecycle more consistent.

It's like buying a Toyota, you know from the brand alone that you're getting a certain baseline level of reliability, maintainability, durability, and longevity. Rust is like the Toyota of programming languages - it can produce many different types of cars/programs, but they're all guaranteed to come with a baseline level of assurance, and to eliminate common classes of problems that degrade the end-user experience.

It may not make sense for other languages to be prominently featured as a selling point, but Rust is an exception.

Re:Exploring System76's New Rust Based Desktop Environment by twblalock on Thursday January 13, 2022 @06:30PM (#29928508)
> It's like buying a Toyota, you know from the brand alone that you're getting a certain baseline level of reliability, maintainability, durability, and longevity. Rust is like the Toyota of programming languages - it can produce many different types of cars/programs, but they're all guaranteed to come with a baseline level of assurance, and to eliminate common classes of problems that degrade the end-user experience.

It's possible to make buggy, slow, crappy software in any language. Rust is no exception. Nobody should derive any confidence from the language a product is written in.

Re:Exploring System76's New Rust Based Desktop Environment by jolux on Thursday January 13, 2022 @08:19PM (#29929405)
> It's possible to make buggy, slow, crappy software in any language.

True.

> Rust is no exception.

Also true.

> Nobody should derive any confidence from the language a product is written in.

This, on the other hand, is a non-sequitur, or at least it's too strong, because Rust can do things that C can't do: safe deterministic memory management and safe concurrency without data races. These things are not just available, they are the defaults in Rust. You have to go out of your way to get these things wrong. So, I wouldn't derive absolute confidence from an application being written in Rust. But I'd be willing to bet a whole lot that it has fewer memory bugs than an equivalent application written in C.

Re:Exploring System76's New Rust Based Desktop Environment by SkyMarshal on Thursday January 13, 2022 @10:40PM (#29930351)
> they are the defaults in Rust.

Exactly, this is what I should have explicitly said. Language defaults have a powerful effect on a project's norms and culture.

> You have to go out of your way to get these things wrong.

Yes, you actually have to try to write shitty Rust code, at least where there are defaults that prevent it. Thus the average Rust program will have that baseline level of quality. Like TQM/TPM/Six-Sigma for manufacturing software.

Re:Exploring System76's New Rust Based Desktop Environment by pjmlp on Friday January 14, 2022 @01:44AM (#29931314)
Like ActixWeb?
Re:Exploring System76's New Rust Based Desktop Environment by nicoburns on Friday January 14, 2022 @04:38AM (#29932421)
IMO the fact that the actix-web debacle was so well publicised speaks volumes in itself. The issues were actually discovered ahead of time by people reading the source code rather than people encountering bugs or vulnerabilities in the wild. That's a huge improvement over C software. Of course there are still bugs in Rust programs and libraries, but much fewer. And I think fewer to the point that eliminating them entirely might actually be feasible with enough effort.
Re:Exploring System76's New Rust Based Desktop Environment by pjmlp on Friday January 14, 2022 @05:42AM (#29932844)
For every vocal example there are tons that fly under the radar until they are on the news for the wrong reasons.

It is no accident that Ada and Java also have security guidelines similar to MISRA, because even with memory corruption bugs out of the picture, as log4j newly remided us, security only happens when it is part of the daily process, regardless of the language.

Re:Exploring System76's New Rust Based Desktop Environment by hderms on Friday January 14, 2022 @10:01AM (#29935243)
Isn't the whole reason you're mentioning actix-web because the community mostly balked at the amount of unsafe code in it? Surely that should be some evidence that the norms in Rustland are qualitatively different in many ways to what you'd find elsewhere?
Re:Exploring System76's New Rust Based Desktop Environment by southerntofu on Friday January 14, 2022 @08:27AM (#29934168)
Yes, pretty much like that. The author put "unsafe" blocks everywhere and the rest is history. Unsafe as a keyword is a kind of pledge: as a dev, you swear to the compiler that you've checked this part for correctness/safety. If you don't, you may get bitten, but the simple fact that "grep -R unsafe" will yield most (if not all) instances of potential memory fuckups is a huge win for auditability.
Re:Exploring System76's New Rust Based Desktop Environment by pjmlp on Friday January 14, 2022 @08:34AM (#29934247)
Rust's unsafe wouldn't have done anything to protect against an hypotetical log4r.

As for the memory fuckups you are right, pity that they are using a C GUI library.

Even if the binding has been deemed safe upon validation, if only remains a valid certification until the next Gtk version update, even minor ones might break the assumptions validated on the unsafe code block.

Re:Exploring System76's New Rust Based Desktop Environment by southerntofu on Friday January 14, 2022 @08:55AM (#29934421)
> Rust's unsafe wouldn't have done anything to protect against an hypotetical log4r.

You are correct. No programming language will protect you from writing flawed application logic.

> pity that they are using a C GUI library. (...) Gtk version update, even minor ones might break the assumptions

I don't know about that. GTK is more "battletested" than most frameworks, and has a lot of contributors to fix bugs. Also, and that's a very important point, GTK cares for accessibility! Using any other framework would have meant excluding a lot of people from the GUI.

As for assumptions, i certainly hope GTK devs don't push breaking changes to the ABI on minor updates. But i guess that's yet another assumption that can be broken.

Re:Exploring System76's New Rust Based Desktop Environment by jolux on Friday January 14, 2022 @03:00AM (#29931706)
Do you think Actix Web would be safer if it were written in C++?
Re:Exploring System76's New Rust Based Desktop Environment by pjmlp on Friday January 14, 2022 @04:22AM (#29932310)
Probably not, the point was that being in Rust wasn't either.
Re:Exploring System76's New Rust Based Desktop Environment by mmstick76 on Friday January 14, 2022 @07:03AM (#29933451)
But the point is the exact opposite because any use of unsafe is clearly marked as such, and therefore a code audit will instantly find its use and question it. Hence the fallout surrounding it.
Re:Exploring System76's New Rust Based Desktop Environment by pjmlp on Friday January 14, 2022 @08:32AM (#29934225)
How do you find unsafe on a binary library?

Also that is besides the point, unsafe only deals with a very specific cause of errors that plague C code bases (and those of languages copy-paste compatible with it).

Rust's unsafe wouldn't have done anything to protect against an hypotetical log4r.

Re:Exploring System76's New Rust Based Desktop Environment by jolux on Friday January 14, 2022 @10:50AM (#29935915)
My point is that Actix Web was still safer than it would have been if it were written in C++ (which is Rust’s whole goal as far as safety), and moreover the norms of the Rust community are so strong that most of the unsafe usage has since been removed, since it was unnecessary. Unsafe deals with memory errors, which are consistently the largest class of security vulnerabilities in native codebases. This is uncontroversial at this point. Rust won’t protect you from log4j, but it never claimed to. Java still protects you from mishandling memory, despite all the stupid automatic classloading features we keep discovering in it.
Re:Exploring System76's New Rust Based Desktop Environment by LoveMortuus on Friday January 14, 2022 @04:01AM (#29932166)
Non-sequitur definition: noun

a conclusion or statement that does not logically follow from the previous argument or statement. "his weird mixed metaphors and non sequiturs"

Re:Exploring System76's New Rust Based Desktop Environment by uoaei on Thursday January 13, 2022 @07:21PM (#29928931)
This is true and also mostly unhelpful. It's possible to build a car without a muffler. Does that mean it happens often enough that we need to dedicate a whole pooh-pooh session to the possibility? Is a manufacturing process not more likely to be useful if it prevents this error from ever occurring?
Re:Exploring System76's New Rust Based Desktop Environment by posnet on Thursday January 13, 2022 @08:22PM (#29929429)
There has to be a middle ground between "Nobody should derive any confidence from the language a product is written in" and "I only use products written in language X".

You shouldn't dervive all confidence in a product from it's implementation language, but when you are looking at all available products and need to filter down to ones you might be interested in. Implementation language can be a useful litmus test for understanding how it might behave without doing a complete in depth evaluation.

For example if I learn that a desktop application is written in javascript, it is likely to be using electron or an OS webview. Or if an application is written in C++ it is unlikely to have GC pauses cause stuttery UI. Both of those assumptions may not be true (Sciter for JS and Boehm GC for C++ respectively). However those assumptions are a useful starting point unless proven otherwise.

Re:Exploring System76's New Rust Based Desktop Environment by SkyMarshal on Thursday January 13, 2022 @08:50PM (#29929664)
> It's possible to make buggy, slow, crappy software in any language.

Technically it's possible, but you have to try a lot harder to do it in Rust than most other systems languages.

Re:Exploring System76's New Rust Based Desktop Environment by mohanmcgeek on Thursday January 13, 2022 @10:06PM (#29930159)
Because this is written in Rust and given how hard it is to hire Rust engineers, this will be abandonware in no time.

Remember vala anyone?

Although I want this to succeed if it is infact more performant and smoother than GNOME.

Re:Exploring System76's New Rust Based Desktop Environment by SkyMarshal on Friday January 14, 2022 @01:00AM (#29931086)
> given how hard it is to hire Rust engineers,

That's not given.

> Remember vala anyone?

Vala is nothing like Rust, doesn't solve the same problems, and is much more narrow in scope (Gnome development).

https://webcache.googleusercontent.com/search?q=cache:AcldYn...

Re:Exploring System76's New Rust Based Desktop Environment by mohanmcgeek on Saturday January 15, 2022 @01:56AM (#29944287)
For the reasons I mentioned above, adoption of vala by projects in 2010 is exactly like adoption of Rust.

That Rust is much more capable doesn't matter.

Re:Exploring System76's New Rust Based Desktop Environment by SkyMarshal on Saturday January 15, 2022 @11:43AM (#29947808)
You didn’t give any reasons about adoption of Vala. You said it’s hard to hire Rust programmers, and then just “Remember Vala anyone?” without actually saying anything more about Vala.
Re:Exploring System76's New Rust Based Desktop Environment by gurkendoktor on Friday January 14, 2022 @03:02AM (#29931720)
Well, what about Vala? Obviously C, Python, and especially JavaScript are infinitely more popular programming languages. Yet the number of developers building GTK apps with any of them seems to be in the same ballpark.
Re:Exploring System76's New Rust Based Desktop Environment by xvilka on Thursday January 13, 2022 @10:48PM (#29930395)
I would add from experience, that using Rust would increase the speed of development like with any higher-level language than C and without the need to track memory problems. It shifts focus more on the actual development. Cargo helps to this cause as well, not always though.
Re:Exploring System76's New Rust Based Desktop Environment by blub on Friday January 14, 2022 @02:45AM (#29931636)
Maybe you're right in some fundamental way, but as an example iOS, macOS, Android or Windows are all considered stable and efficient, secure and highly performant by most end-users. As a specialist one can quibble and point to counter-examples, but all of these are fine choices. The only big differences are in privacy and level of control offered.

It's more likely that by the time Rust makes an impact in Linux stability and performance - because you're using an OS, not just desktop environment - nobody will even remember what System76 was.

Re:Exploring System76's New Rust Based Desktop Environment by andrekandre on Friday January 14, 2022 @08:30AM (#29934200)

  > Some of the deepest issues that users need solved are ones that Rust was designed to solve at the language and compiler level.
true, but if they are just calling into gtk in the end, will it actually be any faster/more-stable?
Re:Exploring System76's New Rust Based Desktop Environment by a9h74j on Thursday January 13, 2022 @06:30PM (#29928512)
Ironically, perhaps Rust in this sense should be compared to Basalt -- as in the projected longevity difference between Basalt-rebar and iron-rebar.
Re:Exploring System76's New Rust Based Desktop Environment by stonogo on Thursday January 13, 2022 @07:29PM (#29929001)
Ok, but GTK uses Javascript, which is where most of that toolkit's defects (both security flaws and slowdowns) come from, not C. Calling javascript from Rust isn't going to be a materially different experience than calling javascript from C.
Re:Exploring System76's New Rust Based Desktop Environment by jmhain on Thursday January 13, 2022 @08:11PM (#29929342)
GTK is written in C, not JS.
Re:Exploring System76's New Rust Based Desktop Environment by southerntofu on Friday January 14, 2022 @08:29AM (#29934190)
GTK uses CSS but no JS. GNOME uses JavaScript intensively though, which is part of the reasons for the many slowness and bugs.
Re:Exploring System76's New Rust Based Desktop Environment by lallysingh on Thursday January 13, 2022 @03:45PM (#29926590)
System76 isnt making it about the implementation panguage: https://blog.system76.com/post/648371526931038208/cosmic-to-...

A Ctrl-F rust showed no results.

This post's author just likes Rust.

Re:Exploring System76's New Rust Based Desktop Environment by magicjosh on Thursday January 13, 2022 @03:59PM (#29926764)
Ah just to clarify, the blog post you referenced is from this past June. COSMIC based on Rust is a new development that System76 has not blogged about yet besides mentioning it in a Reddit post.

As a System76 fan, I too am curious to see what the point is. I have no idea what Rust is nor do I care.

Re:Exploring System76's New Rust Based Desktop Environment by ijidak on Thursday January 13, 2022 @08:01PM (#29929253)
Ah. Apologies. That was my misunderstanding.
Re:Exploring System76's New Rust Based Desktop Environment by megumax on Thursday January 13, 2022 @04:17PM (#29926991)
From what I know, system76 didn't shill cosmos as a rust DE, the only reference to Rust being done in some reddit comment. Most PopOS users don't know what Rust is, so it wouldn't make sense to talk about Cosmos as a Rust project.

Now, 90-95% of users use GNOME or KDE, having some competition from a `new` GTK4 DE can't be bad, so I would like to see Cosmos gain attention, and maybe be ported to other distros.

Re:Exploring System76's New Rust Based Desktop Environment by berkes on Friday January 14, 2022 @05:03AM (#29932597)
The people that System76 sells to most likely buy their hardware. In which case the word 'Rust' is worrying at least. Would you buy a laptop that ships with rust?

Jokes aside: during early development it makes perfect sense to advertise tech being used, because the audience is so different at that time. So even if system76 would "shill" it as a Rust DE, at this phase, that would be fine, because of the highly technical audience.

Re:Exploring System76's New Rust Based Desktop Environment by pxc on Thursday January 13, 2022 @05:07PM (#29927598)
System76 is just using Rust for COSMIC because the existing engineering talent here already use and like it for other things they work on at the company, like their device firmwares. It's a good common/familiar language for the teams they have. I don't think they're expecting Rust to do any magic for them.
Re:Exploring System76's New Rust Based Desktop Environment by pxc on Thursday January 13, 2022 @08:55PM (#29929692)
> the existing engineering talent here

Oops! That should read

> the existing engineering talent there

apologies. Missed the edit window on the comment, and only saw the error now.

I'm not at System76 and never have been

Re:Exploring System76's New Rust Based Desktop Environment by k_kalupe22 on Friday January 14, 2022 @12:03AM (#29930766)
They do this for getting higher ranks here at hackernews. What turns me off most is that they succeed, which in turn indicates that large parts of hackernews readers are biased towards Rust. Personally, I'm pretty sick of this evangelism and hype because I fell for it some years ago and started a project with Rust. Countless problems and dark corners. I moved in time to a mature garbage collected language. There's a reason Rust has kind of succeeded only in small niches where Rust is a good fit. And not everywhere (backend services, CLIs), like it was advertised by prominent evangelists.

However, for System 76 Rust is a very good choice.

But calling it "Rust based" when it's GTK is clearly a bit bold ...

Re:Exploring System76's New Rust Based Desktop Environment by 1_player on Friday January 14, 2022 @12:48AM (#29931044)
Especially when you have top voted sibling comments saying "Some of the deepest issues that users need solved are ones that Rust was designed to solve at the language and compiler level."

What?! The year of the Linux desktop hasn't been eluding us because of buffer overflows and memory safety. The Rust hype train is incredible. The Linux desktop problems have nothing to do with the goal Rust sets out to solve.

It's definitely a good choice of language for the problem, don't get me wrong, but choosing that language doesn't improve the chances of COSMIC revolutionising the Linux desktop situation one iota.

Re:Exploring System76's New Rust Based Desktop Environment by mmstick76 on Friday January 14, 2022 @08:52AM (#29934389)
Actually, a lot of the early Linux desktop was hampered by this exact problem. I remember in the late 2000s experiencing segfaults constantly in a lot of applications, Mesa/X11, the kernel, and even the desktop environment itself. You had to spend a lot of time tracking down a setup that works and sticking to it when you find it. It's gotten remarkably better since then, but GNOME Shell is still really fragile with segfaults when developing extensions for it.

That said, this is not the sole benefit of Rust. It is more of a side effect of aliasing XOR mutability than the primary benefit of Rust as a whole. Let's take a look at the C and Vala landscape as a comparison. Neither support message passing with channels, and async support is virtually an unmaintainable hack. Vala has generics thankfully, but C doesn't have generics and it's really bad. It also doesn't help that your only options for building software is pretty much almost entirely GLib and whatever sparse set libraries might be available for the package manager. Whereas with Rust there's a vast immutable repository of libraries you can leverage, and publishing open source libraries on the platform is easy.

Re:Exploring System76's New Rust Based Desktop Environment by southerntofu on Friday January 14, 2022 @08:33AM (#29934239)
I don't know about revolutionizing the Linux desktop, but i can assure you rust made me a better programmer (even when i write C or python) despite being a very bad programmer to start with.

I also know that Linux desktops are often victims of memory bugs, and that a higher-level language for extensions is something people appreciate, that's why there's JS in GNOME.

Re:Exploring System76's New Rust Based Desktop Environment by Rd6n6 on Friday January 14, 2022 @12:48AM (#29931040)
> I'm always skeptical when underlying language choice is featured prominently as a selling point for any new project.

> It tells me, this is a technology-first, users-second enthusiast project.

I disagree. There are thousands of pieces of software out there using convenient technologies at the expense of performance. I think a real, legitimate advantage of unreal over unity is that it uses c++ instead of c# for gameplay code. I’ve never been cpu bound in unreal. Js algorithms often run 100x slower than Java ones, and if gnome were written in rust we wouldn’t have had quite so many memory leaks.

Also, pg credits much of his startups success to his language choice, letting him iterate faster

Language can make a pivotal difference!

Re:Exploring System76's New Rust Based Desktop Environment by renox on Saturday January 15, 2022 @03:33PM (#29949966)
If memory serves Rust provides memory safety but memory leaks aren't considered 'unsafe' so I'm not so sure for the memory leaks..
Re:Exploring System76's New Rust Based Desktop Environment by nine_k on Thursday January 13, 2022 @04:39PM (#29927245)
For a relatively new language that still is not everywhere it's a good example of its viability for such a project. Also, it either testifies the richness of the ecosystem, or promises that it will get enriched in the process, because the development appears to be open-source.