Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.arch Subject: Re: Rust (was: Optimization by programmers) Date: Tue, 06 Oct 2026 05:01:32 -0700 Organization: A noiseless patient Spider Lines: 54 Message-ID: <861pa3m40z.fsf@linuxsc.com> References: <1177fdi$26ea4$1@dont-email.me> <119btc7$1n32h$1@dont-email.me> <86bj9hr91x.fsf@linuxsc.com> <20260928195833.00001d42@yahoo.com> <119j4g4$4kn$1@reader1.panix.com> <119jbt5$cn3a$1@dont-email.me> <86pkxtplou.fsf@linuxsc.com> <119otm8$2c89q$2@dont-email.me> <86ik3jo1js.fsf@linuxsc.com> <2026Oct3.131214@mips.complang.tuwien.ac.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Tue, 06 Oct 2026 12:01:36 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1997811"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19mnh5HEgI54pcZGLSLfqRaDMDxXQZKmBQ="; posting-host="0b1fc18b52208379029243b7b311a32b" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:WrMprhJxRd0v0Rb63HyZvzaue/Y= sha1:rV0PhwHT0YBysKdHJJttQYN7QaM= sha256:+/kAamiYch6t9INEqXvyiyp9GWRvrhXVgx8rEYTcbAs= sha1:5SICjZujKHjuPLaZb67sEXZ6BOw= sha256:ZsGhtZLBiJzamN8xSvosiWB9KEnyxyhmfMLlx4wsOHI= Xref: csiph.com comp.arch:118495 anton@mips.complang.tuwien.ac.at (Anton Ertl) writes: > Tim Rentsch writes: > >> That's good to know but what is a good resource to learn the Rust >> language? I've looked at the Rust book several times and each >> time come away rather frustrated. > > If you mean "The Rust Programming Language", I came away from it > disillusioned. Yes, that's the book I meant. > The reason was that I could not get a search-tree insertion technique > to work that can be implemented in e.g., Pascal, C, and Forth, but not > in Java (because in Java I cannot produce references to a field inside > an object). > > At some point I thought that one would have to use the more > heavy-weight reference-counting stuff to get through the borrow > checker. [discovered later not to be necessary] I think this test case is a good one. Somewhat disappointing that Rust makes it non-obvious. Do you know if what you learned would carry over to, for example, AVL trees? > Then I found the book "Learn Rust With Entirely Too Many Linked > Lists", and I found that the problem could be solved without reference > counting after all. Thank you for this reference. I am just starting to look it over. Do you know if there is a PDF version somewhere rather than the endless-series-of-webpages format shown on its website? > However, the problem in this case is the usual > thing with type inference: There is so much going on that happens > automagically (in particular automatic dereferencing in Rust), and the > Rust compiler does not know where you went wrong, so the error message > is unhelpful (while for the simpler cases the compiler usually guesses > right and gives very helpful, to-the-point error messages). Hmm. That might be worth my while doing some web research for. > Even after reading the second book, I am still disillusioned with > Rust. The Rust fans tend to say: "If it compiles, it runs." The > problem is that it can be harder to get a Rust program to compile than > to debug a program in, say, Forth (which has barely any checking). > For debugging, I at least have a method on how to proceed. When I get > an unhelpful compiler error, I am left to trying various things, > blindly. Can I ask how much experience you have with ML-style languages (e.g., ML, OCaml, Haskell)? I'm wondering how the type inference in Rust compares to the type inference done in those languages.