• 0 Posts
  • 46 Comments
Joined 4 years ago
cake
Cake day: May 31st, 2020

help-circle



  • The fun part is that as a dev, you don’t really know that either. It’s just the file name of the executable. Anyone can rename that.
    And even if it’s not renamed, you still don’t know, if your users need to call it with just hx or with ./hx or some other path.

    Obviously, you should mention somewhere that the executable is likely called hx, but because that requires an explanation, there’s certainly a tendency to not mention it very often…




  • Nope, it’s their server software. This is a screenshot from the Factorio webpage, which is a video game. So, the normal Linux download is the playable game and you grab the headless download, if you want to host a multiplayer server.

    Your definition of “headless” is also somewhat wonky. It mostly means that it can function without a GUI, e.g. in the case of a server it does I/O via network ports and logs out any events that happen.
    This does often mean that you can log off (which in particular closes the GUI session), and it continues running. But if you launch a headless program underneath your particular user, with which you’re then going to log off, then it will close regardless (and not just because your GUI terminal emulator closes).
    Of course, most headless programs will have a SystemD service associated and ideally run under an isolated user anyways, so that will prevent them from being stopped when you log off.

    https://en.wikipedia.org/wiki/Headless_software



  • Nope, crucial difference between Java’s char[] and Rust’s &str is that the latter is always a pointer to an existing section of memory. When you create a char[], it allocates a new section of memory (and then you get a pointer to that).

    One thing that they might be able to do, is to optimize it in the JVM, akin to Rust’s Cow.
    Basically, you could share the same section of memory between multiple String instances and only if someone writes to their instance of that String, then you copy it into new memory and do the modification there.
    Java doesn’t have mutability semantics, which Rust uses for this, but I guess, with object encapsulation, they could manually implement it whenever a potentially modifying method is called…?



  • Yep, I also don’t fully agree on that one. I’m typing this on a degoogled Android phone with quite a bit stronger hardware than the iPhone SE that my workplace provides, e.g. octacore rather than hexacore, 8GB vs. 3GB RAM.

    And yet, you guessed it, my Android phone feels quite a bit laggier. Scrolling on the screen has a noticeable delay. Typing on the touchscreen doesn’t feel great on the iPhone either, because the screen is tiny, but at least it doesn’t feel like I’m typing via SSH.


  • Java is certainly the fastest of the bunch, but I still find it rather noticeable how long the startup of applications takes and how it always feels a bit laggy when used for graphical stuff.

    Certainly possible to ignore that on a rational level, but that’s why I’m talking about how it feels.
    I’m guessing, this has to do with just the basic UX principle of giving the user feedback. If I click a button, I want feedback that my click was accepted and when the triggered action completed. The sooner those happen, the more confident I feel about my input and the better everything feels.



  • Bad code can certainly be part of it. The average skill level of those coding C/C++/Rust tends to be higher. And modern programs typically use hundreds of libraries, so even if your own code is immaculate, not all of your dependencies will be.

    But there’s other reasons, too:

    • Python, Java etc. execute their compiler/interpreter while the program is running.
    • CLIs are magnitudes slower, because these languages require a runtime to be launched before executing the CLI logic.
    • GUIs and simulations stutter around, because these languages use garbage collection for memory management.
    • And then just death by a thousand paper cuts. For example, when iterating over text, you can’t tell it to just give you a view/pointer into the existing memory of the text. Instead, it copies each snippet of text you want to process into new memory.
      And when working with multiple threads in Java, it is considered best practice to always clone memory of basically anything you touch. Like, that’s good code and its performance will be mediocre. Also, you better don’t think about using multiple threads in Python+JS. For those two, even parallelism was an afterthought.

    Well, and then all of the above feeds back into all the libraries not being performant. There’s no chance to use the languages for performance-critical stuff, so no one bothers optimizing the libraries.


  • Honestly, it’s still ridiculous to me how slow Python, Java, JS, Ruby etc. continue to feel, even after decades of hardware optimizations. You’d think their slowness would stop being relevant at some point, because processors and whatnot have become magnitudes faster, but you can still feel it quite well, when something was implemented in one of those.