3 ms·
> But Rust’s memory rules aren’t more secure than Node.js’s or Python’s. Your web application written in Rust isn’t going to be systematically more or less secu
by epage 6y ago
> But Rust’s memory rules aren’t more secure than Node.js’s or Python’s. Your web application written in Rust isn’t going to be systematically more or less secure than an application in Python or Ruby.
Just want to call out that I've heard a horror story of a very bad security bug due to implicit shared mutability in Python.
(vague to protect the innocent)
> Heck, if you ask some people, Rust is less secure than a GC’ed language for web apps if you use any crates that have unsafe code - which includes Actix, the most popular web framework, because unsafe code allows things like deferencing raw pointers.
You can write unsafe code in Python (and some of the web frameworks use this) and nothing helps you with auditing it, unlike unsafe blocks in Rust.
- aidenn0 6y ago> > Heck, if you ask some people, Rust is less secure than a GC’ed language for web apps if you use any crates that have unsafe code - which includes Actix, the most popular web framework, because unsafe code allows things like deferencing raw pointers. > You can write unsafe code in Python (and some of the web frameworks use this) and nothing helps you with auditing it, unlike unsafe blocks in Rust. This was the dumbest part of TFA Python and Node both have parts of their runtimes, standard libraries, and extension libraries written in C and C++. Last time I checked, C and C++ allow dereferencing raw pointers.
- hckr1292 6y agoYeah, the very type-centric programming flavor of the ecosystem and strict type checking in the compiler mean that Rust developers will generally leverage guarrantees from the Rust compiler for all sorts of interfaces that you would never do in Python or Nodejs. It's frankly annoying in the kind of web api context that this author is describing and is another source of lost productivity. So, Ruby has Rails, PHP has Drupal/Wordpress/etc, Python Django. However, neither Go nor Rust have a mature framework that makes it easy to spin up a CRUD app. I'm hopeful that some sort of project in Rust will rise up along the lines of Flaskrestplus in which resources are the primary abstractions. Resources could have codegen'd frontends built using something like react-admin so that you could build a fully functional web form in 100 loc or less. There's no reason the frontend bits couldn't be shared by Rust and Golang (and C++, D, Haskell, etc) frameworks.
- issamehh 6y agoAt what point do we consider a franework mature? I've done a number of CRUD apps in Rust at this point and I have to say the frameworks I've used have made it dead simple. So simple actually that I loathe having to do so in other languages. The ecosystem beyond just the web portion is truly amazing, something like serde is a wonferfully powerful tool. I won't claim that something like Rocket is finished as there are still things to be done, but at what point do you consider it to be mature?
- labawi 6y agoFor security there are much more important aspects than memory security (memory safe is better, where Rust is probably on par with Python and Ruby). While I use neither Rust nor Ruby, they seem to have a very different attitude towards explicit vs. implicit expressiveness and exact, correct code. I'd trust explicit code much more than spooky-action-at-a-distance and it-works-dont-ask-me-how.