Earlier quoted context omitted.
Data structures and algorithms are possibly the hardest part of Rust to dive into unless you have a really good reason. The best advice for newbies is to learn with other stuff and use existing algorithms. Of course, if you are trying to implement stuff for a class or something similar then you might be out of luck, and might consider trying the Rust IRC and such to work through the errors as they come up.
So what is the point of a language in which things are hard to implement?
Show HN: Algorithm Cookbook in Rust
31–40 of 73 posts
Re: Show HN: Algorithm Cookbook in Rust
#32"My other goal is to show developers that C++ and Java kinda suck" -- really?!
Re: Show HN: Algorithm Cookbook in Rust
#33This is great. I am curious if anyone else knows of a similar cookbook for Golang.
Re: Show HN: Algorithm Cookbook in Rust
#34A graph with the members first, next, and endpoints is not exactly self explanatory, something better than a "A compact graph representation" comment would be nice. Especially since the ownership model of rust makes the classic graph representation of edges owning nodes impossible.
Re: Show HN: Algorithm Cookbook in Rust
#35Earlier quoted context omitted.
Data structures and algorithms are possibly the hardest part of Rust to dive into unless you have a really good reason. The best advice for newbies is to learn with other stuff and use existing algorithms. Of course, if you are trying to implement stuff for a class or something similar then you might be out of luck, and might consider trying the Rust IRC and such to work through the errors as they come up.
So what is the point of a language in which things are hard to implement?
Rust tries to guarantee that you've implemented things correctly and safely, and therefore makes all the formal verification of such into a requirement.
Other low-overhead-bare-metal languages, meanwhile, trust you to have done the formal verification yourself using non-compiler-toolchain tools like linters and static analyzers.
The people who use these other languages who do ensure correctness+safety, will have done all the same work they do in Rust—just using third-party tools instead.
The people who use these other languages but who do not ensure correctness+safety, might seem to have an "easier time", but they will almost always end up with algorithms/data structures that—while seeming to work in most cases—have fatal flaws or vulnerabilities.
To use Rust is simply to sign up for "doing the work" of formally verifying your code up-front, rather than brushing it off as something to think about in some vague, undefined "later."
Re: Show HN: Algorithm Cookbook in Rust
#36To add to the list, here's my rust-noob implementation of the Kalman filter. https://github.com/rbagd/rust-linearkalman
GPL3 means it's not very reusable in any projects that aren't GPL3. Have you considered a BSD or MIT license? or CC0 if you want to get code reuse? Or at the very least LGPL2
Re: Show HN: Algorithm Cookbook in Rust
#37"My other goal is to show developers that C++ and Java kinda suck" -- really?!
Re: Show HN: Algorithm Cookbook in Rust
#38This is great. I am curious if anyone else knows of a similar cookbook for Golang.
I have implemented quite a few algorithms and data structures for fun here [1]. It's not authoritarive by any means, and not everything is in Go (there's also some Rust, Swift, TS and JS), but maybe a few things could turn up useful. [1] https://github.com/peferron/algo
Re: Show HN: Algorithm Cookbook in Rust
#39To add to the list, here's my rust-noob implementation of the Kalman filter. https://github.com/rbagd/rust-linearkalman
GPL3 means it's not very reusable in any projects that aren't GPL3. Have you considered a BSD or MIT license? or CC0 if you want to get code reuse? Or at the very least LGPL2
I think GPL3/MIT as a dual license should be a decent compromise.
Re: Show HN: Algorithm Cookbook in Rust
#40Earlier quoted context omitted.
So what is the point of a language in which things are hard to implement?
It's not any harder to correctly implement a data structure, even an "advanced" one, in Rust-with-unsafe than it is in C++-with-exceptions. I don't know where this meme comes from.