Skip to content

ideas to improve windows header files and libc #9998

@marler8997

Description

@marler8997

Here's what MinGW provides for Zig:

  • C/C++ headers for the win32 APIs (means we can compile C/C++ code without depending on Visual Studio)
  • An implementation of libc for Windows

(Let me know if I'm missing something here)

The problems I've been having with MinGW

  • it seems to have alot of bugs (this may not be accurate, just my limited experience)
  • it's difficult to contribute to (patches over email, non-responsive, can take months to integrate changes)
  • MinGW's goals don't always align with Zig's, so sometimes it doesn't make sense for them to fix things that Zig needs
  • IMO, it's not "compatible enough" with MSVC so most projects need to add explicit support for MinGW. MinGW doesn't care to be more compatible and is OK with projects needing to put in work to support it alongside MSVC.

Every software has bugs, but MinGW's main problem here is that it's difficult, time consuming and slow to fix them. I think if this wasn't the case, I would have no issue continuing to use MinGW and submitting patches.

So what can we do? A big chunk of work is going to be getting C/C++ headers for the win32 APIs. Because Microsoft has released the https://github.com/microsoft/win32metadata project, and we are already using it to generate Zig bindings, we can enhance that project to generate C/C++ headers as well. I anticipate the initial work to support this would be just a few weeks.

That leaves us with the 2nd chunk of work, an implementation of libc for Windows. This work is already planned (#2879). With this it may be feasible to drop MinGW with work that's already planned and leveraging existing tools.

Thoughts, concerns?

P.S. Long term goal here is to completely replace the need for Visual Studio using this proposal and #8973

Metadata

Metadata

Assignees

No one assigned

    Labels

    libcIssues related to libzigc and Zig's vendored libc code.os-windowsMicrosoft WindowsproposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions