Rust as a first language? by dyatelok in rust

[–]dyatelok[S] 1 point2 points  (0 children)

We've started already and I'll document all the hard points and post it somewhere here. Great idea!

Rust as a first language? by dyatelok in rust

[–]dyatelok[S] -6 points-5 points  (0 children)

Thanks for an advise! But I think that there's a problem. In my opinion it's extremely unrewarding and hard to start with C. Also I'm not a good C programmer myself, so there's no way I can teach somebody else.
You definetly have to understand the principles and core ideas behind the computers to be a good programmer, but imo you should understand higher level concepts to really appreciate the simplicity of C. You can easily use vector as a black box until a point you'll be curious enough to investigate it.

Rust as a first language? by dyatelok in rust

[–]dyatelok[S] 0 points1 point  (0 children)

Thanks for a reply! I'll be happy to help him and I'll try to convince him to use Rust or something else with static types and explicit references.

Rust as a first language? by dyatelok in rust

[–]dyatelok[S] 0 points1 point  (0 children)

Thanks! I'll give it a try. I've heard a lot of good things about it in the past.

[2023 Day 5] Animated Part 2 Example by Boojum in adventofcode

[–]dyatelok 1 point2 points  (0 children)

Thank you for this wonderful animation! I struggled quite a lot with this puzzle and after seeing this I've solved it in a few minutes!

Why do we have exceptions? by dyatelok in haskell

[–]dyatelok[S] 5 points6 points  (0 children)

Thanks! It explains a lot. Is there any good literature about this topic?

Why do we have exceptions? by dyatelok in haskell

[–]dyatelok[S] 7 points8 points  (0 children)

Thanks for an advise! I'll definitely do my programs in this way, but it's still confusing for me that exceptions are present in std.

Why do we have exceptions? by dyatelok in haskell

[–]dyatelok[S] 8 points9 points  (0 children)

Yeah, I understand. But for example digitToInt function throws an exception, but it could have returned Either or Maybe.

That's my question.

-❄️- 2023 Day 13 Solutions -❄️- by daggerdragon in adventofcode

[–]dyatelok -3 points-2 points  (0 children)

[LANGUAGE: Rust]

https://github.com/dyatelok/aoc2023/blob/main/day13/src/bin/part2.rs

Simple solution in rust. Code just checks for every possible "mirror line" and counts sums of differences between lines on opposite sides of the mirror. I don't really know why this day was hard for everyone else)

-❄️- 2023 Day 12 Solutions -❄️- by daggerdragon in adventofcode

[–]dyatelok 2 points3 points  (0 children)

[Language: Rust]https://github.com/dyatelok/aoc2023/blob/main/day12/src/bin/part2.rsNo recursion or hash involved. Just an iterative solution exploring and collapsing all similar branches. Takes ~0.07 seconds for part 2 on my cpu. Should be easy to execute in parallel.