5 ms·
Well, that's down to practice. And on that subject... One thing I like to do with a new language is to re-implement a self-contained but non-trivial program th
by scrumper 9y ago
Well, that's down to practice. And on that subject...
One thing I like to do with a new language is to re-implement a self-contained but non-trivial program that I've built before. I have a few but my favorite is a genetic algorithm which breeds rule sets for a cellular automaton to get the CA to solve some simple computation problems. It's not at all complex, a few hundred lines when done in Python, but it's more than a tiny example. I like it for learning new languages as it touches on various data structures, it's inherently parallelizable, it's not especially bound to any particular programming paradigm, it lends itself to exploring various useful concepts and constructs (function pointers, closures, recursion, etc.), and it is fun and interesting to work on.
So maybe you have something similar, something where you really understand the problem and the solution, freeing your brain to focus entirely on seeing how it would map to Rust.
- galangalalgol 9y agoI have been looking for such a problem to use as you to, to kick the wheels of languages. I would like to also include some basic linear algebra and/or signal processing to test numeric stuff. But do you have an example upbon github or similar? I've got a couple decades of c++ experience and I'd like to move more into rust for my home projects but I haven't had one that really tested me with data structures and threads.
- scrumper 9y agoI'm still in the early stages with this one in Rust. I spent a lot of time this weekend on it and I'm finding no exaggeration in those stories of fighting the borrow checker! It's been a pig, honestly. I am OK with the point of it all, if anything it's made me more aware of limitations of not taking this strict approach in other languages. I can see all sorts of possible bugs that can't happen in Rust. Doesn't make writing it any easier. I'm starting to think that Rust is really just a clever set of constraints that forces good behavior on the programmer. Happy to throw the Python stuff over the wall at you although it isn't especially pretty (it was my 'learn Python' project). I'll put it up on Github this week & ping you back here.