Live data from Hacker News

Welcome to Comprehensive Rust

google.github.io

191–200 of 204 posts

Re: Welcome to Comprehensive Rust

#191
post #149

Earlier quoted context omitted.

I get those with Go and I have blazing fast compile times too.

Go is not a C/C++ replacement. Rust is.

Rob Pike did intend Go to be a C++ replacement for some use cases:

  I was asked a few weeks ago, "What was the biggest surprise you encountered rolling out Go?" I knew the answer instantly: Although we expected C++ programmers to see Go as an alternative, instead most Go programmers come from languages like Python and Ruby. Very few come from C++.

  We—Ken, Robert and myself—were C++ programmers when we designed a new language to solve the problems that we thought needed to be solved for the kind of software we wrote. It seems almost paradoxical that other C++ programmers don't seem to care.
Source: https://commandcenter.blogspot.com/2012/06/less-is-exponenti...

Re: Welcome to Comprehensive Rust

#192
post #191
post #149

Earlier quoted context omitted.

Go is not a C/C++ replacement. Rust is.

Rob Pike did intend Go to be a C++ replacement for some use cases: I was asked a few weeks ago, "What was the biggest surprise you encountered rolling out Go?" I knew the answer instantly: Although we expected C++ programmers to see Go as an alternative, instead most Go programmers come from languages like Python and Ruby. Very few come from C++. We—Ken, Robert and myself—were C++ programmers when we designed a new l…

The sort of people who used C++ and thought "if only I could have garbage collection!" all moved to Java well before Go got a foothold.

Re: Welcome to Comprehensive Rust

#193
post #138

Earlier quoted context omitted.

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.

It's nowhere as ergonomic, for the general population, as the likes of Python. References alone add a level of bothersomeness to the language that dramatically restricts its appeal. Rust has a great role to play, replacing C and C++ in all performance-critical and security-critical underpinnings of modern computation (from kernels to UI toolkits). But higher up the stack, where those concerns are outweighed by overal…

> higher up the stack, where those concerns are outweighed by overall development costs, other languages will continue to rule;

Eh, I've written and maintained data pipelines, and API layers for downstream teams in prod in Rust, and it was a much more pleasant and low-effort experience than either doing either in Python. I could have had a "complete program" written first in Python, sure, but that gain in velocity is rapidly overtaken by the hours spent debugging and fixing issues in prod, issues that in Rust, I've not typically had.

> if one's focus is there, learning Rust is probably a waste of time.

au contraire - I genuinely think that learning languages, especially ones that are _not_ similar to your day-to-day language is an incredibly valuable thing to do. Learn a Lisp, learn some Haskell, etc, it exposes you to ideas that you wouldn't have otherwise come across, and gives you extra skills and tools with which to solve problems better. Maybe not all those tools are always applicable, but when they are it's a force-multiplier.

Re: Welcome to Comprehensive Rust

#194
post #126

Earlier quoted context omitted.

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.

You're not wrong. Ocaml, Haskell, etc are pretty slept on, and have some amazing features, and I 100% think people should be more open to using them.

In my space (data engineering and associated systems), Rust is a much more palatable and easier sell than an Ocaml or a Haskell.

> With faster compiler toolchains and REPL like tooling.

TBH I don't really miss a REPL, I know a lot of people love it, but between the type system, tooling like RA, and how Rust makes writing tests _so_ frictionless, I've not really had any need to touch a REPL in the last ~2 years. I've probably been abusing the frictionless test functionality to write little snippets to test out using a new library or tool, I certainly find it a lot manual work than the "type multi-line snippet into repl. Make a typo. Start it all over again. Discover that part x actually wants a y. Write it all over again. Repeat until correct. Painstaking trawl through repl history to find the set of code that actually does what we want and lift it into our actual code base" experience I have with reps-based development.

Re: Welcome to Comprehensive Rust

#195

The first thing I implore everyone to do when evaluating Rust is to check out a non trivial project and start hacking on it. I have always found the compiler to be unacceptably slow in these cases, especially if you come from C rather than C++. If you work your way up from Hello World you may not ever notice this until you already invested a substantial amount of effort.

Splitting your projects in smaller packages by using workspaces helps a lot reducing the compile time.

Re: Welcome to Comprehensive Rust

#196
post #185
post #179

Earlier quoted context omitted.

> Not in the age of microservices. There's a huge world outside of microservices. > Language constructs only help if there are no other applications accessing the same resources. You're mistaken. Rust's language constructs can often help you write safe wrappers around inter-process communication and synchronization mechanisms. Of course, all bets are off if the other processes don't adhere to the agreed-upon IPC prot…

That is indeed the point, as most projects don't use a single language in isolation.

So now you're arguing that Rust won't help because it doesn't fix the deficiencies of other languages? So what? At least you'll have fewer defects in those parts that do use Rust.

Re: Welcome to Comprehensive Rust

#197
Thanks for posting the link and thank you very much to everyone who have sent us PRs over the last 24 hours!

Please keep submitting them. You can use the little pencil icon in the top-right of any page to quickly submit a typo fix patch. I'm from Denmark and English is not my first language — I very much appreciate the help from you to fix all the grammar mistakes :-)

Re: Welcome to Comprehensive Rust

#198
post #180

Anyone happen to have this in EPUB or PDF format (for an ebook reader)?

The course is meant to be interactive, which means that you should try out the embedded code snippets. You can edit them and run them from your browser :) However, if you really want a PDF, then use the print page[1]. It will let you produce a ~210 page PDF with the entire course.

For learning Rust via a non-interactive medium, I recommend the Rust Book[2]. It has all the narrative that the course material is missing.

[1]: https://google.github.io/comprehensive-rust/print.html

[2]: https://doc.rust-lang.org/book/.

Re: Welcome to Comprehensive Rust

#199
post #118

Earlier quoted context omitted.

The bash timing exploit makes everyone focus just on how cleverly evil it can be, and forget the big picture that it's about trusting the Rust org not to screw you. (BTW, you can run `curl | sh` in a VM or with a modified bash to intercept the code and catch the bash script in the act, so it's not actually as sneaky as people believe). If you think the Rust org is going to pwn you in a clever sneaky way, then you can…

I call this the "Lie back and think of England" stance. You're not wrong, until the end, it should be: "you have to distrust the Rust org, all of it." And not just Rust, Python and JS and all the others. There are languages and systems that take trust and security seriously, but these are not they.

Pray tell us, which languages do take trust and security seriously, according to you?

Re: Welcome to Comprehensive Rust

#200
post #199

Earlier quoted context omitted.

I call this the "Lie back and think of England" stance. You're not wrong, until the end, it should be: "you have to distrust the Rust org, all of it." And not just Rust, Python and JS and all the others. There are languages and systems that take trust and security seriously, but these are not they.

Pray tell us, which languages do take trust and security seriously, according to you?

(Is it that you don't know of any yourself? Or that you think I can't provide examples? In what world is what I said even slightly controversial? Type checking is just catching on now, decades after it was invented and implemented. C'mon.)

Anyway, off the top of my head, Ada.

https://en.wikipedia.org/wiki/Ada_(programming_language)

and E...

https://en.wikipedia.org/wiki/E_(programming_language) https://en.wikipedia.org/wiki/CapROS

Qubes and SEL4 are Operating systems. (OK Labs was acquired by General Dynamics. That seems like a pretty good recommendation to me.)

https://en.wikipedia.org/wiki/Qubes_OS

https://en.wikipedia.org/wiki/L4_microkernel_family#High_ass...

Post reply on HN