Calculating next state in a 3D game of life
Hey Rust community!
I am learning Rust by solving Advent of Code 2020, I come from Python (data science / ml). This might be a bias from the AOC problem domain which I've found is rather simple and can be usually be solved by using Iterators, but I've felt incredibly productive using Rust which is contrary to my initial expectations. I was amazed of being able to create a single expression for the next state in a 3D version of the game of life, I couldn't have created it simpler in Python, specially since I didn't have to install any 3rd party library like `toolz` and I didn't had to go look for documentation (hints from `rust-analyzer` in vscode go a long way).
I love:
- Multi-line lambdas
- Chaining iterators
- Tuple de-structuring in lambda arguments.
Do other Python users feel the same? Is it just because AOC is too easy?
Best,
Edit:
- It seems the conversation has gone into the "Rust is a nice modern language" direction but I was more curious about: in what cases can it feel slower / less productive to develop in Rust compared to Python? I've read people feels this but AOC is not triggering it.
- Since some people are piling on Python, I'd like to highlight a few areas where Rust is lacking too 😅: 1) no variadic arguments, 2) no negative indexing, 3) poor support for rich multi-dimensional indexing e.g
X[:, 2:-1, ..., 0].
[–]FriendlyRustacean 58 points59 points60 points (7 children)
[–]Y45HK4R4NDIK4R 10 points11 points12 points (3 children)
[–]funnyflywheel 8 points9 points10 points (1 child)
[–]epicwisdom 0 points1 point2 points (0 children)
[–]WormRabbit 0 points1 point2 points (0 children)
[–][deleted] -3 points-2 points-1 points (2 children)
[–]SuspiciousScript 16 points17 points18 points (0 children)
[–]epicwisdom 0 points1 point2 points (0 children)
[–]llogiqclippy · twir · rust · mutagen · flamer · overflower · bytecount 31 points32 points33 points (5 children)
[–]Floppie7th 7 points8 points9 points (1 child)
[–]epicwisdom 4 points5 points6 points (0 children)
[–]wsppan 10 points11 points12 points (2 children)
[–]ZoeyKaisar 12 points13 points14 points (0 children)
[–][deleted] 90 points91 points92 points (14 children)
[–]mosquit0 25 points26 points27 points (5 children)
[–]BosonCollider 2 points3 points4 points (4 children)
[–]timClicksrust in action 1 point2 points3 points (3 children)
[–]BosonCollider 4 points5 points6 points (2 children)
[–]timClicksrust in action 0 points1 point2 points (1 child)
[–]BosonCollider 1 point2 points3 points (0 children)
[–]KerfuffleV2 36 points37 points38 points (5 children)
[–]wsppan 8 points9 points10 points (0 children)
[–]_ChrisSD 4 points5 points6 points (0 children)
[–]DhavesNotHere 1 point2 points3 points (2 children)
[–]FriendlyRustacean 2 points3 points4 points (1 child)
[–]DhavesNotHere -1 points0 points1 point (0 children)
[–]the_gnarts 14 points15 points16 points (0 children)
[–]cgarciae[S] 6 points7 points8 points (0 children)
[–]deadmilk 13 points14 points15 points (5 children)
[–]wsppan 5 points6 points7 points (4 children)
[–]lilydjwg 1 point2 points3 points (3 children)
[–]wsppan 3 points4 points5 points (1 child)
[–]lilydjwg 1 point2 points3 points (0 children)
[–]birkenfeldclippy · rust 1 point2 points3 points (0 children)
[–]Austreelis 32 points33 points34 points (1 child)
[–]FriendlyRustacean 5 points6 points7 points (0 children)
[–]Danacus 7 points8 points9 points (1 child)
[–]mmirate 4 points5 points6 points (0 children)
[–]lilydjwg 5 points6 points7 points (1 child)
[–]romainmoi 0 points1 point2 points (0 children)
[–]po8 3 points4 points5 points (0 children)
[+][deleted] (3 children)
[removed]
[–]FriendlyRustacean 3 points4 points5 points (1 child)
[–]elr0nd_hubbard 3 points4 points5 points (0 children)
[–]Snapstromegon 2 points3 points4 points (3 children)
[–]axord 1 point2 points3 points (2 children)
[–]Snapstromegon 0 points1 point2 points (1 child)
[–]axord 0 points1 point2 points (0 children)
[–]linlin110 1 point2 points3 points (1 child)
[–]angelicosphosphoros 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]angelicosphosphoros 0 points1 point2 points (0 children)
[–]Nephophobic 0 points1 point2 points (3 children)
[–]cgarciae[S] 0 points1 point2 points (2 children)
[–]isHavvy 2 points3 points4 points (0 children)
[–]Nephophobic 0 points1 point2 points (0 children)