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/)B
Posts
10
Comments
273
Joined
3 yr. ago

Collecting downvotes since before forums even had thank you's.

  • great article!

    Is it?

    I didn't read past the first sentence:

    The Arc type is Rust’s thread-safe smart pointer

    This is horrible in my view. All types that implement Deref and/or DerefMut can be called smart pointers, and everything is "thread-safe" in safe Rust.

    If I had to call something "Rust's thread-safe smart pointer", it would be the actual references &T/&mut T where T: Send + Sync.


    Digression: All the traits involved like the 4 mentioned above point to the C++ centric concept of smart pointer not mapping cleanly to Rust semantics imho. But that's a long lost battle.


    Let's see what the official Arc docs say:

    A thread-safe reference-counting pointer.

    Will you look at that! An actually accurate short description that is already available.


    While not widespread, there is already a small myth out there that paints Rust as if it's Swift-like, a ref-counting centric language.

  • You can custom serialize (timestamp, tz) or timestamp, offset or (timestamp, tz, offset), no?

    Ironically, that was a part of a back-and-forth I had with burntsushi (jiff dev) right here on lemmy.

  • It's called a spam re-post.

  • Change your name to Err::<!,!>(return).unwrap()

  • Nothing of significance will actually happen. The crate is too deeply intrenched in the ecosystem. And the little maintenance needed will be easily picked up.

    Coming from C not C++, I actually didn't like chrono at first, but grew to be okay with it, and it gets the job done.

  • Fastrand is not cryptographically secure

    That's not relevant when it's a question of interface.

    fastrand has a single Rng struct that drives everything else. Was the option to replace the implementation details of this struct explored? No idea.

  • Ctrl-F fastrand (0 results)

    I had to stop reading very early. Sorry, but if you're going to do this topic, at least acknowledge the other very popular randomness crate, and argue why it wasn't good enough for what you wanted.

  • The test suite passes, so it's 100% memory safe according to zig guidelines and standards.

  • This is the way.

  • I think the other user meant that ls output is not supposed to be treated as parsable, because the tool doesn't offer any guarantees in that regards.

    Shells have built-in support for globbing files anyway. xargs is also not needed. If someone is allergic to using a shell for loop, find always had -exec with ; instead + which wouldn't trip on too many arguments.

  • Later versions than C99 have no real added value proposition for the real use-cases where C is actually desired as an implementation language.

    Later versions than C99 continue to introduce C++isms among other shit, from committee members some of whom probably never coded anything serious in C. This actually sometimes trickles down to compiler implementations even when you're sticking with an older version. So they manage to anger you even when you're keeping a distance.

    Despite street myths and stereotypes, most people who choose C for some projects are not grey-hairs stuck in the past and incapable of learning new tools. Many of them in fact do use newer languages like Rust where they see fit. So there is no pressure to pick the one or two features from newer C versions that are maybe possibly can be useful.

    Still, for some big projects that are kind of half-stuck with millions of lines of C, while at the same time having immense pressure to deliver maximum reliability AND security, these newer versions could proof useful at times. But the only project that comes to mind that fits this mold is the Linux kernel really. And there, non-standard language extensions are getting used anyway, so it's kind of an exceptional situation, that is also not very portable, but that's not a concern by the very nature of where a kernel sets in the stack.

  • Actually, I didn't notice your use of clone() which is even worse.

    Here is what I had in mind. One can put the T: Default bound on the wrappers themselves to simplify, or add potentially expensive transformations for non-Default types.

  • Using cells in your solution is smelly, when you can simply use two transparent wrappers with Ref or RefMut access, so you have actual compile-time checking instead of janky checking at runtime (which is also not zero-cost).

    The allow/deny variants could themselves hold & or &mut references too if we are going with that route. But it all depends on the precise problem OP is having and what is the best workable solution for it looks like.

  • Can you clarify/expand on what you mean.Are the other objects of the same type (so are indeed Self)? Are they in the same Vec or a different Vec or from different Vecs?Are all the T's in your post the same?...etc

  • There should be a rule against low quality posts.

  • Vibe-coded trash + outdated models.

    Wouldn't have expected anything better from a trash website.

  • translates to assembly code with a very predictable pattern.

    the portable assembly meme

    🤣🤣🤣🤣🤣🤣🤣

  • ⚠TRIGGER WARNING⚠ two tokio-rs repos (this and toasty) have AGENTS.md files.

  • exposed ABI

    ABI is not something that gets "exposed" or not.

    it will always be ambiguous as implementations are hard to compare across languages

    Correct.

    in the transition for x86_64 they were seeing up to 70% increase in compile speeds

    And that was a part of what I was hinting at, because you get >>70% speed-up with Cranelift in most Rust projects. But in either case, faster code generation is not free lunch, hence the mention of comparable runtime performance of generated binaries.

  • Programming @programming.dev

    wild v0.9 released (wild is a super-fast linker with the end goal of supporting incremental linking)

    github.com /wild-linker/wild/releases/tag/0.9.0
  • Rust @programming.dev

    Slint 1.16 Released (GUI toolkit)

    slint.dev /blog/slint-1.16-released
  • Programming @programming.dev

    Wild linker v0.8 released (and updated benchmarks)

    github.com /davidlattimore/wild/releases/tag/0.8.0
  • Programming @programming.dev

    koto v0.16.0 released (koto is a scripting programming language)

    github.com /koto-lang/koto/releases/tag/v0.16.0
  • Programming @programming.dev

    Rust tops a diverse list of implementation languages in projects getting NLnet grants, Python 2nd, C is alive, and C++ is half dead!

  • Rust @programming.dev

    Rust tops a diverse list of implementation languages in projects getting NLnet grants, Python 2nd, C is alive, and C++ is half dead!

  • Rust @programming.dev

    Koto: a simple and expressive programming language, usable as an extension language for Rust applications, or as a standalone scripting language

    koto.dev
  • Programming @programming.dev

    Koto: a simple and expressive programming language, usable as an extension language for Rust applications, or as a standalone scripting language

    koto.dev
  • Rust @programming.dev

    kdl 6.0.0-alpha.1 (first version with a KDL v2 implementation)

    github.com /kdl-org/kdl-rs/blob/f67e3d2998dcf0d198b4d03be7b23062cab21723/CHANGELOG.md
  • Rust @programming.dev

    COSMIC ALPHA 1 Released (Desktop Environment Written In Rust From System76)

    system76.com /cosmic