Hacker News new | past | comments | ask | show | jobs | submit login

Microsoft seems to have basically given up on windows except for legacy support. I suppose satya’s master plan is to eventually compete with Amazon on the price of Linux VMs



On the contrary, they’ve been adding new features which bring it closer to POSIX in capabilities - for example, various Windows 10 builds introduced Unix domain sockets, a pseudoterminal API, proper UTF-8 support, POSIX file delete semantics, etc. The pain of porting software from Linux/macOS to Windows has been reduced (significantly for some types of apps) and here’s to hoping they reduce it even further.


Maybe they'll ship a usable version of huge pages so that ~all software can go like 10% faster someday. We've waited like 26 years so far.


SQL Server has been able to do that on Windows for about a decade now. Just grant the “Lock pages in memory” privilege to the service account and it’ll do it automatically if the server has 16 GB of memory or more.

I use it as a free 15% go-faster button in my consulting gigs.


The current implementation is ok for programs that start soon after boot, run as root, and never exit, but even for server workloads there is a lot of other software out there.


All of this is towards the goal of deprecating the NT-Kernel and work on it.

Today they "emulate" Linux on Windows (WSL2), tomorrow they will "emulate" Windows on Linux (i.e. all the Win32, etc APIs on Linux - think WINE++).

Rather than windows::nt or gnu::linux, the first "Linux on Desktop" will happen with windows::linux.

In 2015 I bet my friends this would happen in 2025. It might not happen exactly that year, but all signs point towards before 2030.


> Today they "emulate" Linux on Windows (WSL2), tomorrow they will "emulate" Windows on Linux (i.e. all the Win32, etc APIs on Linux - think WINE++).

No. Microsoft tried to bridge the Linux APIs to NT APIs in WSL1 just like WINE does for Windows APIs to Linux APIs. But they ended up running into issues and limitations that made them change their approach.

Now, with WSL2, they just have a virtualized instance of Linux running. This isn't even an odd choice as Windows has already been running on top of a hypervisor for anyone who has Hyper-V enabled (new installs of Windows 11 have it enabled by default to support Virtualization Based Security).


> Microsoft tried to bridge the Linux APIs to NT APIs in WSL1 just like WINE does for Windows APIs to Linux APIs

WSL1 doesn’t implement the Linux syscall interface on top of the user-mode Win32 or NT APIs. Rather, it runs in-kernel; it calls kernel-mode NT APIs (only some of which directly correspond to NT syscalls), and (I assume) also implements some aspects of the Linux APIs internally to itself. Its approach is rather different from that of Wine or Cygwin, both of which translate one user-space API to another; and also from the legacy Windows OS/2 and POSIX/Interix/SFU/SUA subsystems, which implement those APIs mostly in user space, on top of the NT user-space API. WSL1 is essentially unique; the closest analog is probably the Linux syscall emulation in FreeBSD/NetBSD, Solaris10/Illumos LX branded zones, and the old Linux iBCS2 personality - although those are all far easier because there is much less mapping in emulating the Linux API on another POSIX OS than one fundamentally non-POSIX.

> But they ended up running into issues and limitations that made them change their approach.

I don’t think those issues were inherently insurmountable, and solving them in the context of WSL1 would have made Windows a better platform, since many of those issues (e.g. poor filesystem performance) also impact native Win32 apps. But, they made a decision on where to invest their resources. WSL2’s implementation strategy requires less engineering work overall to reach a given outcome.


I specifically said NT APIs to differentiate from the Windows APIs. And my "just like WINE" comment was more to differentiate what they were doing with WSL1 from WSL2. My use of "just like" is too strong there.

And I also don't think any of the problems were insurmountable. I'm still disappointed that they gave up on WSL1. (At least partially because I thought the whole Windows Subsystem concept was neat design)


> I specifically said NT APIs to differentiate from the Windows APIs.

