• 40 Posts
  • 2.13K Comments
Joined 6 years ago
cake
Cake day: May 31st, 2020

help-circle
  • 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.mltolinuxmemes@lemmy.worldArch be Like
    link
    fedilink
    English
    arrow-up
    1
    ·
    4 days ago

    Hmm, good question. I know of one such implementation, which is Delta RPM, which works the way I described it.
    But I’m not sure, if they just designed it to fit into the current architecture, where all their mirrors and such were set up to deal with package files.

    I could imagine that doing it rsync-style would be really terrible for server load, since you can’t really cache things at that point…



  • Ephera@lemmy.mltolinuxmemes@lemmy.worldArch be Like
    link
    fedilink
    English
    arrow-up
    5
    ·
    5 days ago

    This doesn’t work too well for rolling releases, because users will quickly get several version jumps behind.

    For example, let’s say libbanana is currently at version 1.2.1, but then releases 1.2.2, which you ship as a distro right away, but then a few days later, they’ve already released 1.2.3, which you ship, too.
    Now Agnes comes home at the weekend and runs package updates on her system, which is still on libbanana v1.2.1. At that point, she would need the diffs 1.2.1→1.2.2 and then 1.2.2→1.2.3 separately, which may have overlaps in which files changed.

    In principle, you could additionally provide the diff 1.2.1→1.2.3, but if Greg updates only every other weekend, and libbanana celebrates the 1.3.0 release by then, then you will also need the diffs 1.2.1→1.3.0, 1.2.2→1.3.0 and 1.2.3→1.3.0. So, this strategy quickly explodes with the number of different diffs you might need.

    At that point, just not bothering with diffs and making users always download the new package version in full is generally preferred.



  • The thing to me is always that, yeah, you need a huge commit for a breaking change in an internal library inside a monorepo, but you will still need to do the same work in a polyrepo eventually, too.

    Especially since “eventually” really means “ASAP” here. Without going through the breaking change, you can’t benefit from non-breaking changes either and the complexity of your codebase increases the longer you defer the upgrade, because different parts of your application have different behavior then. So, even in a polyrepo, you ideally upgrade all library consumers right away, like you’re forced to in a monorepo.




  • On KDE, it’s just one of the suggestions, I believe, that you could search this term on the web. If you trigger that suggestion, it then opens the web browser to do the search.

    As such, searching “terminal” wouldn’t yield a suggestion from a web result that matches, but I’m pretty sure applications are prioritized above other results either way.



  • A few years ago, I set up a home-server with music and some pictures on there, and recently I noticed that my storage disk was getting full. Then I saw that the disk only had 16 GB and wondered, where the hell I got that small of a disk from.

    So, I go to plug in a bigger disk and can’t even find the original disk at first. Turns out my whole storage capacity was one of these bad boys:

    Spoiler

    A tiny USB-A stick, designed for keeping it plugged into a laptop at all times.

    And yeah, I’ve got about 1800 songs, clocking in at 5.8 GB, so even that tiny storage would easily be enough for a much larger collection.
    And I do also have them replicated on my phone, for listening on the go. (Don’t even need an SD card in my case.)