• 0 Posts
  • 22 Comments
Joined 1 year ago
cake
Cake day: August 4th, 2023

help-circle
    • Zig uses allocators, which will inform you if you are leaking memory.
    • Zig comes with defer/errdefer to simplify the resource cleanup (and for ergonomics).
    • Zig comes with Optionals to manage nulls.
    • Zig comes with slices (ptr + size) to manage all the bound-checking.
    • Zig automatically check for overflow/underflow arithmetic.
    • Zig will check for pointer alignments when casting between pointer types.

    => Zig is designed to make you do it right easily, and very hard to do it wrong.

    In other words, Zig will let you be, but warn you when you are doing something wrong, where Rust is like Karen who is always screaming at you for every word you are typing.

    To summarize, you really need to /want/ to fuck up to fail your memory management… If after all that you still can’t manage your memory, it might be better for you to look for another carer.

    Something is sure thou, Zig is very safe - just as it’s safe to cut my veggies with a knife. I might cut a finger and bleed a little bit, but I will not use plastic knife “because it’s safer”.

    Moreover; You are talking like if Rust is safe, all the time, which is not true in reality:

    52.5% of the popular crates have unsafe code. Therefore, in an average real-world Rust project, you can expect a significant number of the dependent crates to have unsafe code – Source

    Basically, you’re comparing a hypothetical world where Rust is always safe to a superficial glance at Zig’s capabilities to claim a “winner” here.

    And for the String library… Are you fucking serious? Do you want to compare the Zig’s Std library versus the famously tiny Rust Std library? Really?


  • Rust in Linux lead retires

    “I was expecting [Rust] updates to be faster, but part of the problem is that old-time kernel developers are used to C and don’t know Rust,” Torvalds said. “They’re not exactly excited about having to learn a new language that is, in some respects, very different. So there’s been some pushback on Rust.” Torvalds added, however, that “another reason has been the Rust infrastructure itself has not been super stable.” – Source [24-09-03]

    I’m not sure that’s something to be crowing about, mate…


  • C wasn’t my first language, but I learnt the most whilst learning C…

    People are talking about footguns and what not security related issues. I agree it’s easy to write bad C code, but if you want to learn what’s going on, learn C.

    Today I know a dozen of programming languages and C has always been in a special place in my heart. I am using Zig for my personal projects at the moment. It’s similar to C, without the pitfalls, and my C knowledge still helped me to learn that language.

    Learning C is a service you are doing to yourself for the rest of your life.




  • My personal experience is most people who are using git with a GUI are the same people who are asking my help to git-fu their git-problems…

    Most GUIs only offer a subset of the git functionalities and hide what’s really going on by obscuring gitshell with “their workflow”.

    In all cases, use what you like; some people like the shell. Cheatsheets are normally only for learning purposes and usually don’t stick for long, it’s not an end game thing…







  • PushButton@lemmy.worldtoProgramming@programming.devSafe C++
    link
    fedilink
    arrow-up
    16
    arrow-down
    3
    ·
    edit-2
    21 days ago

    I went for a blood test two days ago.

    The girls came back sprinting with some papers, asking me how it was possible???

    I asked calmly what was going on, right? That’s when she said she never saw, in her entire life, such beautiful, elegant, fast and clean blood!

    I was like: “darling, that’s because Zig is flowing in my veins, I just can’t stop using it”…

    That being said, I totally agree with you.




  • Get a Foot in the Door

    It starts with “no, you don’t have to learn it”,

    to “your changes are breaking Rust stuff, let’s waste time together to fix it, else I call it ‘bad attitude’”

    to “you better make your stuff that way if you don’t want to break Rust stuff (and waste your time me)”

    to “do it my way, Rust is taking longer to fix and I would have to refactor all the code because of the lifetime cancer”

    to the original senior kernel dev saying: “fuck it, I quit, the kernel is such a mess with the Rust BS” … People don’t want you at the party, make your own party with your own friends we don’t want you here

    It’s not complicated.