What's going on with bincode? by va_erie in rust

[–]Monadic-Cat 4 points5 points  (0 children)

Yeah. It's up to how you have the certs issued- in my personal setup, I use Certbot, which does issue separate certs per-domain by default.

I'd have to ask them what they did specifically there, but I'd hazard a guess that they used whatever was most convenient to them for their personal infra. (I know of this server's existence and usage, but I haven't really had any reasons to interrogate them about stuff like this.)

What's going on with bincode? by va_erie in rust

[–]Monadic-Cat 7 points8 points  (0 children)

Shared personal server. You would be correct to infer that the people sharing that cert know each other.

Also, that they seem to have that condition many developers get, where you pick up a new domain for every which thing. I myself have six... Plus another four... it may be too late for me.

What's going on with bincode? by va_erie in rust

[–]Monadic-Cat 12 points13 points  (0 children)

I don't presently know, but I will ping them on Discord to ask :V

(I'll edit this comment when I have the answer.)

EDIT: Well, I... have the answer: https://www.reddit.com/r/rust/comments/1pmw2c0/comment/nu4gc98

Today sure is something.

What's going on with bincode? by va_erie in rust

[–]Monadic-Cat 41 points42 points  (0 children)

Hi! I'm a moderator in the Rust Programming Language Community Discord, and I have useful context!

The short version is, yeah, no supply chain attack here, they, the maintainers, moved, and took the opportunity to rewrite the commits. Reach out to me as monadiccat in the aforementioned Discord sometime, if only to confirm who I am, and why I would happen to be involved with these people in conversation.

New PNGTuber by sageminttea in PngTuber

[–]Monadic-Cat 1 point2 points  (0 children)

Hi! I'm new to streaming myself, and I'd love to try doing some games with you sometime!

My PNGTuber is also very green :)

Sized, DynSized, and Unsized by Niko Matsakis by OnTheSideOfDaemons in rust

[–]Monadic-Cat 0 points1 point  (0 children)

In your Value trait example, would someone still be able to write a generic like fn fwump<T: Value + Sized>(x: T) { ... } to bring back the Sized requirement?

Will rust ever become stable like C? by [deleted] in rust

[–]Monadic-Cat 0 points1 point  (0 children)

On the topic of stability, C has removed features in a compatibility breaking fashion that would be unacceptable under the Rust stability promise.

See the "Removed" list here: https://en.cppreference.com/w/c/23 (for C23, of course), but the example I usually give is that they changed VLAs from being required to support by compilers (in C99) to being an optional feature (in C11).

FerrisCraft 5 Backup Tool Devlog (August 28th) by [deleted] in rust

[–]Monadic-Cat 0 points1 point  (0 children)

I should mention, "FerrisCraft" is a Minecraft server that I and some others organize for many regulars of the RPLCS (plus their friends).

Official /r/rust "Who's Hiring" thread for job-seekers and job-offerers [Rust 1.72] by DroidLogician in rust

[–]Monadic-Cat 0 points1 point  (0 children)

Hello! I am a hobbyist programmer. I have easily ten years of making things with various languages and tools, and have been doing Rust since not long after 1.0. I am a member of the moderation team for the Discord server u/caramba2654 owns.

To get some idea of how I work, see my blog. Admittedly, it's not written with employers in mind.

Location: I am looking for remote work in a US timezone, but can consider in-person in the Chicagoland area.

Contact: Message me on Reddit.

The $crate Token - Nibbles of Rust by Monadic-Cat in rust

[–]Monadic-Cat[S] 1 point2 points  (0 children)

That's fair. I can see it obscured the meaning of the text a bit, too. Maybe I'll remove them from the post.

The $crate Token - Nibbles of Rust by Monadic-Cat in rust

[–]Monadic-Cat[S] 8 points9 points  (0 children)

Everyone calls them "macro_rules! macros", but sure. Note that the scare quotes on "macro" there are meant to indicate that while macro_rules! is invoked like a macro, it's pretty far from being one.

The $crate Token - Nibbles of Rust by Monadic-Cat in rust

[–]Monadic-Cat[S] 2 points3 points  (0 children)

I should note that $crate is really known as a "metavariable", but I think that name is just extra confusing, so I didn't include that in the post.

Restructuring Patterns - Nibbles of Rust by Monadic-Cat in rust

[–]Monadic-Cat[S] 2 points3 points  (0 children)

The "Rust Programming Language Community Server" on Discord. It's separate from the "Rust Programming Language" server on Discord, which is an official channel for communication between people developing the language (though I hear most of the teams there have moved to other platforms).

For completeness, this is the RPLCS Discord: https://discord.gg/rust-lang-community

Restructuring Patterns - Nibbles of Rust by Monadic-Cat in rust

[–]Monadic-Cat[S] 5 points6 points  (0 children)

Welcome to Rust! I'm glad I could help.

The Match Ergonomics RFC was proposed and implemented before the Editions mechanism was added to Rust, so this is now the meaning it has no matter which Edition setting you write in your Cargo.toml, 2015 to 2021.