It depends on what you mean by "NT APIs". If you mean the NT API exposed to user-mode (NT syscalls), no, that is insufficient to implement WSL1 (or anything else like it). If you mean to include kernel-mode-only NT APIs (including undocumented/private APIs which MS doesn't expose to third parties, even new APIs added specifically for WSL1 to consume), then yes that is.

> the whole Windows Subsystem concept was neat design

Also worth keeping in mind, that WSL1 is not an "environment subsystem" in the sense that Win32 is – or OS/2 and POSIX/etc were. It has a radically different architecture from a classic Windows NT environment subsystem.


Ah my mistake about the subsystem implementation. My memory was fuzzy given the 5+ years since I read Windows Internals 7th Edition. Thanks for the correction!


> No. Microsoft tried to bridge the Linux APIs to NT APIs in WSL1 just like WINE does for Windows APIs to Linux APIs.

Uhh, I think you miss read my post. I agree with you WSL1 was a dead end. It tried to put Linux on top of NT.

I believe MS will try to put Win32, etc on top of Native Linux APIs (removing NT entirely). WINE and Proton have effectively done 90% and MSFT will have a way simpler time of getting it to 100% given they dont have to worry about their own copyright.

MSFT also has the financial motivation to stop developing the NT Kernel, so it’s valuable for them to invest into this “WINE++”.


I think it is unlikely even Microsoft would succeed in replacing the NT kernel with the Linux kernel.

NT has features which Linux kernel devs have actively opposed including – such as alternate data stream support in its VFS/IFS layer, and a stable device driver ABI. So even supposing – and I'd be rather surprised if it were to ever actually happen – Microsoft were to release the NT kernel under a GPL-compatible license (thereby eliminating many of the legal issues), they still might find it a great struggle to get the necessary features upstreamed.

Important parts of Windows – e.g. synchronisation primitives – cannot be emulated on top of the Linux syscall API as it currently exists (with accuracy and high performance), due to gaps in functionality. See https://lore.kernel.org/lkml/f4cc1a38-1441-62f8-47e4-0c67f5a... for some of the gory details. I note that LKML message appears to have received zero replies, which is not an encouraging sign for any progress on that issue.

> MSFT also has the financial motivation to stop developing the NT Kernel

It would be a huge investment to extend the Linux kernel to be able to support a 100% correct and equal performance emulation of the NT API, and to port that API to run on top of it. Even with such a huge investment, there would be no guarantee of success (what if Linus refuses to upstream the required features?). And, if it legally requires open-sourcing large parts of the existing Windows kernel (due to GPL compatibility), that would greatly improve the viability of Wine/ReactOS/etc, threatening Microsoft's existing Windows revenue stream. The financial case for what you are proposing is far less clear than you think it is.


Love your response. Im sure you’re right about all of those details if a strict translation was needed. I just don’t believe it needs to be so strict, and as such that it is not that difficult these days.

Apple’s Rosetta 2 and Valve’s Proton have shown that these kind of emulations can be extremely effective. When you control the OS code, and are willing to be extremely hacky for the medium term, anything is possible.

If I were to lead this effort I’d do:

1. Try my best porting the Win32 APIs, Direct3d, to Linux. I’d convert many of them. Use Office, the Windows window manager, Visual Studio, etc as test suites. This can be deployed to users where there is no performance regression.

2. Update any non-legacy applications to use more of WSL2 especially were incompatible with the new Win32 APIs. eg Office, Electron, Chrome, Visual Studio.

3. Build a binary parser like Rosetta that detects use of any incompatible Windows APIs. Mark these binaries as “legacy” (this parsing only needs to be run once per binary). Run legacy binary processes through a hyper visor and slimmed down snapshot of Windows.

4. Investigate more traspiling of binary code like Rosetta, but for Windows APIs to WSL APIs.

5. Announce it and state the intention to migrate.

Many modern apps are Electron anyways. Actively supported apps will slowly migrate to more performant APIs. Legacy apps were not designed for today's hardware anyways and it would work just fine with a little performance degradation but overall still a performance win compared to when the app was released.


> Apple’s Rosetta 2 and Valve’s Proton have shown that these kind of emulations can be extremely effective.

Rosetta and Rosetta 2 are CPU emulation with the same underlying OS – so quite a different problem from what WINE/Proton/etc address. And something Microsoft actually already has anyway – their implementation is less impressive than Apple's in terms of performance, although it can do some interesting things which Apple's can't – in particular, mix emulated x86-64 and native ARM code in a single binary image and process (Arm64EC) – Apple fat binaries are two completely separate binaries concatenated together into a single file, only one of which is actually loaded; Windows Arm64EC binaries mix x86-64 and Aarch64 code in a single binary image, so one function can be native and the other emulated. A program can be native Aarch64, but still be able to load legacy x86-64 plugin DLLs, with some performance penalty incurred for the later [0] – something Rosetta or Rosetta 2 can't do, although Classic MacOS had similar support for mixing emulated 68k and native PPC code in a single process.

Valve's Proton is just a fork of Wine, and it works great for a carefully curated subset of games. However, games are a relatively narrow category of applications, there are lots of things other categories of applications will do which games never will.

> 3. Build a binary parser like Rosetta that detects use of any incompatible Windows APIs

Sometimes, the problem is not with the APIs themselves, but particular patterns of using them. A straightforward emulation of a Win32 API under Linux will behave the same for the vast majority of cases, but in rare edge cases will behave differently. Inspecting a binary to detect what APIs it uses won't tell you whether it is one of the minority of APIs which depends on one of those edge cases. Sometimes the developers themselves won't even know, because it is not unheard of for developers to do weird stupid things by accident rather than intention, yet it just so happens they work, and they don't even realise they've done something weird and stupid.

The biggest problem with your proposal, is will the huge dollar investment it would require of Microsoft, actually be worth it for them? Even if (maybe) saves money in the long run, it will cost a lot more in the short-to-medium term. And the fact is, Windows licensing revenue is still massive enough to more than pay for what Microsoft is spending on Windows development, so there is no financial pressure for them to save money in the long-run – and migrating Windows to Linux would make it easier for their customers to migrate away from Windows, hence risking that revenue stream. Why take such a big risk with one of their cash cows for such an unclear benefit for them?

[0] https://devblogs.microsoft.com/windows-music-dev/load-x64-pl...


That's not even remotely true.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: