• 1 Post
  • 559 Comments
Joined 1 year ago
cake
Cake day: June 15th, 2023

help-circle

  • I try not to and if I have to I’d use string interpolation. I’m not even sure whether you’re pulling my leg right know, I literally don’t remember whether they have a string append operator.

    Like 99.999% of the sh I ever wrote was in Makefiles and short wrapper scripts which could just as well be aliases. No argument handling past $@, no nothing the language is just too fickle for me to bother dealing with. The likes of zsh are make-up on a pig, I think I had a quick run-in with fish but never really got the hang. Nushell is different, it’s actually bold enough in its changes to get rid of all the crufty nonsense.


  • So can any TLD holder. The rules for .org might change to disallow individuals. .com might outlaw non-profits. .net might get restricted to ISPs. There is a small, but existent, chance that all the oxygen molecules in the room I’m in are going to decide that they’ll huddle up in some corner, leaving me to suffocate. I refuse to worry about it.

    If you want to be paranoid like that you can send the rust foundation some money and tell them to spend it on the .rust and .ferris gTLDs.


  • Unlikely, and even more unlikely to not be able to be worked around by a local rust user group.

    Like, the .eu restriction to only give out domains to individuals and companies within the EEA is more about having a domestic contact than anything else, EURid doesn’t care who actually uses the domain just that it has European legal representation.


  • Pre- and post-increment are only really useful when you’re doing C-style looping and there’s a good reason we don’t do that in Rust.

    I actually honestly can’t recall ever making an off by one error in Rust, I’m sure when implementing specific data structures or when doing pointer manipulation it’s still a possibility but you can write a gazillion lines of code without ever running risk of that particular annoyance. Also while C folks may have an argument regarding operator semantics, C++ folks don’t they’re doing unspeakable things to <<.

    Also, FWIW Haskell uses ++ to append lists and therefore also strings. It’s not like it’s an odd-ball usage of the symbols, that’d be .. which I vaguely remember some language using. Would cause a whole new class of confusion regarding 'a'..'z' vs. "a".."z". Not to mention that "aa".."zz" actually makes sense as a range all that’s missing is &str: Step. Probably not a good idea to have built-in because do we mean printable ASCII? Whole unicode range? Just the alphabet? Not an issue when you’re doing it to single chars but strings get ambiguous fast. Does Rust even guarantee stuff about Char ordering C certainly doesn’t really do that, short of I think 0..9 being contiguous.


  • Rust has impl Add<&str> for String and impl AddAssign<&str> for String. Both append as expected.

    I wouldn’t go so far and say “as expected”: “Addition” implies that we’re dealing with a ring, that there’s also multiplication, and that really doesn’t make sense for strings (unless you indeed consider them numbers). It’s why Haskell’s Monoid typeclass comes with the function mappend, not madd.

    In Rust’s defence though std::ops traits aren’t meant to carry any semantics they’re about syntax: It’s called Add because it’s +, not because it means something. I do think it would’ve been worth it to introduce ++ for general appending (also vectors, sets, maps, etc), though, to keep things clean. Also ++= for the mutating case.


  • Saint Helena is in no way comparable because it’s not disputed territory. Back when Mauritius became independent the British carved out some islands for their continued colonial use, breaking (back then brand new) international law.

    Saint Helena has no such connection to another country and it was uninhabited before the Dutch settled. The Brits later conquered it but even if the Dutch want it back it’d keep its autonomous territory status and therefore its own TLD, the Dutch have plenty of those.




  • That makes complete sense. Ranges implement fmt::Debug, .. is a range, in particular the full range (all values) ..= isn’t because the upper bound is missing but ..=.. ranges from the beginning to the… full range. Which doesn’t make sense semantically but you can debug print it so add a couple more nested calls and you get a punch card.

    I totally didn’t need the Rust playground to figure that out.

    EDIT: Oh, glossed over that: .. is only the full range if standing alone, it’s also an infix operator which is why you can add as many as you want (be careful with whitespace, though). .. .. .. .. .. .. .. .. .. .. is a valid Rust expression.








  • barsoap@lemm.eetoLemmy Shitpost@lemmy.worldMildred
    link
    fedilink
    arrow-up
    4
    ·
    5 months ago

    Deep into that darkness peering, long I stood there wondering, fearing,
    Doubting, dreaming dreams no mortal ever dared to dream before;
      But the silence was unbroken, and the stillness gave no token,
      And the only word there spoken was the whispered word, “Lenore?”
    This I whispered, and an echo murmured back the word, “Lenore!”—
           Merely this and nothing more.


  • barsoap@lemm.eetomemes@lemmy.worldBasic American etiquette
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    5 months ago

    Actually American stuff is illegal in the EU, preservatives, bleaches, dyes, whatnot. What’s allowed to be called what will differ from country to country and you are not the biggest bread snobs, you’re just the most vocally snobbish.

    In Germany there’s Toastbrot, actual bread though noone in their right mind would eat it without toasting first, then bigger and thicker and fluffier slices which are considered an “American-style” style of toast (again: don’t eat them raw ewww) but as said not the real deal. Those latter ones may or may not be legally bread, it’s usually hidden in the fine print while the big print is “sandwich slices” or something. Thing is the stuff needs to be made from 90% flour, sugar+fat together max 10%, and if you want something that’s recognisable to Americans as bread you need to blow that limit.

    Oh and all are bound to use a proper sourdough process, over-engineered as it may be in an industrial setting they’re giving the dough enough time to actually pre-digest itself.


  • barsoap@lemm.eetomemes@lemmy.worldgoddamnit
    link
    fedilink
    arrow-up
    1
    ·
    5 months ago

    They might use standard imagemagick or such on the backend meaning they can ingest pretty much any image format ever invented, and have a limited set of extensions allowed on the frontend side so people don’t upload .txts.


  • barsoap@lemm.eetomemes@lemmy.worldgoddamnit
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    5 months ago

    This grant does not include claims that would be infringed only as a consequence of further modification of these implementations.

    IANAL but what they’re saying here seems to be “if you download our code and modify it and, with that modification, touch some other patent of ours we can still have your ass”. That is, the license they’re giving out only cover the code that they release. Which shouldn’t be too controversial, I think.

    The issue with codecs in general is that there’s plenty of trolls around and coming up with any audio or video codec is probably going to hit one of their patents, so the best that FLOSS codecs can do is “we don’t have any patents on this” or “we do have patents on this but license them freely, also, if someone else goes after you we’re going to detonate a patent minefield under their ass”. Patent portfolios have essentially reached the level of MAD.

    Personally, IDGAF: Software patents aren’t a thing over here. You only have to worry about that stuff if you’re developing silicon.


  • Should all be in place. Even nvidia driver support. It’s one of the rare cases where I actually support nvidia on a technical level, that is, having explicit sync is good. I can also understand that they didn’t feel like implementing proper implicit sync (hence all the tearing etc) when it’s a technically inferior solution.

    OTOH, they shouldn’t have bloody waited until now to get this through. Had they not ignored wayland for a literal decade this all could’ve been resolved before it became an issue for end-users.