Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)BC
Posts
2
Comments
91
Joined
2 yr. ago

  • I hope that someone in the 40 comments i don't have time to read right now has pointed out that the premise of OP is flawed for the simple reason that Rust hit v1.0 in 2015, while Zig is still nowhere near that milestone in 2024.

    So we are not even talking about the same "future" period from the start.

    So, no need to get to the second false premise in OP, which is limiting a "future" period to one successful dominating language only. Nor is there a need to go beyond these premises and discuss actual language details/features.

  • you’re not supposed to immediately reach for macros

    correct

    for small things you don’t quite like about the language.

    incorrect

    Excessive macro use makes it impossible for others (including your future self) to read your code

    N/A. the macro above is trivial.

    impossible for others to read your code and there’s often good reasons why it’s designed like it is.

    fiction

  • There is a general mechanism in Rust that allows language users to add their own sugar. It's called macros 😉

      rust
        
    macro_rules! keep {
        (let $id:ident = $expr:expr => $($tt:tt)+) => {
            let $id = $expr;
            let $id = $id$($tt)+;
        }
    }
    
    fn main() {
        keep!{ let path = std::env::current_dir().unwrap() => .as_path() };
        println!("{path:?}");
    }
    
    
      

    You can remove let from the macro's fragment specifier and invocation.

  • Neither.

    • make new() give you a fully valid and usable struct value.
    • or use a builder (you can call it something else like Partial/Incomplete/whatever) struct so you can't accidentally do anything without a fully initialized value.

    Maybe you should also use substructs that hold some of the info.

  • Because non-open ones are not available, even for a price. Unless you buy something bigger than the "standard" itself of course, like a company that is responsible for it or having access to it.

    There is also the process of standardization itself, with committees, working groups, public proposals, ..etc involved.

    Anyway, we can't backtrack on calling ISO standards and their likes "open" on the global level, hence my suggestion to use more precise language (“publicly available and sharable”) when talking about truly open standards.

  • The term open-standard does not cut it. People should start using "publicly available and sharable" instead (maybe there is a better name for it).

    ISO standards for example are technically "open". But how relevant is that to a curious individual developer when anything you need to implement would require access to multiple "open" standards, each coming with a (monetary) price, with some extra shenanigans [archived] on top.

    IETF standards however are actually truly open, as in publicly available and sharable.

  • Post the original code to !rust@programming.dev and point to where you got stock, because that AI output is nonsensical to the point where I'm not sure what excited you about it. A self-contained example would be ideal, otherwise, include the crates you're using (or the use statements).

  • Federation is irrelevant. Matrix is federated, yet most communities and users would lose communication if matrix.org got offline.

    With, transport-only distributablity, which i think is what radicale offers, availability would depend on the peers. That means probably less availability than a big service host.

    Distributed transport and storage would fix this. a la something like Tahoe-LAFS or (old) Freenet/Hyphanet. And no, IPFS is not an option because it's generally a meme, and is pull-based, and have availability/longevity problems with metadata alone. iroh claims to be less of a meme, but I don't know if they fixed any of the big design (or rather lack of design) problems.

    At the end of the day, people can live with GitHub/GitLab/... going down for a few minutes every other week, or 1-2 hours every other month, as the benefits outweigh the occasional inconvenience by a big margin.

    And git itself is distributed anyway. So it's not like anyone was cut from committing work locally or pushing commits to a mirror.

    I guess waiting on CI runs would be the most relevant inconvenience. But that's not a distributable part of any service/implementation that exists, or can exist without being quickly gravely abused.

  • Definitely don't use axum, which provides a simple interface for routes by using derived traits. Their release cycle is way shorter, which makes them more dangerous, and they're part of the same github user as tokio, which means they're shilling their own product.

    this but (semi)-unironucally

  • If you're using an LLM to "learn", stop. Otherwise, I don't understand what lazy_static has to do with anything.

    It's hard to tell what you're asking. But maybe you're confused because println! (it's a macro btw) expands to code that involves format_args! which is a compiler built-in that doesn't take ownership of the token expressions that get passed to it. Notice how the bottom of the format_args! page has this to say:

    Lifetime limitation

    Except when no formatting arguments are used, the produced fmt::Arguments value borrows temporary values, which means it can only be used within the same expression and cannot be stored for later use. This is a known limitation, see #92698.

    So, it's kind of a feature and a limitation at the same time.