Windows API Is Successful Cross-Platform API

(retrocoding.net)

57 points | by phendrenad2 3 hours ago

10 comments

  • gregman1 1 hour ago
    (2024)

    Interesting provocative article, I bet it will be praised on some Microsoft sponsored conference.

    Wine and Proton are not tributes to Win32's portability. They are symptoms of a desktop market that Microsoft locked hard enough that the rest of us had to reverse engineer our way out. Market damage, not collaboration.

    The ecosystem was not won on technical merit. OEM per-processor licensing, embrace-extend-extinguish against Java and the web, document format lock-in, and a long pattern of obstructing standardization attempts that would constrain Windows (PWI in 1994, ECMA-234 in 1995, OpenDocument later) while pushing their own through when it extended reach.

    No CS curriculum holds up Win32 as exemplary API design. No system copied it. A successful API earns adoption. Win32 enforced it.

    • pjmlp 0 minutes ago
      Proton represents Valve's failure to make Linux gaming attractive to game studios.

      Not even those that have Android/Linux NDK builds, bother with porting to GNU/Linux.

    • ThrowawayB7 1 hour ago
      > "...embrace-extend-extinguish against Java..."

      Early Java was horrid for everybody except the architecture astronauts who could cram ten GoF design patterns into a hello world program. It only got traction because a different wannabe monopolist, Sun Microsystems, spent heavily to get it pushed into CS curriculums. Fortunately, the one-two punch of Linux and Intel killed Sun or we might all be cursing them today instead of Microsoft.

      • jsiepkes 13 minutes ago
        None of your opinion on Java changes the fact that Microsoft used it's monopoly to execute an embrace, extend, extinguish strategy on Java. It is well documented since they lost an anti-trust court case on it [1].

        [1] https://en.wikipedia.org/wiki/United_States_v._Microsoft_Cor....

        • ThrowawayB7 6 minutes ago
          Back when the word hacker still meant something, that was the opinion of most hackers. Microsoft being bad guys did not make early Java versions good.
      • AnthonyMouse 34 minutes ago
        Sun was actually a decent company once upon a time. Their problem was that Microsoft excluded them from the market and starved them for money for so long that their hardware stopped being competitive, so that by the time Java made it so you could run some software on it, nobody wanted their hardware regardless.

        It was only after they went bankrupt and got bought by Oracle that things like OpenSolaris getting killed off and Java lawsuits started happening.

        • ThrowawayB7 18 minutes ago
          > "Their problem was that Microsoft excluded them from the market and starved them for money..."

          That is not what happened. Sun Microsystems had immense revenue and industry clout because of the dotcom boom, so much so that their advertising declared "We're the dot in dotcom". Microsoft was trying to duke it out with them in the server space but Windows Server was just barely starting to become decent at that point so MS didn't get all that much traction.

          When the dotcom bust hit, Sun went into a tailspin because of the glut of Sun server hardware from dead dotcoms at bargain basement prices. That eventually passed but by that time Linux + Intel was good enough to undercut both Sun and Microsoft in the server space. With no way to compete with free as in beer software, Sun was doomed.

    • modeless 18 minutes ago
      The point is not that Win32 is exemplary. The point is that it's compatible. More compatible, in some cases, than native apps for non-Windows platforms. A Win32 binary that runs in Wine is likely to work on more Linux distros than a native Linux binary, due to decisions made by glibc and distro maintainers over the years.
    • drdaeman 1 hour ago
      All true, but simultaneously, if you look at it not in the “how did we get here” but “what’s out there today” light, it’s an option that can run on a lot of platforms. Not by some particular merit but because history happened this way - but that’s not a problem with the technology itself.
      • bruce511 1 hour ago
        I concur.

        The article defines "success" in the Windows context as being "available everywhere". It does not address how it got to that point.

        And sure, you might not like Microsoft, and you may not like how it became successful (using the above definition) but the fact that it is available everywhere is not in dispute.

        Of course most successful things have murky pasts. We don't necessarily agree with how it got there, but there it is. That is, at least in the technical sense irrelevant. You may prefer LP's or CD's, but streaming is now the successful way to get your music.

        That doesn't mean it's the only way though, and of course you are free to not use Windows programs, or play games via Steam etc. That is your choice.

    • forrestthewoods 40 minutes ago
      > Wine and Proton are not tributes to Win32's portability.

      I emphatically disagree. It is a hilarious and catastrophic failure of Linux userspace that the best API for running games on Linux is Win32. This has absolutely nothing to do with what Microsoft locking down the desktop market. It has 100% literally everything to do with Linux userspace being a clusterfuck of terrible design.

      Linux adopted Win32 because it actually worked. They didn't have to. They could have simply invented a better API that didn't suck. But that's quite hard.

      So yeah. I emphatically, but respectfully, disagree with your entire thesis.

      • ravenstine 25 minutes ago
        It's Linux's failure that one of the world's biggest corporations outspent it on marketing by orders of magnitude? You can sell crap like hotcakes with enough money and advertising minds. Yours isn't really an argument for Linux APIs being any worse or better quality.

        > Linux adopted Win32 because it actually worked.

        WINE would have been invented one way or another because enough people would have wanted to run Windows programs on Linux in a world where Linux had dominant market share. For Pete's sake, there are Commodore 64 emulators for Linux in a world where that system has been dead for decades. It has nothing to do with what "works" or not. WINE and Proton are developed as actively as they are today because Microslop has been able to market so effectively to convince average joes and businesss leaders to buy their crappy OS. This has nothing to do with the quality of APIs.

        > They could have simply invented a better API that didn't suck.

        Is there ever a situation where this statement isn't true? Everything built in software can be seen as sucking, and all software could have been written better the first time around.

      • cmeacham98 35 minutes ago
        > Linux adopted Win32 because it actually worked.

        Completely untrue - Linux "adopted" Win32 because the majority of video games are written for Windows (and thus Win32).

        They could not have invented a better API because the entire reason Proton exists is because developers don't build native Linux games.

        • forrestthewoods 27 minutes ago
          > because developers don't build native Linux games.

          Correct. However you grossly misunderstand why why dev don't build native Linux games. The answer is that distributing proprietary software that works on "Linux" is an absolute unmitigated clusterfuck of pain, misery, and woe.

          Cross-platfrom is very very easy. It's a solved problem. There are indie devs with custom engines that can easily ship for Windows, macOS, iPhone, Android, Playstation, Switch, and Xbox.

          If Linux userspace had an ABI that wasn't garbage then adding "Linux" to that list would be very easy. The fact that devs don't and it is your primary clue.

          I keep putting "Linux" in quotes because back in the day with r/LinuxGaming would spam Kickstarters begging for Linux support that's what they asked for. Of course there is no such thing as shipping for Linux. There is the Linux kernel and glibc and a kajillion different distros that are all unique and terrible in an myriad of different ways.

          And it turns out that Linux is such a minefield clusterfuck that the actually best ABI is Win32. It'd be great if Linux designed a new ABI that was better. Seriously, that'd be awesome. But in the meantime Win32 it is!

      • MathMonkeyMan 29 minutes ago
        > It is a hilarious and catastrophic failure of Linux userspace that the best API for running games on Linux is Win32

        Studios don't target Linux, they target Windows and sometimes Mac.

        Imagine if Flappy Bird targeted only iPhone, because there were only 50,000,000 Android users in the world (hardly worth supporting). Then Android creates an iPhone runtime on Android so people can play Flappy Bird on it, and you conclude "iPhone actually worked, this is evidence that Android is a hilarious and catastrophic failure."

        • forrestthewoods 19 minutes ago
          I don't need to imagine a made-up scenario that doesn't make sense. We can look at what has happened at face value.

          The calculus is very very very boring and simple. Game devs will support every single platform on the planet in which the cost to support that platform - both directly and long-term maintenance - is less than the increased revenue that platform provides.

          It is not uncommon for indie games on custom engines to support Windows, Playstation, Switch, Switch 2, Xbox. And, depending on the game, iOS or Android. Sometimes macOS although that's increasingly rare.

          Native Linux builds are pretty rare. Especially before Proton got pretty good with Steamdeck release.

          Supporting Linux is a monumentally tremendous pain in the ass. Radically more than literally any other platform. It is hands-down the hardest and most painful to support natively. So painful that emulating Win32 is a clear win. Valve's runtime helps a lot. And supporting another path is just a waste of time.

          Very sad!

    • asdfaoeu 1 hour ago
      If you listen to CS professors you'd believe that Haskell would be very successful despite having limited if none real world usage. The reality is that catering to your users is much more important than having idealistic system.

      In my experience even with games that have native Linux support running through proton seems to have less issues.

  • YPPH 1 hour ago
    There's something deeply satisfying about compiling a Win32 desktop application and knowing that single binary will run unmodified on essentially every Windows machine from XP onward, and look nearly identical doing it. High-DPI is the one real caveat, but even that's manageable with a manifest. I'm not sure any other platform-native API comes close to that combination of reach and consistency. Running them on other operating systems is really just a bonus.
    • dbacar 1 hour ago
      I am not sure if this holds, I have witnessed apps that dont work in newer versions of Windows.
      • bigfatkitten 54 minutes ago
        They exist but they’re in the minority. Compare this with the Linux world, where userspace compatibility between one major distro release and the next, 12 months apart is very much a roll of the dice.
        • MathMonkeyMan 18 minutes ago
          This is true.

          To be fair, if you use only the Linux syscall interface, then a program that you compiled on x86 in the 90s will probably still run anywhere today. Linus is adamant about this.

          But if you want to use... anything else, then it's unlikely to work at all unless you are very specific about your target. There isn't one company deciding that glibc or mesa or whatever is binary backward compatible on every kernel for every platform forever. Microsoft is, somewhat, one such company. That's why System32\*.dll have such stable interfaces -- it's their job to translate whatever late 90s system/graphics facilities some boomer dreamed up into whatever the current Windows hodgepodge of system services support. It's no wonder Microsoft is trying to drop support for hardware like crazy.

          This implicit compatibility isn't true for all Windows programs, though. Consider Visual Studio. Couldn't compile my console program on my computer and run it on my dad's computer. He had to first install the "Redistributable," which for him and most people might as well be a rootkit and a super scary virus program bad guy.

  • wewewedxfgdf 1 hour ago
    Hasn't it taken gargantuan multi decade efforts of hundreds of developers, multiple open source projects and the backing of major corporations to make it work at all, let alone well, on Linux?

    How is that successful cross platform?

    • wmf 1 hour ago
      Hasn't it taken gargantuan multi decade efforts of hundreds of developers, multiple open source projects and the backing of major corporations to make [WINE] work at all, let alone well, on Linux?

      Arguably there has been equal or larger effort invested/wasted in cross-platform and cross-distro frameworks/APIs/packaging and yet the result still doesn't work. Partly that's due to duplication of effort; there's (mostly) one WINE competing with Qt/Gtk/whatever times Snap/Flatpak/AppImage/whatever.

    • notepad0x90 8 minutes ago
      It is successful because it succeeded. Not because how it succeeded with right, great or ideal. People in this thread keep confusing these two points.
    • bruce511 1 hour ago
      >> How is that successful cross platform?

      Because hundreds of developers, multiple open source projects and the backing of major corporations made it happen, not because Microsoft wanted it but in spite of it.

      In this case the route to success was via marketing (isn't it always so?), via market share, via application dominance (attracting developers to develop for the platform), and via insane levels of backward's compatibility. It was successful not because of the code itself (end users don't care 2 figs about the elegance of the code) but because they optimized for the end user experience.

      Linux optimized for the experienced, technically adept user, who wanted to fiddle, customize and could write programs. Apple optimized for the "now", ignoring the past and regularly made existing programs obsolete and unrunnable.

      I wrote windows programs in 1995. They still run today. They have run on all versions of Windows since then, without even a recompile. Everything I have [1] just keeps running. And it turns out, that's something users really want.

      I get that we're all technical folk here. I get that we strive for technical excellence and elegance. I get that we operate in the "now", ignoring hardware and software from the past. But the market is different, and wants different things. If you want a successful business you need to understand the market, not just your own aesthetics. Microsoft understands that, and that's why the market (especially the business market) relies on them.

      [1] - Except games. Copy protection on some of my games means they don't run anymore - but to be fair those were hacks designed specifically to prevent the game running in the first place.

    • throwaway27448 1 hour ago
      Cuz there's good software written against it. And it doesn't need to be recompiled.

      Will I ever target it? No, I'd rather you rip my bones and eyes out. But it's unarguably successful.

  • tehologist 1 hour ago
    As an added bonus, since win32 is so old. AI is quite strong at generating code for it, I have even had success with qwen 3.5 1.5B parameters with win32 and opengl 1.1
  • dbacar 1 hour ago
    Sometimes I think that, if Java ditched the idea of JVM and followed what modern languages did today (write once, compile on every major platform), things would be different.
    • wmf 1 hour ago
      What's even sadder is that was built and Sun fought against it because they were worried that devs would only compile for Win32.
      • AnthonyMouse 46 minutes ago
        The trouble there is that Sun was right about that.

        Doing it that way works great for open source where anyone can recompile the software for a new target, but for proprietary software they would have given you a Windows blob and that's about it.

        Meanwhile the problems with Java were mostly not the JVM. Its current problem is, of course, Oracle.

  • tehologist 1 hour ago
    Considering you can use 500 kilobyte distro of tcc that can self compile to build win32 apps and those versions will very easily run on wine. I think it is a valid point and a strategy I have used for sometime. Since windows can't decide what you should use for developing Windows apps
  • stkdump 1 hour ago
    > In the real world, the internet is TCP/IP

    I guess he missed http3, which now makes up 35% of web traffic.

    • wmf 1 hour ago
      Technically the Internet runs on "the Internet Protocol Suite" but people just say "TCP/IP" for short. That doesn't mean to exclude UDP, SCTP, or whatever.
      • stkdump 1 hour ago
        So what exactly does he mean then?
        • wmf 58 minutes ago
          He means the Internet runs on the Internet Protocol Suite and not the "superior" OSI Protocol Suite (that people under age 50 have never heard of because it failed).
    • ablob 1 hour ago
      http3 operates on a different OSI layer
      • stkdump 1 hour ago
        Yes, which the article claims is just a theory now, irrelevant for the real world. More crucially though, http3 doesn't use TCP because it is built on top of UDP.
        • magicalhippo 1 hour ago
          It's like how people say "pass me the butter" despite there's just a tub of margarine on the table.
  • qakajjqj 1 hour ago
    It's not that the train wasn't successful.
  • whateveracct 1 hour ago
    kinda