So this is the power of rust.

So this is the power of rust.

Beware Cat Shirt $21.68

Rise, Grind, Banana Find Shirt $21.68

Beware Cat Shirt $21.68

  1. 2 years ago
    Anonymous

    - "But it's safer"
    - "Bigger binaries don't matter, L1Code cache doesn't exist it can't hurt me."
    - "Code size doesn't matter, L3 cache is limitless it can't hurt my compilation times."

    • 2 years ago
      Anonymous

      What do binary size and code size have to do with L1 and L3 caches? Not provoking, just curious.

      • 2 years ago
        Anonymous

        more % code fit in cache give more fast

      • 2 years ago
        Anonymous

        Literally nothing. One more Black person cattle just parroting something it heard.

      • 2 years ago
        Anonymous

        Literally nothing. One more Black person cattle just parroting something it heard.

        >L1 Code Cache doesn't exist
        When you think about it in terms of the entire system, you easily can see how things like this add up across programs kernel modules etc.
        Yes filling the L1Code Cache by a single program would be pretty hard, but programs exist in a multi-process environments, add to it containers which negate shared library memory benefits(and it's effects on holding cache) and you can imagine how higher size causes troubles.
        -------------
        Context switching can also cause plenty of evictions from the L1C cache.
        If your programs code is bigger(and by that I mean, the active hot-code size is bigger), then you evict more code from L1 to L2 and data operations can get that evicted even out of L3.
        Yes it largely won't be a problem while your program is running, after-all the L1C will just get repopulated with your application's code, and you will be running at full speed as long as your code will hit cache effectively/work well with prefetcher.
        Yeah you can expect that plenty of high performance programs to query and mind the L1/L2/L3 sizes for their operations to improve performance.
        ------------
        Unless you are mentally moronic and think Code size never plays a role.
        Ever noticed loop unrolling has a limit?
        There's a very good reason for it;
        Yes branch misses have a cost, but in a large loop modern cpu branch predictor works to your advantage, as well as your code being more local in terms of cache helps a lot(and it helps when your code is evicted out of cache to more quickly repopulate it).

  2. 2 years ago
    Anonymous

    Rust is a meme language. It will die off like it's proponents soon enough.

    • 2 years ago
      Anonymous

      Most likely, and many of its useful features will find their way into C++.

      • 2 years ago
        Anonymous

        the c++ committee will have some real difficulty figuring out worse syntax for it than what rust is already using, but i'm confident that they can manage it

        • 2 years ago
          Anonymous

          accurate

  3. 2 years ago
    Anonymous

    How the frick does this happen?
    Just put yourself in their shoes. You sit down to write implement echo in rust, you type 5258 characters, for ECHO. How do you justify this? How come after the first thousand you don't think "Hey, shouldn't there be a simple way of doing this" Maybe you try that way and the compiler b***hes at you, cause that's what we need a compiler that complains about nothing MORE than GCC. Bravo, rust, you've done it.

    • 2 years ago
      Anonymous

      GNU coreutils:
      $ wc -c echo.c
      7757 echo.c
      busybox:
      $ wc -c echo.c
      9828 echo.c

      All serious echo implementations support escape codes, for better or worse.

      • 2 years ago
        Anonymous

        Then the Rust implementation isn't serious.
        Check bsd, also busybox has many comments and duplicate code.

        • 2 years ago
          Anonymous

          The Rust implementation does parse escape codes. But I'll take back the "serious" comment, I see OpenBSD's doesn't do it.
          Here's a basic implementation with only -n:
          fn main() {
          let mut newline = true;
          let mut args = std::env::args().skip(1).peekable();
          if args.next_if_eq("-n").is_some() {
          newline = false;
          }
          if let Some(arg) = args.next() {
          print!("{arg}");
          }
          for arg in args {
          print!(" {arg}");
          }
          if newline {
          println!();
          }
          }
          Handling errors gracefully and passing invalid unicode through unmodified does add some extra code.

      • 2 years ago
        Anonymous

        >All serious echo implementations
        are in (You)r shell.
        Not a single soul has actually used /bin/echo since 198x

        • 2 years ago
          Anonymous

          > he opens a text file in an editor to add a single line of text

          • 2 years ago
            Anonymous

            >he thinks $ echo I suck wieners >> hobbies.txt calls /bin/echo
            also yes, what are you gonna do about it?

          • 2 years ago
            Anonymous

            echo --version
            /bin/echo --version

            https://unix.stackexchange.com/questions/684083/echo-version-or-not-to-be

    • 2 years ago
      Anonymous

      reimplementing coreutils is incredibly annoying because there is a frickload of scripts that depend on odd/misused behavior. some programs like cat are used incorrectly more often than not. so you end up adding shitloads of edge case accommodations.

      • 2 years ago
        Anonymous

        >reimplementing coreutils is incredibly annoying because there is a frickload of scripts that depend on odd/misused behavior.
        Cope, they don't even pass gnu's test suite let alone posix, let alone random old scripts using undefined behavior.

  4. 2 years ago
    Anonymous

    >doesn't show the C code
    >doesn't show the Rust code
    >could have facked this
    >anons are still believing this shit
    and you love to call each other cattle. lmao
    >inb4 *troony joke*
    think harder, bot

    • 2 years ago
      Anonymous

      Wtf are you on about schizo, it's clearly uutils rust and 9base echo

  5. 2 years ago
    Anonymous

    It's about time we had another RUST HATE thread.

  6. 2 years ago
    Anonymous

    this is an example of Rustration, where using rust slowly rots your brain until you're just irrationally upset for no reason at all. It happens more quickly to women too

    • 2 years ago
      Anonymous

      True rust brain is rather pronounced when the rustacean thinks xe has been productive by winning a 30 minute argument with his compiler.

  7. 2 years ago
    Anonymous

    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <err.h>
    int
    main(int argc, char **argv)
    {
    char *p;
    int nflag = 0, eflag = 0;
    while (*++argv) {
    if (**argv != '-')
    break;
    p = *argv;
    while (*++p) {
    switch (*p) {
    case 'n': nflag = 1; break;
    case 'e': eflag = 1; break;
    case 'E': eflag = 0; break;
    default:
    errx(1, "invalid option '%c'", *p);
    break;
    }
    }
    }
    while (*argv) {
    if (eflag) {
    p = *argv;
    int i = 0, j = 0;
    while (p[i]) {
    if (p[i] == '\') {
    int chr = -1;
    switch (p[++i]) {
    case 0: continue;
    case '\': chr = '\'; break;
    case 'a': chr = 'a'; break;
    case 'b': chr = 'b'; break;
    case 'e': chr = 'e'; break;
    case 'f': chr = 'f'; break;
    case 'n': chr = 'n'; break;
    case 'r': chr = 'r'; break;
    case 't': chr = 't'; break;
    case 'v': chr = 'v'; break;
    }
    if (chr != -1) {
    p[j++] = chr;
    ++i;
    continue;
    }
    char mode = p[i];
    if (mode != 'x' && mode != '0') {
    errx(1, "invalid escape '%c'", p[i]);
    continue;
    }
    char nbuf[4];
    char *endp;
    memcpy(nbuf, p + ++i, 3);
    nbuf[mode == 'x' ? 2 : 3] = 0;
    chr = strtoul(nbuf, &endp, mode == 'x' ? 16 : 8);
    int diff = endp - nbuf;
    if (mode == 'x' && !diff)
    errx(1, "invalid hex number at "%s"", p + i - 2);
    if (mode == '0' && diff == 3 && nbuf[0] > '3')
    errx(1, "too large octal number at "%s"", p + i - 2);
    p[j++] = (unsigned)chr & 0xff;
    i += diff;
    }
    else {
    p[j++] = p[i++];
    }
    }
    fwrite(p, 1, j, stdout);
    }
    else {
    fputs(*argv, stdout);
    }
    if (*++argv)
    putchar(' ');
    }
    if (!nflag)
    putchar('n');
    return 0;
    }

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