Live data from Hacker News

Welcome to Comprehensive Rust

google.github.io

121–130 of 204 posts

Re: Welcome to Comprehensive Rust

#121
post #65

Earlier quoted context omitted.

Checking the hash isn't relevant here. The content is served via HTTPS, you either trust the host or you don't. A host can easily serve you a malicious binary, as well as the valid hash of that malicious binary.

Which is why many people choose to only install software from their trusted distro maintainers who add a layer of vetting for random software packages, often built from source so messing with the package isn't possible without leaving some kind of trace that can be detected later.

Your distro's overworked maintainer isn't reviewing 15+ million lines of code included in Rust.

Most likely they get the precompiled rustc binary just like rustup, and LGTM-YOLO the package. If they try to be diligent, they maybe take extra 150K lines of mrustc code they can't reasonably carefully review for backdoors either, and then use it to bootstrap the several sets of 15M lines of code they won't look at.

Re: Welcome to Comprehensive Rust

#122
post #86

I still play with Rust (and Zig), but I have decided to put my work efforts into SPARK[1], the subset of Ada, for high-integrity software and formal verification. I know AdaCore and Ferrous Systems are collaborating in trying to bring a lot of Ada/Spark's capabilities to Rust, but this is still going to be some time. Ada has a longer legacy in this game. I am working on safety critical control systems and there is a…

Here’s a recent podcast episode that looks at Rust and Ada with some folks who work on Ada Core, https://rustacean-station.org/episode/067-quentin-ochem-flor...

Re: Welcome to Comprehensive Rust

#123
post #65
post #61

Earlier quoted context omitted.

You can't check the hash of something you immediately piping to your shell, for example.

Checking the hash isn't relevant here. The content is served via HTTPS, you either trust the host or you don't. A host can easily serve you a malicious binary, as well as the valid hash of that malicious binary.

Checking is the only reason that hashes are provided.

Re: Welcome to Comprehensive Rust

#124
post #89
post #39

It's kind of surprising to see that Rust is so rapidly accepted by wide range of developers. Unfortunately I'm from DataScience field, so I cannot see much motivation to learn Rust, but I am considering learning it, because language itself seems exciting! Is there anyone on HN who is from DataScience field like me and has learned Rust? It would be much appreciated if you could share the experience.

It is not rapidly and widely accepted. It is pushed by a small but very vocal minority for all the wrong reasons. When you have to prove your intelligence level (or rather "street cred") in a competitive market you have to show that you can learn the newest complicated things quickly. Rust is pure cryptonite in such a world.

> It is not rapidly and widely accepted.

It has been adopted by most large tech companies and several high profile open source projects within ~5 years of it's stable release. It certainly has been rapidly and widely accepted.

For important projects too: Google is using it in Android, Microsoft is using it in Windows, Amazon is using it for Lambda, Meta is using it for their source control tool, Dropbox is using for their storage backend AND in their client apps, Cloudflare is using it for their core proxy, etc.

Re: Welcome to Comprehensive Rust

#125

Why would one use this tutorial over the main https://doc.rust-lang.org/book/ ? Apart from the Android specific additions I mean.

From another comment: https://old.reddit.com/r/rust/comments/zrs1of/new_rust_cours...

Perfect. Thank you.

Re: Welcome to Comprehensive Rust

#126
post #56

Earlier quoted context omitted.

Rust is a safer C/C++. If you'd never consider writing anything in C/C++ (i.e. low-level code where performance is essential), you'll never use Rust.

That’s underselling it quite a lot. Rust has a number of features (ergonomic and technical) and some really nice language design that permits writing quite “high-level” code. Personally, having a compiler and type system as powerful as Rusts makes it worthwhile alone.

Most of those features are available in ML derived languages, without having to deal with Rust features that make it usefull C and C++ replacement.

With faster compiler toolchains and REPL like tooling.

Re: Welcome to Comprehensive Rust

#127
post #69
post #39

It's kind of surprising to see that Rust is so rapidly accepted by wide range of developers. Unfortunately I'm from DataScience field, so I cannot see much motivation to learn Rust, but I am considering learning it, because language itself seems exciting! Is there anyone on HN who is from DataScience field like me and has learned Rust? It would be much appreciated if you could share the experience.

I suppose if you're coming from Python, you could use Rust (with PyO3) instead of C/C++/Cython in something similar to the Numpy/ML lower-level implementations. But I wish there were a language that solved the two-languages problem (fast vs. easy to work with). I find Rust quite verbose.

Julia, Common Lisp, Scheme, OCaml, Haskell, F#, D,..

Re: Welcome to Comprehensive Rust

#128
post #82

Earlier quoted context omitted.

I'm also in the data science field, and I'm currently teaching myself rust as a possible replacement for C and C++ for all those times I have to write something fast and novel and that I can call from python.

That's exactly why our Data Engineering team is also looking at Rust, but we're looking at Go, too. I have a hunch that Rust is going to be a harder sell to the broader team given its learning curve and that most of the team don't already have a compiled language in their tool belt. I'm quite open to either, though, as they'd both make my pipelines go vroom.

Rust has the upper hand for incrementally replacing Python modules. With PyO3[0], you can seamlessly replace existing Python code with native extensions written in Rust.

If your use case is to replace entire tools, and your team isn't familiar with static languages, then Go is probably the better option. There's no denying that it's much easier to learn.

[0] https://pyo3.rs/

Re: Welcome to Comprehensive Rust

#129
post #109

Unrelated: but why does Google use Kotlin(for developing Android apps) and Rust when they have a nice little language in Go. Genuinely curious: Is Go not a good fit for developing Android apps(Is targeting JVM the concern?) or system programming(using Rust in Android systems), what does it lack?

I dont have first hand knowledge, but I've been in the space for 10 years and wrote Go, Java, Kotlin, so here is my take. Kotlin made a huge effort to stay compatible with Java. You can call Kotlin code from Java and Java code from Kotlin, so orgs could migrate their apps piece by piece. The only real incompatibilities that I've experienced were when going from C code via JNI into Kotlin. All sorts of really weird is…

The lawsuit excuse has always been quite a lame one, because regardless of Kotlin or Java, the whole Android development stack depend on the Java ecosystem for the IDE, Gradle, Maven Central based libraries, and Android team never made any effort to port anything on top of Kotlin/Native, or even improve it.

Re: Welcome to Comprehensive Rust

#130

Earlier quoted context omitted.

Rust does not guarantee that there are no memory leaks, you can have things reference eachother and therefore never count to 0. This is why weak pointers exist in rust.

It does not guarantee, but it is actually quite hard to cause a memory leak by accident, because at the same time Rust makes creating cycles hard.

You're incorrect, sorry. It's very easy to creat cycles in inner-mutable data structures (e.g. Rc).
Post reply on HN