A half-hour to learn Rust
151–160 of 342 posts
Re: A half-hour to learn Rust
#152So Rust is Scala but with some extra complicated additional syntax around borrowing references and generic lifetime constraints.
Re: A half-hour to learn Rust
#153Earlier quoted context omitted.
I should have said :) I am writing backtracking algorithms (think something like a Sudoku solver where we fill in values by guessing), and an 'Error' is when we can deduce the Sudoku cannot be filled in, so we have to backtrack. I find Rust's ? notation gives a very natural way of writing such algorithms. I don't care "why" filling in the Sudoku failed, particularly because the solver will typically fail millions of…
I would suggest Option is the more semantic type to use for your situation - None indicating no valid solution on this path
Re: A half-hour to learn Rust
#154So Rust is Scala but with some extra complicated additional syntax around borrowing references and generic lifetime constraints.
Scala has many features Rust does not have as well.
The extreme degree of shared syntax and shared semantics with Scala was really surprising to me.
Re: A half-hour to learn Rust
#155So Rust is Scala but with some extra complicated additional syntax around borrowing references and generic lifetime constraints.
Re: A half-hour to learn Rust
#156Earlier quoted context omitted.
Scala has many features Rust does not have as well.
Yeah, when reading this I was wondering if Rust has sealed traits like Scala, and also structural typing. The extreme degree of shared syntax and shared semantics with Scala was really surprising to me.
A lot of Rust’s language people did a lot in Scala. The language’s are pretty different IMHO.
Re: A half-hour to learn Rust
#157 let x;
foobar(x); // error: borrow of possibly-uninitialized variable: `x`
x = 42;
possibly-uninitialized - Why does the compiler sound uncertain while emitting an error?Re: A half-hour to learn Rust
#158let x; foobar(x); // error: borrow of possibly-uninitialized variable: `x` x = 42; possibly-uninitialized - Why does the compiler sound uncertain while emitting an error?
It also is language that works well when something may be initialized in some control flow paths but not all.
Re: A half-hour to learn Rust
#159That is the best article on Rust I've ever seen. Better than the Rust book. I've been saying that Rust needed a book that wasn't written by the designers of the language, who are too close to it. Now we have one.