• 0 Posts
  • 156 Comments
Joined 1 year ago
cake
Cake day: September 2nd, 2023

help-circle
  • The thing about UB is that many optimizations are possible precisely because the spec specified it as UB. And the spec did so in order to make these optimizations possible.

    Codebases are not 6 lines long, they are hundreds of thousands. Without optimizations like those, many CPU cycles would be lost to unnecessary code being executed.

    If you write C/C++, it is because you either hate yourself or the application’s performance is important, and these optimizations are needed.

    The reason rust is so impressive nowadays is that you can write high performing code without risking accidentally doing UB. And if you are going to write code that might result in UB, you have to explicitly state so with unsafe. But for C/C++, there’s no saving. If you want your compiler to optimize code in those languages, you are going to have loaded guns pointing at your feet all the time.


  • I recently came across a rust book on how pointers aren’t just ints, because of UB.

    fn main() {
        a = &1
        b = &2
        a++
        if a == b {
            *a = 3
            print(b)
        }
    }
    

    This may either: not print anything, print 3 or print 2.

    Depending on the compiler, since b isn’t changed at all, it might optimize the print for print(2) instead of print(b). Even though everyone can agree that it should either not print anything or 3, but never 2.


  • If you want to use instructions from an extension (for example SIMD), you either: provide 2 versions of the function, or just won’t run in some CPUs. It would be weird for someone that doesn’t know about that to compile it for x86 and then have it not run on another x86 machine. I don’t think compilers use those instructions if you don’t tell them too.

    Anyway, the SIMD the compilers will do is nowhere near the amount that it’s possible. If you manually use SIMD intrinsics/inline SIMD assembly, chances are that it will be faster than what the compiler would do. Especially because you are reducing the % of CPUs your program can run on.


  • Windows 11 is little more than a reskin of windows 10, and they still fucked it up.

    Rounded corners are mandatory (Why? I really preferred squared ones). But developers can choose to have their windows square. Why only the developers? Let the user decide how a windows looks like!

    And don’t get me started on the start menu. It was a complete massacre. Tiles are gone (am I the only one that liked them?). Instead, now we pin apps to the start menu. Fine I guess, except for the fact that half of the fucking menu is taken up by fucking recomendations. If I remove every single recommendation, instead of having my space back for more pinned programs I get this message: “oh you like this precious white space? If you turned on some recommendations it would show something”. No, i don’t want recommendations, I want my start menu space back. Which btw in windows 10 used to be resizable to whatever size I wanted.

    Oh and lets not forget about the volume mixer. Which some genius decided that it was better to keep it 10 clicks away from the user in the settings, instead of conveniently at one click in the taskbar. Which they also made the sound settings their own special taskbar element, instead of another taskbar program. So now if I want to replace their shitty sound settings with the ones I like (trumpet btw), now I would have 2 sound settings in the taskbar, while in win10 I only had 1.

    And whose Idea was to join the sound settings and internet settings in the same taskbar button visually? Which is also not the same button functionally. You see, if you press the left side of the button it opens the sound settings, but the right side opens the internet settings. How much do Microsoft UI people get paid?

    I guess we got dark notepad, that’s nice.





  • I haven’t used npm. But pip is horrible. Some times I’ve used a well-known library that only works on linux, but there is no mention of it whatsoever, and it installs without problem. The error only happens at run-time (not even when importing!) and says nothing about platform-dependency. I only learned that it was a linux-only library because I happened to try running it on a Linux machine to see if it worked.

    Many times you have to set up your environment a specific way (environment variables, PATH, install dependencies outside of pip) for it to work, and there’s no mention of it anywhere. Sometimes you install the library with pip, sometimes with apt, and there is no way to know which one. And sometimes the library is both in apt and pip, but the pip one does nothing.

    Furthermore, good luck importing a library. You might have installed it with “pip install my-library” but to import it you have to do “import MyAwesomeLibrary3”. And pip won’t tell you about that.





  • We need to differentiate between those cases because they are 2 distinct cases. And they are very different.

    They don’t even have the same purpose. The purpose of a human learning is: fulfill a desire to learn or acquiring a new skill that will be useful to fulfill another desire. The purpose of AI learning is: increase the value of the model so it can be sold for more.

    Lemmy is not an entity that is capable of thought. And I’m not Lemmy. I’m just another person and what you are reading is my opinion.

    “Publishers are bad and greedy, therefore everything that hurts them is good for society” is a childish take imo. Not everything is black and white. Copyright exists for a reason. Just removing it won’t make the world better. A law being flawed doesn’t make it worse than not existing.




  • So because you don’t understand it, everything it does should be legal?

    It’s not rare maths. There are trns of thousands of AI experts. And most CS graduates (millions) have a good understanding on how they work, just not the specifics of the maths.

    Yeah, they’re not selling a copy, they are just selling a subscription to a copying machine loaded with the information needed to make a copy. Totally different.

    I should start a business of printers and attach a USB with the PNG of a dollar bill. And of course my printers won’t have any government mandated firmware that disables printing fake money.

    I’m not printing fake money! It’s my clients! Totally legal.