• 15 Posts
  • 754 Comments
Joined 6 years ago
cake
Cake day: May 31st, 2020

help-circle


  • I’m on NixOS for my personal laptop, too. I just tried it and well, #!/bin/bash apparently does not work, but #!/bin/sh does.

    The file /bin/sh does also exist as a symlink for me:

    > ls -l /bin/sh
    lrwxrwxrwx 1 root root 73 14. Dez 19:50 /bin/sh -> /nix/store/35yc81pz0q5yba14lxhn5r3jx5yg6c3l-bash-interactive-5.3p3/bin/sh*
    

    Does that point into the bash package for you, too?


    Edit: And for #!/bin/bash, the output was:

    > ./test
    exec: Failed to execute process './test': The file specified the interpreter '/bin/bash', which is not an executable command.
    

  • To give a quick highlight, because this case is often politicized and misrepresented:

    The plaintiff, Stella Liebeck (1912–2004), a 79-year-old woman, purchased hot coffee from a McDonald’s restaurant, accidentally spilled it in her lap, and suffered third-degree burns in her pelvic region. She was hospitalized for eight days while undergoing skin grafting, followed by two years of medical treatment. […]

    Liebeck’s attorneys argued that, at 180–190 °F (82–88 °C), McDonald’s coffee was defective, and more likely to cause serious injury than coffee served at any other establishment.

    So, the lawsuit never demanded McDonald’s to put a warning that you’re not supposed to spill hot coffee on yourself. It argued that it’s an unnecessary safety hazard, because the coffee was served at hazardous temperatures.
    No matter how many warnings you put down, it can happen that someone spills coffee on themselves and they shouldn’t need to be hospitalized from that.


  • Runtimes/“VMs” like the JVM also allow nice things like stack traces. I don’t know about the author but I much prefer looking at a stack trace over “segmentation fault (core dumped)”. Having a runtime opens new possibilities for concurrency and parallelism too.

    Rust has stacktraces without needing a runtime. Don’t ask me what exactly is going on behind the scenes, but there is a way to request a stacktrace for a given point in the program. And unless you’re doing embedded stuff, a stacktrace is automatically generated for errors.

    And as for concurrency/parallelism, it’s correct what you wrote, but I just wanted to point out that it doesn’t have to be a language runtime. Using Rust as an example again, you typically spawn the Tokio async runtime on program start, if you’re gonna do async/await stuff.


  • I find it annoying, because the hype means that if you’re not building a solution that involves AI in some way, you practically can’t get funding. Many vital projects are being cancelled due to a lack of funding and tons of bullshit projects get spun up, where they just slap AI onto a problem for which the current generation of AI is entirely ill-suited.

    Basically, if you don’t care for building useful stuff, if you’re an opportunistic scammer, then the hype is fucking excellent. If you do care, then prepare for pain.


  • That is definitely not right. That sounds like you don’t have a shebang or it isn’t defined correctly. The shebang has to be the very first thing in the script, with no whitespace before it. It gets read out by the kernel, which very dumbly checks the first few bytes.

    And well, such a shebang should also work for Python or the like. If you copy the first script in this link into a file script.py, then run chmod +x script.py and finally run ./script.py, does that print Hello, World! ?



  • Yeah, modern computers often feel like a scam. Obviously, some things are faster and obviously, we can calculate more complex problems.
    But so often, programs are only optimized until they reach a level of “acceptable” pain. And especially with monopolistic, commercial software that level is close to infinity, because well, it’s acceptable so long as customers don’t switch to competitors.

    Either way, the slowness that was acceptable twenty years ago is generally still acceptable today, so you get much of the same slowness despite being on a beefier PC.








  • Lots of “modern” languages don’t interop terribly well with other languages, because they need a runtime environment to be executed.
    So, if you want to call a Python function from Java, you need to start a Python runtime and somehow pass the arguments and the result back and forth (e.g. via CLI or network communication).

    C, C++, Rust and a few other languages don’t need a runtime environment, because they get compiled down to machine code directly.
    As such, you can call functions written in them directly, from virtually any programming language. You just need to agree how the data is laid out in memory. Well, and the general agreement for that memory layout is the C ABI. Basically, C has stayed the same for long enough that everyone just uses its native memory layout for interoperability.

    And yeah, the Rust designers weren’t dumb, so they made sure that Rust can also use this C ABI pretty seamlessly. As such, you can call Rust-functions from C and C-functions from Rust, with just a bit of boilerplate in between.
    This has also been battle-tested quite well already, as Mozilla used this to rewrite larger chunks of Firefox, where you have C++ using its C capabilities to talk to Rust and vice versa.



  • Yeah, I’ve considered setting up a scrappy rsync solution, because Syncthing felt like overkill for that use-case and like it might stop working one day.

    There’s the Syncopoli app on F-Droid, which hasn’t been updated in three years, but it seems to just be a thin wrapper around rsync, which has been stable for decades, so I still kind of trust it more to continue working. Or at the very least, if I need to fix something or update the app myself, I feel like I’ll be able to do it.



  • I think it was that back when it was relevant (but replace data scientists with web devs)

    Sure, but if programs from that era are still around, chances are the maintainer is quite experienced by now and has fixed all the funky behaviour. 🙃

    I never got interested in the ecosystem myself, but I’ve run into it every now and then. I feel like it’s in the same place as PHP today: still used a lot for legacy reasons, but you’ll get weird looks if you start a new project with it and you’re under the age of 40

    Ten years ago, a university buddy of mine discovered Ruby and you might’ve thought a miracle happened from how excited he was for it. But yeah, that was also the last time I met someone in real life who was excited about Ruby. 😅