Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
skybrian
· 1y ago · 0 comments
Yes, the Go garbage collector would need to support some new memory layouts to make certain kinds of unions efficient. A union between a double, a pointer, and small integer types (as done in languages like JavaScript) might be a good start?
Comments
[–]
tignaj
1y ago
Here is a fairly efficient version of a simple union like that I did a while back
https://github.com/tigrannajaryan/govariant