You die twice. One time when you stop breathing, and a second time, a bit later on, when somebody damns your soul for the last time.

  • Hafez Al-Assad
  • 1 Post
  • 19 Comments
Joined 2 years ago
cake
Cake day: December 17th, 2024

help-circle
  • Very integral. When someone says they’re “struggling with Rust”, it’s thanks to the borrow checker.

    Rust’s whole shtick is the way it manages memory, which is the rules enforced by the borrow checker.

    Basically:

    When you want to store values in variables in any programming language, the memory should be allocated when you need it and freed as soon as you don’t anymore.

    Traditionally there are two ways this is done:

    1. You manage it completely yourself, which is “unsafe” as you can forget to free memory you no longer need. This is called leaking memory. Or “reference” the location of something you freed previously, thereby attempting to read data you may not have permission to read (the OS will usually prevent that and kill the program), or reading and using a value you didn’t expect, causing undefined behavior and fun to deal with bugs.

    2. The language, sometimes using a process which runs alongside your main program, manages memory. Which adds lots of overhead.

    Rust has it’s own way of doing this: It adds some rules on how you can pass around references and ownership and these rules are affected by whether you can or can’t edit the referenced data. All just so the compiler knows the lifetime of the vars that hold that data and when it can free it (before the program is even compiled, so no overhead when the program is running). Not following the strict rules prevents your program from being compiled into an executable.

    The compiler gives very helpful info, tips, and pointers™ though, Rust is also know for this.


  • WDYM Libadwaita is not customizable? Libadwaita is the most customizable UI lib I would say. You literally can just change every part of any app through css and call it a day.

    I haven’t tried doing it in a while, but I remember it being very difficult to change themes beyond tint and colors, with lots of apps having custom colors not in the pallet used in the “gtk.css” file.


  • Limitless_screaming@kbin.earthtolinuxmemes@lemmy.worldGnome Slander
    link
    fedilink
    arrow-up
    14
    arrow-down
    6
    ·
    2 months ago

    Gnome is great.

    Most Linux users can’t deal with every single project not prioritizing customization. Gnome having a unique workflow (which is a great one) is unbearable for some reason.

    I am not gonna place the full blame on the Linux community though. Gnome started out way more customizable, so maybe that suddenly getting pulled from underneath Gnome users so inconsiderately gave it a bad reputation.

    Then they went and did absurd things with libadwaita to not only stop supporting customization, but actively interfere with people’s choices of customizing Gnome and libadwaita apps so apps ~“are viewed and used as intended by their developers, and people don’t accidentally break apps and complain to the devs” (i.e. Bullshit).

    Literally the only foundation that made Linux usable, stable, unified and customizable.

    I really can’t see how. It’s popular and user friendly, but I can’t seriously give it that much importance.

    For me at least: It just serves to show that Linux UIs can be clean, consistent, and user friendly. Which might pull in funding from companies and governments looking for a good UI to mass deploy.

    But if it didn’t exist, Plasma would’ve eventually filled that vacuum.





  • Yeah, that’s the solution I asked about (last line of my question). I was just trying to make sure that this is ok and won’t tangle up my code later on.

    I’m not sure why you’re using as to make the module name longer? Usually, if I use it at all, I use it make things shorter. Anyway, once you’ve imported dep2, you can call dep2.some_fn().

    That was just for the example (clarifying order of import). The actual code has imports such as from src.formatter import Formatter as fmt; always making the name shorter.

    Thanks for the suggestions






  • it feels like a “web app” more than a website. Like, it somehow needs to “load” after loading the page… unlike classic forum softwares that just instantly show the pre-rendered page.

    I kind of like this behavior. If you’re writing a complex website with user posts, comments, tags, and other nifty stuff and want it to stay modular it’s almost guaranteed that you’ll end up with this loading behavior (unless you want to SSR everything).

    ui also feels way too ‘simple’, hard to navigate and has low info density. i guess this is how more people nowadays prefer things to work

    Don’t know about that, I find it easy to navigate with the consistent sidebar elements. Searching for posts is easy since they’re usually well tagged and have good titles. Searching for solutions and checking out community contributions and votes is about 90% of my use case for a forum. Maybe you have different use cases.