News for hackers. Stuff that matters.
Re:A Little Story About the `yes` Unix Command by nodesocket on Wednesday October 11, 2017 @11:41PM (#15455499)

    main(argc, argv)
    char **argv;
    {
      for (;;)
         printf("%s\n", argc>1? argv[1]: "y");
    }
Is beautiful, readable, and minimal. The "optimized" Rust version is complicated and over 50 lines of code. At what point does performance optimization go too far?
Re:A Little Story About the `yes` Unix Command by trungaczne on Thursday October 12, 2017 @01:41AM (#15455905)
This is an unfair comparison. For starter this version too is unoptimized, so you need to compare this with the first Rust code, which is about the same size.

Moreover a lot of the "bloat" that comes with Rust code isn't because it's more performant. Neither C++ and Rust try to be faster languages (after all, the optimization tricks you can do with your program is limited to what you can do with Assembly and its cousin, C), they try to be safer by providing more abstractions and restrictions (compile time checks).

Re:A Little Story About the `yes` Unix Command by 1_2__4 on Wednesday October 11, 2017 @11:55PM (#15455552)
As a non-Rust developer my first thought upon seeing the optimized version was “On the other hand let’s not visit Rust, ‘tis a silly place.”
Re:A Little Story About the `yes` Unix Command by LEGOlord208 on Thursday October 12, 2017 @01:14AM (#15455818)
There was a lot of things about Rust that made think it was weird before I actually gave in and tried it. Now I adore Rust. You should try it.
Re:A Little Story About the `yes` Unix Command by azernik on Thursday October 12, 2017 @01:26AM (#15455862)
Since it can be used to repeat arbitrary data, it is liable to be used in performance-sensitive tasks (mostly along the lines of pumping dummy data to a program or piece of hardware that's being benchmarked).