Live data from Hacker News

Welcome to Comprehensive Rust

google.github.io

81–90 of 204 posts

Re: Welcome to Comprehensive Rust

#81
post #3

Is this “just” a 20% project or is this more significant (like Android one day supporting Rust to develop apps)? And I haven’t looked at everything yet, but it suggests to install Rust like this: sudo apt install cargo rust-src While everyone I know uses rustup^: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ^ https://rustup.rs/

Hi, I wrote the course :-) Yes, this is a real thing — Android has had support for Rust in the Android Platform for a few years now. Most recently, we shipped support for DNS-over-HTTP/3: https://security.googleblog.com/2022/07/dns-over-http3-in-an... We put out the course to make it easy for even more people to onboard with Rust.

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.

Re: Welcome to Comprehensive Rust

#82
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'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.

Re: Welcome to Comprehensive Rust

#83
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 started learning Rust a few years ago, with the intention to use it for data science.

I ended up writing a book, "Data Analysis with Rust Notebooks", where I demonstrate using Rust + Jupyter Notebooks for tasks I'd normally use Python for. It's a good experience, although there are some additional limitations when using Rust as a notebook kernel.

[1] https://datacrayon.com/shop/product/data-analysis-with-rust-...

Re: Welcome to Comprehensive Rust

#84
post #63

Earlier quoted context omitted.

On the other hand, I've always found it surprisingly easy to dive into non-trivial rust projects and start contributing, at a speed that would be unthinkable in C or C++. So I second the advise for non-trivial projects, they give a much better idea of the upsides and downsides of rust.

Is that really due to the language or that we collectively have become better in structuring software projects?

People have become not just better at structuring projects, but also at writing standard libs and programming languages.

Many features gained a lot of adoption accross languages over the last two decades, like anonymous functions (with convinient arrow syntax), explicit option types instead of implicit null/undefined, match constructs, well-integrated library management, for(each) loops using iterators instead of indices, map/reduce functional iterators, etc. Rust has the advantage of being able to make these core parts of the language and standard library, resulting in an overall more expressive language.

And in rust's view these features should not only be used to make coding more convinient, but also to encode intent and make undesirable things impossible. This is reflected in the standard library (for example it's impossible to access the data protected by a mutex without locking it), and the philosophy is copied by the ecosystem.

Re: Welcome to Comprehensive Rust

#85
post #63

Earlier quoted context omitted.

On the other hand, I've always found it surprisingly easy to dive into non-trivial rust projects and start contributing, at a speed that would be unthinkable in C or C++. So I second the advise for non-trivial projects, they give a much better idea of the upsides and downsides of rust.

Is that really due to the language or that we collectively have become better in structuring software projects?

It's at least partly due to the build tooling. `git clone ... && cargo build` (and `cargo test` too) "just works" for 99% of the Rust projects I have interacted with. And it generally works just as well for projects that have been abandoned for 5 years as it does for well maintained projects. The ones it doesn't work with it's usually because they depend on a C or C++ library!

Build tooling for the C/C++ ecosystem is a mess.

Re: Welcome to Comprehensive Rust

#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 lot to prune from existing work in this area in SPARK and Ada.

This book[2], "Building High Integrity Applications with SPARK" really sold me on the benefits. It is a great intro of how SPARK was used for the CubeSat program at Vermont Technical College (VTC). A CubeSat was successfully launched in 2013. I could not find any critical mission software written in Rust yet especially that far back.

I found Julia's selection for a flight collision avoidance system perplexing[3], but it proves a PLs syntax and evangelism (maybe not in this case), can bias a selection of a PL for such tasks. People find Ada/SPARK's syntax and methods verbose and similar to Pascal or other PLs, however, I was up and running quickly in it as opposed to Rust.

You can program to bare metal in SPARK, and the tools are already there to provide high-integrity software. The tools for SPARK automate most of the verification. Most of Rust's wishlist is already in SPARK (and Ada). I hope the Ferrous Systems and AdaCore collab bears fruit for Rust, but I have been programming since 1978, and I play with many PLs, but I found Rust's initial learning curve very off putting and I don't have the time to wait for it to mature to SPARK's level. And this is from someone who loves J/APL/BQN and Lisp, so I have no issue with different programming paradigms. I found Zig much easier to get things done from the start, although it does not strive to be a SPARK or Rust.

[1] https://www.adacore.com/sparkpro

[2] https://www.amazon.com/Building-High-Integrity-Applications-...

[3] https://juliahub.com/case-studies/lincoln-labs/

Re: Welcome to Comprehensive Rust

#87
post #71
post #52

Earlier quoted context omitted.

Actually no, one can detect curl-piping server-side and serve hostile blobs only to those foolish enough to do so: https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-b...

I'm well aware of that attack, it's quite cute, but if you don't trust the host not to serve you a backdoored binary then you've already lost.

And where is this trust supposed to come from? I downloaded the thing manually, looked at the scripts, ran the binary in a sandbox, it seemed to be OK. Right, I'll recommend that everyone just curl | bash's it ...

I think the worst thing about this is that Rust is fashionable, so encouraging inexperienced devs think that these dangerous practices are just fine. Look around at how many n00b projects now suggest doing exactly the same thing. It's simply irresponsible of the Rust crowd to keep promoting it.

Re: Welcome to Comprehensive Rust

#88
post #82
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'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.

Re: Welcome to Comprehensive Rust

#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.

Post reply on HN