Paint.NET 5.2 Alpha (build 9739) contains extremely experimental support for WINE (which means Linux).

Some of you may be happy to hear this. Some may be not. It may make for some interesting debate, or something like it.

ETA:

This was written by our good friend Claude, without whom this would NOT have been possible and would NEVER have happened.

Quick Important Side Note: If you don’t like AI, if you hate AI, if you refuse to run any software that AI touches, if your favorite pejorative is now “slop” … fine. Whatever. I’m not going to try and convince you otherwise. You’re entitled to your own opinion, I don’t care. But keep that talk out of here. You don’t have to use this. It’s clearly not for you.

Most of this code is, as they say, “vibe coded.” By that I mean that it has not been thoroughly reviewed, it’s more “trust me bro” style. I cannot possibly review 180,000 lines of code, it’s just way way way too much. For reference, the rest of Paint.NET is about 700,000 lines of code and I’ve been working on it for over 20 years. I did thoroughly review any code that had to be changed or added elsewhere in the Paint.NET code base (refactoring and integration points, etc.). Over time I do hope that more of this code will be vetted by real humans and also by more advanced AI models.

At times, Claude was working with the fury of 10 freshly unshackled Einstein genius-level 10x coders. And other times … well, not so much. I had to babysit Claude quite a bit to make sure it did resource management correctly (for awhile it just wasn’t doing the COM equivalent of AddRef() for reference counted objects, oops). I had to slap it a few times when I found some really bad design or architecture decisions. And I was also impressed at some rather clever and tireless reverse engineering work it did to figure out all the formulas needed for implementing Direct2D’s built-in effects library. It never had to decompile/disassemble d2d1.dll, it figured it all out “clean room” style*. And it never got tired, it never got bored, and it never got annoyed when I changed my mind 10 times in a row.

Day and night, it just kept coding, and coding, and coding … writing tests, comparing rendering output to the real Direct2D, making and updating hypotheses and formulas and shaders and error handling and everything until it got things just right …

… And then it worked. It actually booted up. In WINE. Claude got this working in about 3 weeks. This involved a lot of Fable, a lot of Opus, and even some Sonnet (those are the 3 models in reverse order of intelligence/complexity). I finally managed to boot up Paint.NET in .NET 10 win-x64, in WINE, on Ubuntu, in WSL 2, on Windows 11. And then later that day some folks on Discord got it running on real Linux systems. There’s been more work since then in order to further refine and fix up the code, but now it’s at least kinda-sorta ready for others to try out.

