mach icon indicating copy to clipboard operation
mach copied to clipboard

all: use a large flamethrower to burn branches of our dependency tree 🔥

Open emidoots opened this issue 1 year ago • 2 comments

Our dependency tree today is a lot to maintain, and reducing its size would make performing Zig updates, contributing, etc. easier.

Despite how some feel ('zero dependencies!!!'), I do think dependencies are good when they are logical and not too small. I am happy with the size/quantity of some of our dependencies, but not others.

image

Possible improvements:

  • [ ] direct3d-headers is replaced by the newer directx-headers (better approach) - we just need to actually replace it.
  • [ ] mach-sysgpu currently depends on mach-gpu, it should not be needed.
  • [ ] mach-editor should not directly depend on mach-sysgpu, spirv-cross, or spirv-tools. The logic requiring these should be moved to e.g. mach-sysgpu, and mach-sysgpu should come from the mach dependency indirectly instead of via a direct dependency.
  • [ ] mach-examples should not directly depend on mach-freetype or zigimg.
  • [ ] mach-gpu and mach-gpu-dawn could be eliminated by fully embracing mach-sysgpu.
  • [ ] glfw and mach-glfw could be eliminated by moving all window-creation logic into mach-core directly, which we are doing for other platforms (web, android, etc. anyway)
  • [ ] vulkan-headers is only needed by mach-gpu-dawn and glfw, if both of those go away then it would no longer be needed.

emidoots avatar Jan 07 '24 08:01 emidoots

does this mean glfw and mach-glfw will be abandoned? or simply not one of mach-cores dependencies?

xdBronch avatar Jan 07 '24 13:01 xdBronch

does this mean glfw and mach-glfw will be abandoned? or simply not one of mach-cores dependencies?

Unclear, no immediate plan here. We know a lot of people depend on and use mach-glfw. We also know that writing a Linux backend for mach-core would by far be the trickiest (GLFW does a superb job here.) We also know SDL provides some unique platforms which GLFW doesn't.

If mach-core first gets its own Windows and macOS backends, and somehow also gets a Linux backend which we feel can be competitive with GLFW in the numerous edge cases Linux has.. then GLFW wouldn't be part of mach-core dependencies anymore. If all that happened, and Mach itself doesn't use GLFW anymore, then at that point I think it would be worth considering what happens to mach-glfw after that. Until then, we stay the same course.

emidoots avatar Jan 07 '24 18:01 emidoots

Broken out into:

#1166

#1165

#1174

#1173

#1172

emidoots avatar Mar 06 '24 18:03 emidoots