Announcement
Collapse
No announcement yet.
GNOME's SVG Rendering Library Migrating To Rust
Collapse
X
-
Originally posted by atomsymbol
Rust enables programmers to reason about concurrency more easily than C/C++/Java/etc. In the long term (20+ years), such programming languages are basically predetermined to take over the current languages, although the language that will emerge as the most widely used one might not be Rust.
A programming language is just a tool. A program is not good or bad specifically because of it. It's good because it's either got a useful purpose and works reasonably well, or bad if it fails either of those points. Thinking your program is great because you used some specific tool to program it is like owning a 4-wheel-drive truck that has to be dug out of the snow bank because you thought your safety in driving was only about the tool (the truck with 4WD) and not the other tool (the user) doing the driving.
Those of us who have to deal with these kinds of technologies at our jobs and end up supporting applications written in dead languages that were once "fads" find the people who push for using these technologies arrogant, and we don't think those people know better, even though they claim to. We've been there.Last edited by Holograph; 06 January 2017, 12:15 PM.
Comment
-
Originally posted by Holograph View PostThis is the precise reason not to use it in my opinion. Not because it's particularly worse, but many of us have seen programming languages and other technologies come and go. Lots of languages over the years have tried to replace C. Even if a language is better it is no good to me as a programmer if I have to port it in a few years.
Every programming language that has come out has been too afraid to approach C. C++ chose to be a superset, and a poorly-written one at that. Since then, languages have been running away into their little virtual machine and garbage collection corners, hiding from resource management as much as possible. Rust has changed that, aiming for low level resource management and merging it with a powerful type system featuring zero cost higher level abstractions, functional programming concepts, generics, and even more importantly and unrelated to the language design itself: Cargo. It has a serious following behind it with more momentum than any other language. Rust has more signs of success than any language to ever have existed.
The argument about needing to port your software in a few years is completely and entirely invalid. List one programming language as extensive and ambitious as Rust that is aiming for the same thing: Zero. Name one programming language currently in development that could be ready to contend against Rust in the next five years: None. The amount of work that would be required to create a programming language to replace Rust at this point would be monumental, with no benefits.
Rust is backed by an extensive degree of research and community contributions. There's a large language RFC GitHub project littered with intense discussions on various aspects of language design. There are many in the Rust team that have PhDs in computer science and have enacted many bleeding edge programming language technologies and come up with killer features of their own (borrowing+ownership+move semantics+lifetimes). There is still much work being done to improve the language with evolutions to existing concepts, like this. There is serious infrastructure in place: there's a dedicated documentation team generating the best language documentation, a series of official website resources and services (Crates.io, Docs.rs, etc.), a global community software repository that expanded upon NPM's idea, a powerful toolchain manager that enables cross-compiling and convenient installation on any platform, a team that's reachable on IRC by any organization wanting to collaborate (GNOME's team has been in private discussions with Rust's team on shifting to Rust), and more importantly, a large community backing the project.
A language is no better to me as a user if it ever causes any sort of dependency problems - though admittedly I have that issue far more often with scripting languages than I do with compiled languages.
A programming language is just a tool. A program is not good or bad specifically because of it. It's good because it's either got a useful purpose and works reasonably well, or bad if it fails either of those points. Thinking your program is great because you used some specific tool to program it is like owning a 4-wheel-drive truck that has to be dug out of the snow bank because you thought your safety in driving was only about the tool (the truck with 4WD) and not the other tool (the user) doing the driving.
Do you have any software that interacts with the Internet or are critical system libraries? Can you guarantee that your software is free of fatal security issues and exploits as a result thereof? Rust provides a number of interesting technologies that are of high interest to security-minded engineers. There's a new Rust-written memory allocator that's quite a bit more flexible than existing memory allocators. It provides some optional security features that are pretty interesting. There's also a concept going around to add the ability to shuffle fields in structs randomly in order to further protect against exploits that require data to be at specific offsets within a structure. This is in addition to the existing features that eliminate an entire class of security issues. The type system, lifetimes, borrowing and ownership -- it's been wonderful at preventing a large degree of software design fatalities.
Do you have software that is really slow? Mainly speaking of software that is not C/C++, Rust is the best option. You have all the low level resource management of C, but better features than C++. Even comparing a Rust project to a C/C++ project, often times the Rust project will come out on top in benchmarks. Why? Because Rust enables the programmer to reason about more complex optimizations that would otherwise be particularly incredibly dangerous to do within C and C++. While a C++ programmer might opt for a shared_ptr because that's the safe thing to do, a Rust programmer would go farther in optimizations because they do not need to fear the same safety concerns.
Those of us who have to deal with these kinds of technologies at our jobs and end up supporting applications written in dead languages that were once "fads" find the people who push for using these technologies arrogant, and we don't think those people know better, even though they claim to. We've been there.
- Likes 1
Comment
-
Originally posted by ldo17 View Post
Oxygen is paramagnetic (attracted by magnetic fields), did you know? Yet it is not a metal, nor can it rust.
I like how some people are discussing actual rust instead of the programming language
Comment
-
Originally posted by Master5000 View PostYou still didn't answer. Why should hundreds of millions of lines of code be rewritten in your toy fad language? Instead of, you know, progressing by contributing code to existing codebases instead of going back to the 70's and restarting history. Admit it. Rust is fucked.
(Dependencies being rewritten in Rust certainly does simplify reliable setup build environments and ease fully static compilation, but things like Go's native TLS library have already proven that people will rewrite the most important pieces if it really matters enough.)
Hell, if that were a requirement, C would be considered a failure because of all the FORTRAN code still chugging away in places like the BLAS implementation various applications in your Linux distro may depend on.
Originally posted by Master5000 View PostWhat it's trying to do is impossible. You're asking to stop progress in order to recreate everything. Nobody will do that.
Who knows whether it will ever become "hundreds of millions of lines of code", but it's clearly not "nobody".
- Likes 1
Comment
-
Originally posted by mmstick View Post
Basically, undefined behavior is considered a bug in Rust. Rust is designed so as to not allow for undefined behavior, not even in unsafe code.
https://doc.rust-lang.org/nightly/re...ered-undefined
BUT: the compiler will only check for safe code (which is most of it) that these kinds of behavior do not exist in your program.
For code in 'unsafe {…}' blocks, it will blindly assume (just as a C compiler would for the entire program) that it does not allow such behaviour to be triggered, even indirectly through instructions outside of the blocks (do note however that the typesystem is still active in unsafe blocks, it's just relaxed far enough that it doesn't disallow certain instructions which can lead to undefined behavior). It is upon yourself as an author of such 'unsafe' blocks to make sure that the code is in fact not unsafe.
This is why there have been discussion among developers of the language/compiler (i. e. before stabilization in 1.0) to rename the keyword to 'trustme' or similar.
I, too, like the language, but don't promise things the compiler cannot deliver.Last edited by CrystalGamma; 07 January 2017, 12:47 PM.
Comment
-
Originally posted by Master5000 View Post
You still didn't answer. Why should hundreds of millions of lines of code be rewritten in your toy fad language? Instead of, you know, progressing by contributing code to existing codebases instead of going back to the 70's and restarting history. Admit it. Rust is fucked. What it's trying to do is impossible. You're asking to stop progress in order to recreate everything. Nobody will do that.
Additionally, if you are saying that nobody is interested in rewriting software, then the very article that you are posting on is proof that you are wrong. I, myself, have even recreated most of the functionality of GNU Parallel with a Rust implementation by myself in no time at all.
Comment
-
Originally posted by mmstickOn the contrary, moving to Rust has decreased the amount of memory that librsvg consumes and reduced required CPU cycles.
Originally posted by mmstickThe argument about needing to port your software in a few years is completely and entirely invalid. List one programming language as extensive and ambitious as Rust that is aiming for the same thing: Zero. Name one programming language currently in development that could be ready to contend against Rust in the next five years: None. The amount of work that would be required to create a programming language to replace Rust at this point would be monumental, with no benefits.
Originally posted by mmstickIt also allows one to conveniently perform mass refactoring on a whim with zero issues, which is something that C and C++ codebases cannot do.
Originally posted by mmstickYou have all the low level resource management of C, but better features than C++.
Don't get me wrong though, I think rust is a great language, just some of your claims go a bit too far.
Comment
-
Originally posted by ⲣⲂaggins View Post
As for reduced memory usage and cpu cycles, since librsvg uses glib internally, it seems you'd actually be comparing rust containers vs glib containers, not rust vs C/C++. Glib is not exactly renowned for its efficiency - it uses its own hand-rolled C version of everything, including reference-counting. A legitimate comparison target would be idiomatic modern C++.
Err... one? Doesn't D count anymore
Qt creator provides highly convenient mass refactoring tools for C++, though its code model doesn't properly handle templates. If you really want perfect refactoring, there are several refactoring tools (github) using clang's astmatchers library, which being integrated directly with the compiler, guarantee zero issues. So that claim is untrue.
O rly? On stack overflow this would undoubtedly be met with cries of "Better features?! Define better.". It certainly has more features than C, but to say the same for C++ would be ridiculous. If anything it has fewer features, for example rust is sorely lacking an equivalent of subclasses and overriding. Its only substitute to C++'s polymorphism seems to be traits and recursive types, which are a rather less powerful substitute.
Aside from technical superiority, there are huge benefits to choosing Rust over C++. Namely, whereas C++ programmers must always be stuck in defensive programming practices and avoid optimizations that are particularly dangerous by standing 10 feet away from the line (ie: using shared_ptr when not needed), Rust programmers are able to comfortably toe the line and perform more excessive optimizations, safely.
And of course, the rust features C++ didn't already have, C++1z has totally stolen - optional/any/variant, string_view, structured bindings, etc.
Don't get me wrong though, I think rust is a great language, just some of your claims go a bit too far.
Comment
Comment