1. 15
    1. 4

      I loved rustlings as a resource but it needs to be paired with something else (like the rust book). I wish I started it sooner.

    2. 3

      The title totally buries the lede! The real value here is the technique for automatically keeping an implicit history with every build. Definitely something I’ll be adding to my own work flow.

    3. 3

      I am trying to “memefully” learn Rust. The endgoal is to be competent enough to create a Tauri based GUI software.

      For the “memefully” part the goal is to just enjoy the learning process as much as possible. Rust is a hard language, we all know that. So, I plan to write something in Python, then in Nim and then in Rust. Then write a blog about it. I plan to follow the Rust CLI book [0], however I want to do random projects. This weekend’s plan is to write a CLI that takes makes async get requests to a bunch of input URLs.

      [0] https://rust-cli.github.io/book/index.html

      1. 10

        Rust is a hard language, we all know that. […] This weekend’s plan is to write a CLI that takes makes async get requests to a bunch of input URLs.

        Async causes a significant fraction of the difficulty of Rust. Nicholas Matsakis, long-time leader of Rust’s language design team, admitted last year that

        async Rust feels a bit more like C or C++, where performant and versatile take top rank, and one has to have a lot of experience to know how to avoid sharp edges.

        I recommend considering using ureq instead, especially (but not only) if you still are learning Rust and you see Rust as hard.

        The costs of async are worth paying, if you’re writing an HTTP server that must serve many many clients with minimal overhead. However, for HTTP clients, we believe that the cost is usually not worth paying. The low-cost alternative to async I/O is blocking I/O, which has a different price: it requires an OS thread per concurrent request. However, that price is usually not high: most HTTP clients make requests sequentially, or with low concurrency.

        ureq README

        I concede that this depends on how large your “bunch of input URLs” is.

        1. 2

          Thank you very much for the recommendation. Trying it out now. It looks easier than reqwest.

        2. 2

          I recommend considering using ureq instead

          Or reqwest with the blocking feature flag

          1. 4

            Which just launches a current_thread Tokio runtime, uses it to send a request, then drops it. As far as I know, creating a new Tokio runtime per request isn’t that expensive, but it’s definitely more overhead than ureq.

            1. 2

              I did not know that. Thanks!

      2. 5

        For several years I thought that Rust was too hard and didn’t even attempt it seriously. Then last year I started the Advent of Code 2022 in Python (that I use professionally), and found this masterpiece from Amos: https://fasterthanli.me/series/advent-of-code-2022/part-1

        It was super refreshing as it was showing me how close to Python basic Rust can be, but also with many additional features that make it amazing. I was able to do about the first 13 days in Rust thanks to that series (I was solving it before looking at the solution from Amos). I must say that it was an eye opener to me. I really recommend this series.

        1. 3

          Fasterthanlime and No Boilerplate is the reason I am trying to learn Rust. Thank you very much. Checking the blog posts out.

      3. 2

        Oh hey, I did something very similar to your batch URL requests recently! Here was what I came up with: https://github.com/adamhammes/rust_web_serial/blob/master/src/main.rs#L29-L48

        1. 1

          That is nice. Thank you for sharing. Bookmarked. Now, I have to expand my feature list a bit more and throw JSON deserialization in the mix.

    4. 2

      This is actually a pretty neat technique, very reminiscent of Google’s citc snapshots.

    5. 1

      I’ve also learn rust in the past, unfortunately due to not practical use case, it end up just in my notes