4 ms·
I do believe there's a "drop C and pick Rust" crowd, or multiple even. When it comes to building user mode applications like desktop programs with QT or GTK or
by jeroenhd 6y ago
I do believe there's a "drop C and pick Rust" crowd, or multiple even.
When it comes to building user mode applications like desktop programs with QT or GTK or what have you or command line programs such as curl and wget, I think these crowds have a valid point. Most of those applications are written in an object oriented language though.
There's also a very small group that's very militant about everything, including kernels and microcontroller programs, being rewritten into Rust. I don't pay too much attention to that crowd; C has its place and it's not the ultimate solution to programming languages.
Rust won't replace C in the kernel, but I do think we will see tooling for our network clients, file indexing and perhaps even version control slowly switching languages (if they still rely on C, that is). These will all be new tools though, because rewriting an old application into Rust and maintaining compatibility and performance is a big challenge.
- bluejekyll 6y ago> Rust won't replace C in the kernel, but I do think we will see tooling for our network clients, file indexing and perhaps even version control slowly switching languages (if they still rely on C, that is). Do you mean the Linux kernel, XNU, Free/Net/OpenBSD, or other existing kernel's? There are plenty of examples of folks successfully building kernels in Rust. The likely hood of any of the major kernels adopting it (beyond drivers) is probably low. I expect the only reason that would happen is if any of the folks behind those kernels decide that they actively want to migrate the entire thing away from C in the long-run. Ground up new kernels in Rust are very feasible, though. Will any of those attract the community and contribution that we see in Linux? That's unlikely, but it's not impossible, as your comment implies.
- jeroenhd 6y agoI'm not saying it's impossible to create a Kernel in Rust, but I don't think Linux or any of the BSDs will switch to anything other than C for their primary kernel development language. The only option for kernels that are mostly Rust I can see is a ground-up kernel, but those rarely succeed if ever. There's been small kernels in C# for a while now, for example, but those are usually no more than a fun experiment. Fuchsia is the closest thing to a completely new kernel that I can think of and despite its age and the amount of people working on it, it's not used outside of lab environments. Perhaps in ten or twenty years a new kernel will replace Linux, and that might very well be written in Rust.
- BearOso 6y agoDoing GUIs with Rust is difficult. Gtk-rs lucked out because Gtk has introspection that maps out its C object API. Qt is not so good. Something simple like Win32? Not so good. Maybe I want to write a game. Gfx-rs is deprecated. Its replacement? It’s in a half ready beta state, and most of its developers are now focusing on a compatibility wrapper for MacOS, so progress is stalled. The ecosystem just isn’t there. System libraries have an interface that is extremely suited for C. Interfaces have to be uniquely adapted for rust or be marked completely unsafe. Dynamic linking is convoluted, so Rust encourages statically linking everything. It’s not easy, and the situation needs to improve or Rust will be relegated to just another text processing language. C library symbols need to be accessible as a first-class part of the language.
- jeroenhd 6y agoI agree the ecosystem isn't there yet, but given some time that will correct itself. Perhaps Rust will not be able to interface with Win32 because of its reliance on pointers, but there's the possibility of leveraging alternative programming interfaces such as the abstractions in the .NET runtime. I believe that if Python and Java can have cross-platform GUI libraries, so can Rust. I don't know what the result would look like but the tooling has already massively improved since I first looked into the language. I'm too annoyed at GTK for their obsession with client-side decorations messing up the native look on Windows and other platforms to use it for my own projects, but the Qt integration didn't look all that bad in my opinion. Rust-qt is clunky because the Qt API requires unsafe code, but with some work the unsafe parts can be abstracted away from the main program logic. It's suboptimal but it does allow you to do data and network traffic parsing and handling in a safe manner, which would already be a huge win for application security in my opinion.
- steveklabnik 6y ago(Rust can absolutely interface with Win32, and Microsoft themselves have implemented bindings to WinRT.)
- jeroenhd 6y ago
- axegon_ 6y ago> I do believe there's a "drop C and pick Rust" crowd, or multiple even. I wouldn't be surprised if there are multiple large communities that preach about nodejs replacing c. However I doubt anyone from the core rust developers lives with such illusions.
- jeroenhd 6y agoI agree. These small (but very vocal) groups don't represent the average Rust developer at all, even if Rust developers are often more evangelical than proponents of other programming languages. You need to look past the noisy zealots to see the real goals of the Rust team and its ecosystem.