Hacker Newsnew | past | comments | ask | show | jobs | submit | jadsfwasdfsd's commentslogin

> but in C, you pretty much always want the tag

We aren't discussing unions in memory layout, but in type systems. This also clearly indicates you aren't qualified for this discussion.


I believe that, by the description provided, most languages that you're talking about must actually represent 'untagged unions' as tagged unions under the hood. See my sibling comment. I'm curious


To be fair, even Wikipedia talks about "untagged unions" only in the context of C. The terminology is confusing and the literature often out of date.


When A and B are disjoint, you don't need the tag unless you for some reason you require that `Maybe<Maybe<T>> != Maybe<T>` holds true and don't like the collapsing semantics of unions where `Maybe<Maybe<T>> == Maybe<T>`

In practice, the cohabitants in Option/Result types are almost always disjoint. So you spend time wrapping/unwrapping Some/Ok/Err for no value add.


Great write up!

Cluster autoscaler is honestly garbage. I'd recommend you use Karpenter which is now managed in most cloud providers.


Why would you want segmented stacks, cgo FFI overhead, goroutines, & asynchronous preemption for a game engine? Odin is better suited than Go is for this type of software. Almost any programming language would have been a better choice here. This is rage bait I'm sure.

Maybe TinyGo can save their ass here?


Agreed. If only let-else let you match the error cases and it could have been useful for the Result type.


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

Search: