• 0 Posts
  • 43 Comments
Joined 1 year ago
cake
Cake day: June 11th, 2023

help-circle
  • Every year or two I give Windows a genuine try for around a month. WSL2 is actually pretty decent, it’s a massive improvement on the Windows development experience I had back in 2015 when I tried running Windows full time doing Python/Ruby/Java development. Required cygwin, git bash, power shell, and cmd depending on what I was doing. It was a special kind of nightmare. Lots of native gems couldn’t compile, lots of tooling issues, etc.

    Now you can use exclusively Windows terminal, keep essentially all your development stuff in a Linux subsystem, and pretend you’re in Linux. Integration with things like vscode or intellij is quite decent with the WSL.

    That said, I hate Microsoft, hate the lack of customization, hate the default UI, hate the split between Windows 95-style settings and new Windows 10+, it’s inconsistent as hell. Moving windows across monitors with different scaling still resizes the windows in a very archaic way. You can’t reasonably use multiple desktops because you can’t easily rebind keys to swap desktops without third party software. I’ve changed DEs in Linux for smaller issues than these.


  • Yeah for both Ubuntu and Arch on two separate computers in my house, the process was just install the distro then install steam + Lutris (steam for steam games, Lutris for every other kind of game like League or WoW).

    Installing steam games is identical in Linux and Windows for the vast majority of games. Installing non-steam games is arguably easier since you never have to go to a web browser.

    Honestly the only reason Windows is “easier” is because it’s preinstalled on computers. As someone who has fresh installed Linux and Windows, Linux is miles easier to install. To install Windows 11 I tried following their recommendations (enabling TPM and secure boot in bios), but the W11 installer still didn’t like my 2 year old computer, so had to open up the command prompt, regedit, and add 3 Bypass registry DWord 32 bit values. Then actually installing the O.S you just sit there and wait with an unusable computer. Linux installations have nice GUIs that are far more modern, don’t require weird terminal hacks, and you have a usable computer while it’s installing (you can open up Firefox and browse the web for example).

    \rant




  • Nevoic@lemmy.worldtoProgrammer Humor@programming.devGolang be like
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    11 months ago

    Note: Lemmy code blocks don’t play nice with some symbols, specifically < and & in the following code examples

    This isn’t a language level issue really though, Haskell can be equally ergonomic.

    The weird thing about ?. is that it’s actually overloaded, it can mean:

    • call a function on A? that returns B?
    • call a function on A? that returns B

    you’d end up with B? in either case

    Say you have these functions

    toInt :: String -> Maybe Int
    
    double :: Int -> Int
    
    isValid :: Int -> Maybe Int
    

    and you want to construct the following using these 3 functions

    fn :: Maybe String -> Maybe Int
    

    in a Rust-type syntax, you’d call

    str?.toInt()?.double()?.isValid()
    

    in Haskell you’d have two different operators here

    str >>= toInt &lt;&amp;> double >>= isValid
    

    however you can define this type class

    class Chainable f a b fb where
        (?.) :: f a -> (a -> fb) -> f b
    
    instance Functor f => Chainable f a b b where
        (?.) = (&lt;&amp;>)
    
    instance Monad m => Chainable m a b (m b) where
        (?.) = (>>=)
    

    and then get roughly the same syntax as rust without introducing a new language feature

    str ?. toInt ?. double ?. isValid
    

    though this is more general than just Maybes (it works with any functor/monad), and maybe you wouldn’t want it to be. In that case you’d do this

    class Chainable a b fb where
        (?.) :: Maybe a -> (a -> fb) -> Maybe b
    
    instance Chainable a b b where
        (?.) = (&lt;&amp;>)
    
    instance Chainable a b (Maybe b) where
        (?.) = (>>=)
    

    restricting it to only maybes could also theoretically help type inference.


  • Nevoic@lemmy.worldtoProgrammer Humor@programming.devGolang be like
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    11 months ago

    Here’s an example (first in Haskell then in Go), lets say you have some types/functions:

    • type Possible a = Either String a
    • data User = User { name :: String, age :: Int }
    • validateName :: String -> Possible String
    • validateAge :: Int -> Possible Int

    then you can make

    mkValidUser :: String -> Int -> Possible User
    mkValidUser name age = do
      validatedName ← validateName name
      validatedAge  ← validateAge age
      pure $ User validatedName validatedAge
    

    for some reason <- in lemmy shows up as &lt;- inside code blocks, so I used the left arrow unicode in the above instead

    in Go you’d have these

    • (no Possible type alias, Go can’t do generic type aliases yet, there’s an open issue for it)
    • type User struct { Name string; Age int }
    • func validateName(name string) (string, error)
    • func validateAge(age int) (int, error)

    and with them you’d make:

    func mkValidUser(name string, age int) (*User, error) {
      validatedName, err = validateName(name)
      if err != nil {
        return nil, err
      }
    
      validatedAge, err = validateAge(age)
      if err != nil {
        return nil, err
      }
    
      return User(Name: validatedName, Age: validatedAge), nil
    }
    

    In the Haskell, the fact that Either is a monad is saving you from a lot of boilerplate. You don’t have to explicitly handle the Left/error case, if any of the Eithers end up being a Left value then it’ll correctly “short-circuit” and the function will evaluate to that Left value.

    Without using the fact that it’s a functor/monad (e.g you have no access to fmap/>>=/do syntax), you’d end up with code that has a similar amount of boilerplate to the Go code (notice we have to handle each Left case now):

    mkValidUser :: String -> Int -> Possible User
    mkValidUser name age =
      case (validatedName name, validateAge age) of
        (Left nameErr, _) => Left nameErr
        (_, Left ageErr)  => Left ageErr
        (Right validatedName, Right validatedAge) => 
          Right $ User validatedName validatedAge
    

  • For people unfamiliar with the vim ecosystem (I assume that’s at least part of the down votes), it’s actually much closer than you’d expect. If you’re only familiar with vi/vim, nvim customizations are essentially on feature parity with vscode, with the added benefit of the vim-first bindings.

    What you have to do is install a customized neovim environment. Lunarvim, astrovim, nvchad, etc. Most of them have single line installation options for Linux, and then it comes with a bunch of plugins that will pretty much match whatever you’d find with vscode extensions.


  • Agree on majority of the post, except for “make the choices you feel are right”. Hard disagree on this normatively. If you’re saying it descriptively, sure, but it’s essentially tautological at that point.

    We shouldn’t advocate that people just act in whatever way feels correct to them. Sociopaths feel like it’s okay to do things that are not okay. So do bigots, racists, speciesists, sexists, etc.

    We should instead do what you’re doing with the majority of your post, advocate for correct positions and then come to a rational conclusion with the people we are talking to. Giving them a get out of jail free card, permitting them to do literally anything, is unnecessary.



  • Nevoic@lemmy.worldtoCommunismProtestation
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    11 months ago

    You identified yourself as an advocate for (regulated) capitalism

    Central characteristics of capitalism include capital accumulation, competitive markets, price systems, private property, property rights recognition, voluntary exchange, and wage labor. In a market economy, decision-making and investments are determined by owners of wealth, property, or ability to maneuver capital or production ability in capital and financial markets—whereas prices and the distribution of goods and services are mainly determined by competition in goods and services markets.

    Yes there is more to this, welfare capitalism exists where in exceptional circumstances (e.g food, sometimes basic shelter, etc.) goods are distributed outside of the market system, but it’s totally fair to infer that a capitalist would advocate that the market is setting the levels of compensation for the vast majority of professions.

    Arguing that these levels of compensation should be agreed upon democratically is an entirely socialist position. This is an advocacy for central, democratic planning that flies in direct opposition to capitalism.

    It seems like you’re probably a capitalist-realistic (you believe no other economic system is viable), but you recognize the faults of capitalism and are trying to reform essentially every aspect of the economy to be socialist while still keeping some extremely small sliver of bourgeoise so you can call yourself a capitalist and feel like your position is a “realistic” one.

    The irony is that keeping this however small and crippled parasitic class of capitalists around is always an existential threat to the working class. They’re a group of people whose economic interests are in opposition to our own. We don’t need people with different relationships to capital just by a happenstance of birth or luck.


  • Nevoic@lemmy.worldtoCommunismProtestation
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    1
    ·
    edit-2
    11 months ago

    There’s a phenomenon in psychology called “crowding out”, where extrinsic motivators (e.g money) can destroy intrinsic motivators (e.g passion), because they’re more important (you need money to survive, you don’t need passion).

    The take that communism is bad for incentives and capitalism is good for incentives is far too naive. What capitalism can do effectively is make a large mass of people do a lot of work they don’t want to do, and turn work they do want to do into a nightmare, where communism would instead focus on reducing the overall burden of unpleasant work, and find non-market solutions for distributing the unpleasant work.

    Automating the bad away then becomes a positive instead of an existential threat to our existence. Many other contradictions of capitalism fall away when we look towards non-capitalists modes of production.

    A lot of people frame non-market solutions as “compulsory”, and market solutions as “free”, even though again that’s far too reductive, having the choice between starving and janitorial work isn’t really a good faith choice, and yet these are the kinds of choices capitalism uses and calls the epitome of freedom.






  • I’m on Linux full time for programming and gaming. I play battle.net games (WoW, hearthstone, overwatch, HoTS, WoW classic), League of Legends, and a lot of steam games. I have virtually no issues. I have a ryzen 5900x and a RTX 3080.

    The key to Linux gaming (outside of steam) is Lutris. You just search the game you want to install, and it installs all the dependencies needed automatically and you can launch the game from one place. They even have a simple 1 click button for adding steam games too if you want a single launcher for every game you have (this is what I do).

    The only issues I really have are with EAC, like DKO didn’t work for a bit after it came out (but does now), and Valorant/Fortnite don’t work (they can easily enable Linux EAC but choose not to). I happen to not play these games so it’s a non-issue for me, but worth mentioning.

    League of Legends is also worth mentioning as having more issues than the rest. Usually I can run the game for months or even a year+ with no issues, but earlier this year the game was virtually unplayable on Linux for about 6 days due to a bug Riot Games added. This bug also effected Windows users, but to a much less extent. They would get disconnected once every couple games, while Linux users would get disconnected once every couple minutes. The League of Linux community is amazing though, and people were troubleshooting it constantly and making it more and more playable (getting to Windows parity on the bug), until Riot Games fixed it on their end.

    I even helped my brother swap from Windows to Linux recently. He isn’t super into Linux or anything, but he was having consistent issues on Windows with his monitor turning off in games, specifically League. We tried reinstalling drivers, watching temps, reinstalling League (since it didn’t happen in other games), and uninstalling certain apps that can add overlays (though they were disabled). Some of these issues seemed to fix it until it returned usually hours or days later. Eventually we gave Linux a try and the issue is entirely gone. It’s likely that resetting windows would work too, but he dual boots and it’s easier to not have to reinstall everything.


  • That’s the idea, but in practice since the data exists independently on each server, it takes network time and computational time for them to align. In practice I expect comments to function as you expect, and upvotes to be slightly off depending on which instance you’re viewing from.

    Things get a bit more weird when an instance gets defederated from another instance. My understanding here is that if you have instance A defederate from instance B, but instance B was listening to some of instance A’s communities, that instance B will have an independent replica of that community that doesn’t sync (this happened when beehaw defederated from open registration instances like lemmy.world).




  • “from a private third party” where? A (non-foolish) socialist would advocate for rules against renting people, just like we’re not allowed to buy people right now.

    That would mean there would be no private third parties that are renting out factories of rented workers.

    If what you’re saying is “from a private third party outside the socialist space”, then that’s a problem for all kinds of socialist spaces. We can’t control productive forces outside of the space we have domain over.