2,704 karma · joined May 6, 2013
If I posted something you found interesting, I probably found it on Scour. Sign up in <1 minute to get your own personalized feed.
Writing at https://emschwartz.me
> It's especially helpful to people who are both new to Rust AND come at Rust from language ecosystems with a garbage collector.
This is exactly the audience I was writing for so I'm very happy that you thought so.
That said, I think you downplay the ways that references and mutability do interact in Rust. If there is a single outstanding reference to a value, Rust won't let anyone mutate the underlying value. I think this is quite an important part of Rust to understand that's not obvious to someone who's new and especially coming from a language that enforces no such guarantees about mutability.
A part of Rust that I very much appreciate is that once you write Rust code and get it to compile, there's a pretty good chance that it's going to do what you expect. As someone who is new to Rust, it's definitely no small feat to get the code to compile in the first place. But I think that's one of the main things people tend to love once they get over the initial hump of grokking all the different ways of passing variables around.
There's one other thing in Rust that would be kind of difficult if passing a reference were the default, rather than the owned value. Rust has implicit returns so the last thing at the end of a block or function is returned. If you needed to explicitly ask for ownership, you'd need to do that at the end of every function. Also, Rust will yell at you if you try to have a function return a reference to a value that's going to be dropped.
Update: also made them smaller.
I’m not sure it is for 100% of early stage startups, but I guess it is once you exceed some minimum usage threshold.
That said, definitely appreciate the detailed explanation.
I’m working on autometrics (https://github.com/autometrics-dev/autometrics-rs) and people asked whether it could be used in embedded contexts but I wasn’t sure how you’d hook up the device to something like Prometheus.
(Sorry if I missed that you had already tried or are planning those)
Excellent line.
Question for frontend developers: would you agree that data management is one of the harder parts of using serverless platforms today? How does this compare with some of the other offerings out there?
I believe that React Server components is also heading in that direction.
I'm somewhat inclined to say if we're uniquely identifying resources with a unique, human-readable string, that's the ID you should always use to refer to things. It seems slightly more complicated to explain to users that there are these two ways to refer to things.
There's also the issue (or benefit) of keeping the UUID the same if you are able to change the human-readable ID.
It seems somewhat nice to have resources that users create and interact with via an API + CLI to use identifiers that people can type out and remember instead of copying.
Unguessability isn't a big deal because all of these IDs can be namespaced under the organization ID and the auth check can just return a 404 instead of a 401/403 if the person doesn't have access.
That said, the Slack vs Microsoft Teams numbers go to show the power of ecosystem integration and a widespread network of existing customers.
I guess the one case where it might still make sense to have the organization ID in the path is if users can be in multiple organizations and some APIs involve listing all of a given resource for a certain organization.
I think it doesn’t quite answer what I’m after though.
I’m thinking less about resource discoverability and more about authorization and fetching resources from the database. For example, if the URL doesn’t include the post ID and I need that to check if the user is authorized to post a comment, I’d first need to look up the comment thread to get the post.
Thanks!
They did a really nice job of building thin layers up the stack from byte buffers (bytes), to async-friendly logging (tracing), basic IO (mio), async runtime (tokio), generic request/response services (tower), HTTP (hyper), and a web framework (axum).
Each of the layers are useful independent of the other layers above, and every one is has a thoughtfully designed, pragmatic interface.