Which language is the superior C replacement that's going to win, Rust or Zig?

Which language is the superior C replacement that's going to win, Rust or Zig?
I thought it was going to be Rust, but this article is making me reconsider: https://kevinlynagh.com/rust-zig/

Shopping Cart Returner Shirt $21.68

The Kind of Tired That Sleep Won’t Fix Shirt $21.68

Shopping Cart Returner Shirt $21.68

  1. 2 years ago
    Anonymous

    >My interest was not (and still isn’t) in... safety
    checks out

  2. 2 years ago
    Anonymous

    zigger cope, rust won

    • 2 years ago
      Anonymous

      rust cope, c++ won before you were even born

  3. 2 years ago
    Anonymous

    >superior C replacement
    Common Lisp.

    • 2 years ago
      Anonymous

      >no static typing
      ngmi

      • 2 years ago
        Anonymous

        >Not using Coalton or SBCL
        ngmi

  4. 2 years ago
    Anonymous

    >rust
    overrated but okay
    >zig
    who?

  5. 2 years ago
    Anonymous

    >instead of just standardizing around C/C++ and working around the limitations of the two languages we need to introduce a million meme languages because IQ rates of programmers keep dropping.
    Great.

    • 2 years ago
      Anonymous

      >instead of just standardizing around C/C++
      why not standarize around assembly? or machine code? why introduce meme languages like c/c++?

    • 2 years ago
      Anonymous

      >instead of just using already standardized languages that work we need to introduce C/C++ languages because IQ rates of programmers keep dropping.
      They used to teach better languages like Lisp and Ada in universities and now they teach C because millennials and zoomers would have failed.

  6. 2 years ago
    Anonymous

    C

  7. 2 years ago
    Anonymous

    >coalton

    • 2 years ago
      Anonymous

      Wrong thread?

      • 2 years ago
        Anonymous

        more like defected bot

  8. 2 years ago
    Anonymous

    Nim.

    • 2 years ago
      Anonymous

      Redpill me on the advantages of Nim?

      • 2 years ago
        Anonymous

        it's like Python and Pascal had a baby

  9. 2 years ago
    Anonymous

    Zig
    Good article btw
    I encourage you to watch that boomer pov

    ?t=841
    > You should use ranges to create strings with caution, because doing so can crash your program
    > muh safety

    Rust is becoming a meme slowly but surely
    I suggestion to stick to JS/TS + Go + Zig/C for maximum impact on your future career, even more if you want to get out of globohomosexual companies

    • 2 years ago
      Anonymous

      I suggest*

    • 2 years ago
      Anonymous

      I suggest*

      I refuse to use zig until they implement proper borrow checking and lifetimes and have a plan for HKTs

      • 2 years ago
        Anonymous

        Does Rust have a plan for HKTs?

        • 2 years ago
          Anonymous

          Yes
          https://blog.rust-lang.org/2021/08/03/GATs-stabilization-push.html

          >I refuse to use zig until they implement proper borrow checking and lifetimes
          Lol, can't even take care of memory yourself, eh?

          Rust still requires you to take care of memory yourself. The borrow checker only means that the compiler will catch obvious memory errors

          • 2 years ago
            Anonymous

            GATs are not HKTs

          • 2 years ago
            Anonymous

            GATs can be used to emulate HKTs

          • 2 years ago
            Anonymous

            can you give me an example and show how one could use GATs to implement a functor trait?
            fyi, a functor is defined like so in a pseudo-rust that supports HKTs
            trait Functor<F> {
            fn map<T,U,G: Fn(T) -> U>(x: F<T>, f: G) -> F<U>;
            }

          • 2 years ago
            Anonymous

            There's lots of proof of concepts floating around
            https://users.rust-lang.org/t/monads-in-rust-with-gats/50487

          • 2 years ago
            Anonymous

            trait Functor<T> {
            type TyCon<U>;
            fn map<U, F: Fn(T) -> U>(self, f: F) -> Self::TyCon<U>;
            }

            impl<T> Functor<T> for Option<T> {
            type TyCon<U> = Option<U>;
            fn map<U, F: Fn(T) -> U>(self, f: F) -> Option<U> {
            match self {
            Some(x) => Some(f(x)),
            None => None
            }
            }
            }

            Unfortunately, there's no guarantee that TyCon is really the right type constructor. You would have to be able to write type equality constraints to ensure that:
            type TyCon<U> where Self == TyCon<T>;

            And that's not currently possible in a satisfying way (although I suspect that, when chalk gets merged into rustc, it will make it much easier to implement such a feature).

          • 2 years ago
            Anonymous

            >Rust still requires you to take care of memory yourself. The borrow checker only means that the compiler will catch obvious memory errors
            where?

          • 2 years ago
            Anonymous

            https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html#tymethod.alloc

          • 2 years ago
            Anonymous

            >https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html#tymethod.alloc
            You're trying to sell me unsafe rust?
            What's the point in even using unsafe rust?

          • 2 years ago
            Anonymous

            The same as using C or Zig (which are both inherently unsafe)

          • 2 years ago
            Anonymous

            >The same as using C or Zig (which are both inherently unsafe)
            I believe you don't understand what i am trying to say. The only reason you would want to use Rust is because of its inherently safe design, using unsafe completely diminishes this safety.

            even if you entirely abandon memory safety and fearless concurrency, Rust still has pattern matching, built-in sum types, real generics and greater expressiveness than C++.

            >even if you entirely abandon memory safety and fearless concurrency, Rust still has pattern matching, built-in sum types, real generics and greater expressiveness than C++.
            How you got to C++ is quite puzzling to me.
            I am arguing pro Zig and not pro C++

          • 2 years ago
            Anonymous

            I understand exactly what you're trying to say. You use unsafe to write safe abstractions, the same thing you would do in C or Zig in any real world program

          • 2 years ago
            Anonymous

            even if you entirely abandon memory safety and fearless concurrency, Rust still has pattern matching, built-in sum types, real generics and greater expressiveness than C++.

      • 2 years ago
        Anonymous

        >I refuse to use zig until they implement proper borrow checking and lifetimes
        Lol, can't even take care of memory yourself, eh?

      • 2 years ago
        Anonymous

        have fun with globohomosexual then

        • 2 years ago
          Anonymous

          All open source is globohomo, this board is globohomo, the entire internet is globohomo. What the frick do you think is the point of a network that allows you to talk to anyone in the entire world

          • 2 years ago
            Anonymous

            more and more companies reject it
            things start to change
            more and more normies start to open they fricking eyes
            this stack

            Zig
            Good article btw
            I encourage you to watch that boomer pov

            ?t=841
            > You should use ranges to create strings with caution, because doing so can crash your program
            > muh safety

            Rust is becoming a meme slowly but surely
            I suggestion to stick to JS/TS + Go + Zig/C for maximum impact on your future career, even more if you want to get out of globohomosexual companies

            is future proof

          • 2 years ago
            Anonymous

            >more and more companies reject it
            >things start to change
            Won't happen
            >more and more normies start to open they fricking eyes
            But this is closing your eyes, not opening them

          • 2 years ago
            Anonymous

            > not arguments
            > just deflecting
            > troons being the keyboard
            100%

          • 2 years ago
            Anonymous

            >no arguments
            >just speculation based on nothing

  10. 2 years ago
    Anonymous

    nothing will replace C but hare is the best alternative

  11. 2 years ago
    Anonymous

    For anyone who isn' interested in merely memes, Dlang (D) has the ability to manually manage memory. It was designed 20 years ago by a C++ compiler programmer to replace sepples, but also is capable of replacing C. Despite a lack of hype, it is a stable and ongoing project backed by its BDFL and is seeing adoption in enterprises here and there.

    It's worth checking out if you want no-nonsense, and that is why you will rarely hear IQfy ever discuss it.

    • 2 years ago
      Anonymous

      I thought it looked good, but I'm curious why it never took off.

    • 2 years ago
      Anonymous

      Walter Bright writes some very nice Hacker News comments, they're always a pleasure to read. But I get the impression he's spreading himself too thin—this week he's talking about borrowing Rust's borrow checking, that week he's writing an entire C compiler for inside his D compiler, and meanwhile people complain that the compiler as it exists now is half-assed enough to be painful.
      Over in Rustland they're willing to postpone features for years and they've got a guy who made it his life's purpose just to improve the error reporting. That's how you create a great language, long tedious refinement before exciting greenfield innovation.
      At least that's the picture I get from some half-remembered IQfy posts.

      >Rust still requires you to take care of memory yourself. The borrow checker only means that the compiler will catch obvious memory errors
      where?

      Memory is mostly managed through RAII, so not as explicit as Zig but rather on the level of C++.
      If you frick it up then you get an error at compile time.

      >https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html#tymethod.alloc
      You're trying to sell me unsafe rust?
      What's the point in even using unsafe rust?

      I have no clue why they posted that link to begin with, but that one's perfectly useful even if 98% of your code is safe.
      It's the interface you use to hook up allocating functions. So you use it to write a wrapper for kmalloc or something and then if you do it right the whole standard library now knows how to safely call kmalloc.

  12. 2 years ago
    Anonymous

    Zig is superior but lacks corporate backing like rust. Either is better than C.

  13. 2 years ago
    Anonymous

    Zig is superior, IMO, but Rust, sadly, seems to have achieved critical mass at this point.

  14. 2 years ago
    Anonymous

    Ada.

    • 2 years ago
      Anonymous

      Sell me on Ada? What does it do that Rust doesn't?

  15. 2 years ago
    Anonymous

    Hare of course. They've cuter logo.

  16. 2 years ago
    Anonymous

    >neither language has block comments

  17. 2 years ago
    Anonymous

    0.10 never, making a language, a c++ build system, a linker, and bootstrap your backend while the old one is still broken? huge mistake

Your email address will not be published. Required fields are marked *