💾 Archived View for gem.1.21jiggawatts.net › posts › 2020-09-30-micrologs-09-2020.gmi captured on 2020-10-31 at 00:47:01. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

Micrologs Sep 2020

2020-09-30

The Social Dilemma is good stuff. I got to have a long conversation about it with a non-technical lawyer who previously had no idea how algorithmic feeds work. I recommend this review from "Circumlunatic Ramblings":

"The Social Dilemma (Film)"

To add to that, the thing that struck me is how much screen time they devoted to the interviewees being nervous, or anxious about delivering their message properly. Working in the industry, it's natural to me that decisions in tech companies are made by average humans with all their flaws and insecurities. Perhaps for the layperson there's a bit of hero worship of the people behind these hugely successful companies, which the producers wanted to hose down.

Perhaps weirdly, I've been trying to watch more things like Netflix rather than consuming whatever random stuff bubbles up on YouTube or microblogging sites. It's properly produced media, presented via at least some level of gatekeeping. The ability to have IRL conversations about topical shows (as mentioned above) is a pleasant secondary benefit.

---

I've been working with Rust for a couple of years now and I'm still getting the hang of thinking in traits. One reason it's taken so long is that I work on a lot of async pipelines where you can't statically determine types so it makes more sense to represent all possibilities via an enum. Another is that I'm just unfamiliar with it. Most of my designs will result in concrete types, or at least interfaces that go by a single name, à la Swift or Java.

It's good to be forced to branch out and understand different design patterns. Recently I've been working with the HTTP server crate "warp" which uses a lot of generics to statically define all the parameter processing and routes. The traits are extremely powerful but the downside is it's extremely hard to know how to use them just by looking at the function definitions. Full example applications or prose documentation are required.

If `serve_incoming` was described as taking "a Stream of `Ok(sock)` where `sock` is accepted from a tokio `TcpListener`" then I could see how to use it.

The actual definition is "it takes a `TryStream` (a stream of `Result`) + `Send`, where the `Ok` part is `AsyncRead + AsyncWrite + Send + 'static + Unpin` and the `Error` part can be turned into a boxed `std::error::Error` and is also `Send` and `Sync`". Technically correct and highly versatile, but dang.

serve_incoming API reference

---

You know you’re going to have a bad time when you scroll down a Stack Overflow post and every answer starts by referring to a different answer.

Foobaz Home