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

help-circle
  • 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.




  • Ephera@lemmy.mltoMemes@sopuli.xyzTwo types
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 day ago

    Yeah, I tried it in my other comment, and at first it started with “I think, folks…” which was already a dead end, because any continuation I tried would eventually need a “they”. Kind of wild that something as basic as plural can fuck you up. 😅






  • 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.




  • 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. 😅




  • Man, I haven’t done structural inheritance in years and by now, this reads like the ramblings of a mad person.

    Like, I recently had a use-case, where I actually wanted to define multiple types with the same fields and for various reasons ended up using a macro for that.
    And that still felt simpler than whatever is going on in this article, because there were no cross-relationships between the types at runtime. The macro templated the type definitions as if I had copy-pasted them, except there’s no actual code duplication, which is ultimately all I wanted.




  • Ephera@lemmy.mltoComic Strips@lemmy.world*Permanently Deleted*
    link
    fedilink
    English
    arrow-up
    21
    ·
    edit-2
    6 days ago

    A few years ago, I learned that the stomach rumble when you’re hungry, is part of a process that’s actually kind of important health-wise: https://en.wikipedia.org/wiki/Migrating_motor_complex

    So, it’s good when your stomach and small intestine empty out on a regular basis. It’s good when you’re hungry on a regular basis.
    Just yet another luxury problem of modern times, that we have food available at all times and need to stop ourselves from snacking.

    Side-note: It’s also good to go hungry, because then when you do eat, the food tastes so much better. This also means you can go for healthier food and still have it hit the spot.