On Tuesday, 24 February 2026 at 18:49:58 UTC, user1234 wrote:
On Tuesday, 24 February 2026 at 16:56:57 UTC, monkyyy wrote:
[...]
The tagged union approach is actually faster when you deal with
a situation such as
- you only care about final types
- your final types have several bases
- you would cast a lot
- you don't care about nicely looking declarations (e.g SDL
event, XEvent, etc 🤢)
Consider the `old` function, a tagged union would add a layer of
indirection that does nothing. This wont be faster, it may only
tie if the compiler untangles the mess that was made.
A 3d engine will have lots of things, but then have a draw loop
that like "I dont care whats your model id and position"