Comments (3)
Fair enough, I think you've convinced me. Denormalization of all errors as you described originally SGTM!
from mach.
Very interesting arguments.
The one risk I see with error de-normalization is that we don't catch such an issue until someone's application makes its way into production, and they begin to experience a slew of unreachable
panics on rarer system configurations (e.g. Wayland, obscure Linux distros/GPU drivers, etc.)
Looking at the current Error
set and trying to group them into logical sets, we have:
- Can likely be eliminated entirely:
InvalidEnum
InvalidValue
- Graphics errors:
NoCurrentContext
APIUnavailable
VersionUnavailable
NoWindowContext
- Window creation and clipboard interaction:
FormatUnavailable
- Generic errors:
OutOfMemory
PlatformError
I think that I would feel comfortable with denormalizing all errors except those listed under "Generic errors" above. I am worried that basically any GLFW function can generate those two and we won't really know when/how unless we did a full audit of GLFW's sources
But I can also see your argument here about just denormalizing everything and improving GLFW docs when we run into anything inconsistent. I think overall I am OK with either of these approaches. After reading what I wrote above, what do you think the best path forward is?
from mach.
You make a strong point about denormalization being quite potentially harmful to production. Though, I think it then comes down to a trade-off: take the risk, causing inconvenience and some struggle, with the return being an overall net-positive in the long run, or avoid taking the risk, and simply continue with status-quo behaviour being, as you've described it, aspirational, as it pertains to documented behaviour, and actual behaviour.
After thinking through it for a bit, I would say I am still of the opinion that error denormalization is worth the benefits; whilst it does rock the boat, it's also a step in the same direction that pointed out the undefined behaviour that was present in GLFW for 6+ years.
In an extreme case, where this change causes too much havoc, we could re-normalize errors, and we'd come back to where we are now, but with additional information about the weaknesses in GLFW's error handling model, so still a net-positive.
from mach.
Related Issues (20)
- sysaudio: opus play.zig example crashes after a few seconds of playing HOT 1
- docs: provide guidance/tooling for app distribution (packaging, code signing, notarization, installers, etc.)
- glfw may not build on Arch Linux, why? HOT 1
- all: use Wayland by default once it is stable/reliable/good enough consistently HOT 3
- sysgpu: metal: pbr-basic codegen failure HOT 1
- all: move Zig packages we write/maintain into the main repo HOT 7
- all: accelerate long-term development
- core: Frequency logic needs more extensive tests
- finish and document our novel/unique event system
- flac/opus: move sysaudio examples into main repo
- mach: `zig build run-sprite2d` on macOS cmd+q to quit the application crashes, closing the window via button does not.
- finish replacing direct3d-headers with directx-headers package
- editor: should not directly depend on spirv_cross, spirv_tools, sysgpu
- examples: should not depend on anything but mach
- mach: use b.lazyDependency where possible
- Tracking issue: priorities of real-world Mach users
- get pixi working with sysgpu with Linux/Vulkan backend
- ecs: `General protection exception (no address available)` HOT 2
- all: nominate Zig 2024.05 HOT 1
- testing: reconsider expect/got order
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mach.