• 0 Posts
  • 455 Comments
Joined 1 year ago
cake
Cake day: June 21st, 2023

help-circle
  • Ignoring the rest, just some thoughts about the list of proposed features:

    A capture trait for automatic cheap clones

    Automatic implicit cloning would be useful for high level developers, but not ideal at all for low level or performance-sensitive code. It’s not the case that anyone using a shared pointer wants to clone it all the time. The high level usecase doesn’t justify the cost assumed by the low level users.

    Instead, being able to wrap those types with some kind of custom “clone automatically” type feels like a middle ground. It could be a trait like mentioned, or a special type in the standard library. Suppose we call it Autoclone[T] or something (using brackets because Lemmy nonsense). Autoclone[Rc[T]] could function like the article mentioned.

    Automatic partial borrows for private methods

    Having “private” and non-“private” methods function differently feels like confusing behavior that should be avoided if possible. Also, “private” I assume refers to pub(self) methods (the default if unspecified), which is “module-level” methods (so accessible within the module it’s defined in). Anyway, there are years of discussion around this so I’ll just defer to that as to why it’s not in yet.

    I agree with the urge to make it happen though. Some method of doing partial borrows for methods would be nice.

    Named and optional function parameters

    This is what prompted me to even comment. What “every language” does for complex constructors is different per language. C#, for example, supports both named and optional parameters, but construction usually uses an object initializer:

    var jake = new Person("Jake")
    {
        Age = 30,
        // ...
    };
    

    This is similar to Rust’s initializers:

    let jake = Person {
        age: 30,
        ...Person::new("Jake")
    };
    

    Where it gets tricky is around required parameters. Optional ones don’t really matter since you can use the syntax above if you want, or chain methods like with the builder style.

    As for the overhead of writing builders, there’s already libraries that let you slap #[derive(Builder)] on types and get a builder type automatically.

    As for optional parameters, how those are implemented differs between languages. In C#, default values must be constant values. In Python, default values are basically “global” values and this nonsense is possible:

    def count_calls(count=[]):
        # if unset, count is a global list
        count.push(0)
        return len(count)
    

    Anyway, all this is to say that the value of optional parameters isn’t obvious.

    Named parameters is more of a personal choice thing, but falls apart when your parameter has no name and is actually a pattern:

    async fn get_foo(_: u32) {}
    

    Also, traits often use names prefixed with underscores in their default fn impls to indicate a parameter an implementer has access to, but the trait doesn’t use by default. Do you use that name, or the name the implementer defined? I assume the former since you don’t always know the concrete type.

    Faster unwrap syntax

    We have that, it’s called the try operator.

    Okay I know it’s different, and I know everyone’s use case is different, but I’ve been coding long enough to know that enabling easy unwraps means people will use it everywhere despite proper error handling being pretty dang important in a production environment.

    Thinking of my coworkers alone, if we were to start writing Rust, they’d use that operator everywhere because that’s what they’re familiar with coming from other languages. Then comes the inevitable “how do I add a try-catch block?” caused by later needing to handle an error.

    Anyway, I prefer the extra syntax since it guides devs away from using that method over propagating the error upwards. For the most part, you can just use anyhow::Result and get most error types converted automatically.

    Try trait

    Yes please.

    Specialization

    Yes please.

    Stabilizing async read/write traits to standardize on an executor API

    I’d want input from runtime devs on this, but if possible, yes please.

    Allowing compilation of builds that fail typechecking

    ???

    How is the compiler going to know how to compile the code if it doesn’t know the types? This isn’t Python. The compiler needs to know things like how much memory to allocate, and there’s a ton of potential unsound behavior that can occur from treating one type as another, even if they’re the same size.

    Anyway I’ll save the rest for later since I’m out of time.


  • Speaking as someone with a MTF close friend and NB spouse, but the term used in the article is the term everyone around me used when I was growing up. That term may be obsolete now, and if so, the author simply needs to be informed. There’s no need to assume they meant harm by it.

    If they knowingly used a term that may offend, then that’s of course a separate issue.



  • I’m not sure which game this comment is in context of, but steam reviews showcase the issues pretty clearly. For example, I went on the steam reviews for MTGA at one point for fun and saw a comment complaining about there not being enough white male masculine looking avatars. I’m not sure how Gideon Jura (literally the definition, even in cards, of a masculine white guy) and Garruk are not masculine enough for this person lol.

    Most likely, from how the comment read, they were complaining about the female portraits and portraits with non-white characters. I’m assuming they missed the NB character portrait (Niko Aris) since they didn’t specifically call them out.

    I also remember back when Horizon: Zero Dawn came out there were a lot of people complaining about a female MC. Personally, that was one of my favorite parts of the game since it gave a non-traditional perspective of the story in my opinion. Maybe some people disagree, and that’s fine, but giving a game a poor review just because the MC is female is honestly just a dishonest review of the game.

    You are not entitled to my money.

    I don’t think the article claimed anyone was, at least from my read of it. It’s your loss if you refuse to enjoy games over such a petty reason though.

    It’s also honestly just childish to give a game you haven’t played a bad review for having a more diverse cast. The main character is literally on the box art - if it bothers you, then the game is clearly not for you. It’s like me reviewing an otome game poorly because I don’t like otome games.






  • In addition to 1:many, many:many, and many:1 (which is just 1:many but looking at it in the other direction), you also occasionally see 1:1, for example if you want to augment a table with additional data. This might be done by having your foreign key also be your primary key in the augmenting table, since that would also enforce a uniqueness constraint on the FK as a result.

    Also, probably unnecessary to mention, but you can also have “0 or 1” relationship (meaning one side is optional but capped at 1). These are technically separated from “1” relationships usually when you get into all the theory. An example of this might be a “0:1” relationship using the above augment table, but where the augmenting table isn’t required to have a row for every row in the augmented table. (A 1:1 constraint can be enforced, for example, by having an additional FK in the augmented table pointing to the augmenting table.)




  • This sounds like a nightmare for production lines. Items on belts just randomly turning into spoilage? I hate thinking about how this will break so many common factory setups, and I like this change just as much for that same reason. Just filtering out spoilage at the end of a belt won’t be enough for some designs, especially when 3+ ingredients are involved in the recipe (so two input belts). It’ll be interesting to come up with new designs that can filter the inputs mid-belt to remove the spoilage, since it’s inevitable if your inputs come faster than you can process them.

    Can’t wait to see the update.






  • If you want to use it in your start menu, there are some options. I know Start11 can use Everything, for example (but isn’t free - there may be free options out there, but I haven’t looked).

    Otherwise, most of what I’ve seen are CLI applications. Is there anything specific about Windows you’re hoping to see a replacement for? For me, search and settings (why the f are you advertising to me in the f-ing settings?) are the worst offenders, but settings is kinda locked in for the most part unfortunately.



  • Rule 10 might also not apply since the companion mechanic is a special action. Still, it’s a bit confusing because “Companion” is itself a keyword ability (702.139), so my guess is that while the companion ability allows you to take a special action to put the card into your hand, it itself doesn’t put the card in your hand, so it doesn’t apply. Companions are weird.


  • My understanding with commander is that players don’t have sideboards, so they are unable to bring any cards from outside the game into the game. 903.11 may be referring specifically to companions, which for some weird reason, are legal in commander.

    In casual commander, you can of course do what you want as long as the play group is okay with it.

    (Also, I don’t play a lot of commander, so my rules knowledge for it may be incorrect.)