It is NOT “production ready.” I wouldn’t even call it “alpha quality”. It “doesn’t not” work.

    • woelkchen@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 hours ago

      Only partially. Apparently Direct2D (which to be clear is different from Direct3D) is very weird and progress is slow.

  • MonkderVierte@lemmy.zip
    link
    fedilink
    English
    arrow-up
    8
    ·
    12 hours ago

    To mention it again, looking at the comments: they vibe-coded a clone of the direct2d rendering engine, because 180k loc is a bit too much to review. Which is understandable, since .Net took the foretold route of suddenly not caring about non-Windows again. But don’t be surprised, if it suddenly glitches.

  • grue@lemmy.world
    link
    fedilink
    English
    arrow-up
    54
    arrow-down
    1
    ·
    1 day ago

    How does a project literally named “.NET” manage to fuck up so bad as to need WINE instead of just Mono?

    • Zarobi@aussie.zone
      link
      fedilink
      English
      arrow-up
      40
      arrow-down
      2
      ·
      21 hours ago

      From the article:

      Direct2D has always been the biggest hurdle for Paint.NET on WINE, and it’s clear that it will never be completed enough for Paint.NET’s use. And I can’t just “disable” the use of Direct2D. So, instead, Paint.NET now has an internal, from-scratch, clean-room reverse-engineered rewrite of Direct2D that it uses on WINE.

      This was written by our good friend Claude. […] Most of this code is, as they say, “vibe coded.” By that I mean that it has not been thoroughly reviewed, it’s more “trust me bro” style. I cannot possibly review 180,000 lines of code, it’s just way way way too much.

      If you don’t like AI, if you hate AI, if you refuse to run any software that AI touches, if your favorite pejorative is now “slop” … fine. Whatever. I’m not going to try and convince you otherwise. You’re entitled to your own opinion, I don’t care. But keep that talk out of here. You don’t have to use this. It’s clearly not for you.

      So basically they hallucinated up a replacement for the Direct2D as a Linux compatibility layer.

      .Net hasn’t been Linux-friendly for quite a while. Especially since 2023 or so there’s been a major shift away from cross-compatibility, which was a very strange decision to me. .Net is no longer a Linux friendly or cross-platform development environment; which to me was it’s biggest strength. So I’m honestly not surprised that there’s more components that are just straight up completely incompatible with Linux. Non-Windows platforms are now “second class citizens” in .Net land.

      I remember vividly the moment when I upgraded a project from .Net 3.1 to .Net 6. Buried at the bottom of the patch notes, was a brief mention that some libraries (actually, a huge number of libraries) like System.Drawing are no longer supported on Linux. It was a catastrophe, causing so many random bugs and took literal months to recover from. For example, generating a PDF causing an entire web server to hang and use 100% resources. Entity Framework database connection quirks causing data loss and availability issues. Etc.

      • fuzzzerd@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        4 hours ago

        What do you mean not Linux friendly? Some of the legacy windows components of .net are not being supported, but that’s because there are alternatives that are better. ImageSharp is a huge improvement over system.drawing.

        • Zarobi@aussie.zone
          link
          fedilink
          English
          arrow-up
          1
          ·
          3 hours ago

          By that I mean you have to be careful which libraries you use. There’s a good chance that a System.* or random NuGet package will either completely fail to run on Linux, or be horribly buggy if you force it to work via build flags. In fact, they’ve completely removed the build flag in .NET 7+, System.Drawing.EnableUnixSupport. It used to be supported via libgdiplus.

          I would expect .Net to be fully compatible with Linux out of the box. Especially system libraries. You can’t say that you support cross-compatibility, and then deprecate cross-compatibility of system libraries; that’s just insane.

          I don’t remember the exact details because it’s been several years, but it was far more than just System.Drawing.Common that broke on Linux after updating to .Net 6. Some breaking changes were undocumented, only appearing later in GitHub issues. Some were buried in sub pages or individual library documentation.

          In the patch notes they even had the gall the claim that our business use case doesn’t statistically exist, and we can just drop in replace SkiaSharp; which was absolutely not the case. It was an unmitigated fucking disaster, even accounting for rolling back to .Net 3.1 for a few months while we sort it out and wait for critical 3rd party libraries to accommodate the change. Before anyone says it, yes we actually paid handsomely for our critical third party libraries; we didn’t mooch off open source and whinge about it. Even so, it never really worked right after that change. A hundred small things, like differences in how SkiaSharp draws differently and handles edge cases. In an enterprise application, it was a big problem.

          More reading: https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only

          • fuzzzerd@programming.dev
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 hours ago

            It sucks that you had such a rough translation. I never felt hoodwinked, because it was always clear to me that any parts of .net that were for winforms or WPF would never fully supported off windows. And that certainly makes it hard to transition projects that started on the legacy framework before core.

            With that expectation on my mind, I haven’t had these experience, most things I’ve wanted to do just work on Linux, CLI and web hosting. For GUI I’ve used Avalonia which has been great, but it’s definitely not a thing you just port to. Its viable for greenfield.

      • frongt@lemmy.zip
        link
        fedilink
        English
        arrow-up
        4
        ·
        17 hours ago

        Wouldn’t it be easier to use a cross-platform backend, even if the interface was vibe-coded?

        • woelkchen@lemmy.world
          link
          fedilink
          English
          arrow-up
          4
          ·
          15 hours ago

          I think the point is that the developers doesn’t want to actually review the code which they can do with a self contained dependency which they then ship on a “take it or leave it” basis.

          I kind of get it and I think it’s a more responsible approach than to vibe code the core engine of their application.

        • Zarobi@aussie.zone
          link
          fedilink
          English
          arrow-up
          4
          ·
          16 hours ago

          Ideally, yes; but cross-platform drawing libraries are like unicorns nowadays. SkiaSharp would probably work, but it functions completely differently and would require a rewrite of the entire program, which is a big ask.

  • RamRabbit@lemmy.world
    link
    fedilink
    English
    arrow-up
    33
    ·
    edit-2
    1 day ago

    Holy crap, yay!

    Always liked using this program as it has just enough tools to be useful, including addons, but not overbearing for moderate image work.

    Edit: A note for the group:

    It is NOT “production ready.” I wouldn’t even call it “alpha quality”. It “doesn’t not” work.

    • folekaule@lemmy.world
      link
      fedilink
      English
      arrow-up
      24
      ·
      1 day ago

      My guess is that it changed from open source to a proprietary license. From Wikipedia:

      Initially, Paint.NET was released under a modified version of the MIT License, with the exclusion of the installer, text, and graphics.[9] However, citing issues with the open source code being plagiarized by others that had rebranded the software as their own and bundled user content without their permission, the availability of the source code was restricted, in December 2007 Brewster announced his intent to restrict access to components of the program (including its installer, resources, and user interface).[10] In November 2009, the software was made proprietary, restricting the sale or creation of derivative works of the software.[10][11]

      • brachypelmide@lemmy.zip
        link
        fedilink
        English
        arrow-up
        25
        ·
        1 day ago

        that was the old controversy. nowadays it’s the latest alpha release (v5.2) being coded in large part by AI

    • General_Effort@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      5
      arrow-down
      1
      ·
      1 day ago

      Give it a few more minutes.

      Popcorn

      ETA: I don’t usually lob grenades like this, but this is an issue people need to deal with.

      • schipelblorp@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        6
        ·
        1 day ago

        Aw, come on, don’t leave us guessing! There’s a controversy I don’t know about it! How am I supposed to establish my moral superiority?

        • brachypelmide@lemmy.zip
          link
          fedilink
          English
          arrow-up
          12
          ·
          1 day ago

          i bestow upon thee the gift of READING THE ARTICLE!!!
          sorry

          anyway rick brewster, the dev of paint.net, used Claude to code the compatibility code for Linux. on one hand i can understand it because Direct2D is a piece of shit but on the other hand i feel like he could’ve gone about this in a different way than slopifying his codebase.

          • woelkchen@lemmy.world
            link
            fedilink
            English
            arrow-up
            3
            ·
            15 hours ago

            slopifying his codebase.

            He didn’t. That’s the point. The slop code is a self contained dependency only used for the Linux build and not part of the actual paint.net codebase. His core user group (on Windows) will never get in touch with it.

            I think everybody, including him, would prefer if there was a working implementation of Direct2D for Wine.

            • brachypelmide@lemmy.zip
              link
              fedilink
              English
              arrow-up
              14
              arrow-down
              3
              ·
              1 day ago

              honestly? imo it should not have existed at all then. i feel like this is going to be really bad for the long run if Rick starts using AI not only for the compatibility layer but also for paint.net’s core codebase.

              and frankly i think if he had made the codebase open source again we would have made a lot more progress on Linux compatibility. paint.net doesn’t really have a solid reason to stay closed source imo, especially because Rick has already shown that he can handle copyright infringment cases when he secured the paint.net domain (his reasoning for making the codebase closed source was that people were stealing his code, rebranding it, and publishing as their own. imo his decision didn’t do much as you can still decompile the binaries, change all the branding, and then recompile and publish, so this only really hurt contributions to the project and nothing else)

              • General_Effort@lemmy.worldOP
                link
                fedilink
                English
                arrow-up
                1
                ·
                12 hours ago

                It’s doubtful if opening the code would have helped. It wouldn’t have helped bring wine up to spec. The only option that would have opened up is a fork without direct2d requirements.

                The crucial thing here is that Claude reverse engineered direct2d and created a linux implementation of the relevant parts. That that’s possible is something the copyright maximalists here will come to terms with. The AI haters will have to cope with the fact that AI is indispensably useful and will only become more so in the future.

              • schipelblorp@sh.itjust.works
                link
                fedilink
                English
                arrow-up
                8
                arrow-down
                1
                ·
                1 day ago

                Do you know the legend of stone soup?

                A traveler goes to a village that has fallen on hard times. Nobody will give him food. He stops at a farmer’s house and says, “I have a magic stone. It will dissolve into a rich broth full of flavor and nutrients that will make enough delicious soup for the entire village.” So the news goes around town that there will be a soup feast, and everyone brings something to contribute: some vegetables, some meats, some spices, and they all enjoy a delicious soup, never realizing that the traveler had scooped a plain and simple stone out of the cauldron before the guests had arrived.

                I feel like AI is kind of the traveller here and the 180,000 lines of shitty code is the stone, and all the work people are going to do in making that code performant are the real ingredients.

                • brachypelmide@lemmy.zip
                  link
                  fedilink
                  English
                  arrow-up
                  7
                  arrow-down
                  1
                  ·
                  1 day ago

                  aye, i also really hope this will turn out good in the end. but you know what they say - hope for the best, prepare for the worst. at the same time…

                  […] and all the work people are going to do […]

                  if i recall correctly i think Rick is the only person calling the shots in terms of development. if that’s not the case then your sentiment holds up a lot but if he really is the only one then i’ll keep being worried. i’ve seen too many developers go down the AI path and absolutely gut their image as a result and i hope that’s not what’s gonna happen to paint.net, there’s genuinely no other program like it

              • Zarobi@aussie.zone
                link
                fedilink
                English
                arrow-up
                2
                arrow-down
                1
                ·
                21 hours ago

                Yeah, this is one of the huge benefits of open source. Someone can just fork Paint.Net and make it Linux-compatible; zero work from the original developer, and everyone benefits. Instead, it’s a walled garden because that kind of behaviour was considered “stealing”; and then they have the nerve to complain about the workload after shutting everyone out. Like, yeah, that’s what happens if you try and do everything internally; it means you actually have to do everything yourself.

          • schipelblorp@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            5
            ·
            1 day ago

            i bestow upon thee the gift of READING THE ARTICLE!!!

            Aigh! I’ve been cursed!

            Wow, I thought it would be a pretty dry article, but it turned into an anti-anti-AI rant.

            I’m gonna make some popcorn. BRB.

    • schipelblorp@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      4
      arrow-down
      10
      ·
      1 day ago

      I guess people don’t trust the company that coined “Embrace, Extend, Exterminate” to run an open source project? .NET is run by Microslop.