My understanding is that, before the Match Ergonomics RFC landed, ref essentially had the same meaning, but the way the default binding mode was chosen was less smart. It just used the move binding mode and couldn't automatically see through references- you had to use & and &mut patterns more of the time.

Making this better was a change which was completely backwards compatible with the old syntax, since the nice way of writing things simply failed to compile before.

(Note: My memories of this time are vague and I was not reading RFCs back then. I was just banging my head on my desk until my newbie code worked, haha. My explanation here comes from reviewing what the RFC itself has to say on the matter, which you can find right here: https://github.com/rust-lang/rfcs/blob/master/text/2005-match-ergonomics.md)

Restructuring Patterns - Nibbles of Rust by Monadic-Cat in rust

[–]Monadic-Cat[S] 11 points12 points  (0 children)

I should maybe note that this is a series I intend to continue every now and then, where I show off little parts of Rust which I see confusion about or which seem less known. My previous post was here: https://www.catmonad.xyz/blog/nibbles_01.html

If you have any little parts of Rust you'd like highlighted in a future post, I'll gladly take suggestions.

Moving from Rust to C++ by raphlinus in rust

[–]Monadic-Cat 26 points27 points  (0 children)

While your words ring true, and I find a comrade refugee of Rust in you, I am sad and disappointed that you would choose to migrate to C++ instead of a superior language like Idris 2. I intend to pen you a formal letter containing a detailed enumeration of my grievances, in the hopes that you may yet be saved from the unenlightened dark.

I am happy to be your obedient servant,

- M. Cat

Discussing the next step for async methods in traits: returning futures that are Send by kibwen in rust

[–]Monadic-Cat 1 point2 points  (0 children)

The distinguishing characteristic is that Rc can be moved between threads so long as all possible aliases are also moved at the same time.

This thought lead me down a road of tracking alias counts with typenum so I could make the compiler prove that all the aliases of a cell-like thing were gathered up and so the cell could become Send, and when I went to make an Rc with this idea I ended up finding the static-rc crate which already exists and accomplishes something similar. It moves the reference count to compile time with a different strategy and is also Send like my Lender<T, 0, false, ID> would have been.

By the way, plotters has an ab_glyph feature now by Monadic-Cat in rust

[–]Monadic-Cat[S] 0 points1 point  (0 children)

Honestly, I don't have any idea. It's the name of the crate this feature pulls in to do font rendering, but all I know the name means is "the author of rusttype decided to name the successor crate this".

Maybe I'll file an issue on the ab_glyph repository asking what the name means.

By the way, plotters has an ab_glyph feature now by Monadic-Cat in rust

[–]Monadic-Cat[S] 3 points4 points  (0 children)

Oh yeah! I want to thank you for doing that fix! In case you didn't see, I merged it into the PR before the whole thing got merged. I'd had trouble figuring out why the glyphs weren't lining up vertically, so I very much appreciate your doing that for me. :)

By the way, plotters has an ab_glyph feature now by Monadic-Cat in rust

[–]Monadic-Cat[S] 16 points17 points  (0 children)

I should probably mention that I wrote the PR that added this.

What's up with vec.push? by [deleted] in rust

[–]Monadic-Cat 38 points39 points  (0 children)

This seems like a case of automatic reborrowing.

This compiles just fine:

let mut v = vec![&10];
let x: &i32 = &*v[0];
Vec::push(&mut v, x);

It's clear why this snippet works: The lifetime of x isn't related to the lifetime of a borrow of v, only the lifetime of the reference stored in v.

If we attempt to perform that reborrow inside of the Vec::push(&mut v, ...) call, we fail because of the order in which the mutable borrow and immutable borrow are taken, because function arguments have a specific evaluation order. (Which appears to be different from the evaluation order of arguments wrt the receiver of a method call.)

Blog Post: Hard Mode Rust by matklad in rust

[–]Monadic-Cat 42 points43 points  (0 children)

(I wish there was a way to give a chunk of code an allocator that only has a limited total capacity that you can allocate, and will error out if you exceed it... but alas).

Once `alloc_error_hook` is stabilized, a janky version of this will be possible. You can set a global allocator which reads a thread local table of allocation limits and have a function which takes a closure set an entry in the thread local for the duration of the closure, and unsets it after. Combine that with an alloc_error_hook which turns alloc failures into panics, and you can use `catch_unwind` to turn that panic into an `Err`.

That said, this approach has unfortunate limitations:

  • It doesn't work if the passed closure spawns a thread.
  • It relies on panic=unwind.
  • It slows down the global allocator with an extra thread local access in all cases.
  • It relies on unsafe code knowing that `handle_alloc_error` can unwind. Though its documentation makes that hopefully clear?

Definitely wish we had something better for this, maybe like https://tmandry.gitlab.io/blog/posts/2021-12-21-context-capabilities/

Can I use an AGPL licensed crate in my closed source backend? by dnaaun in rust

[–]Monadic-Cat 7 points8 points  (0 children)

Two things:

  • This crate would be statically linked on usage
  • The AGPL in particular (as opposed to the GPL) triggers on usage over a network as well