logoalt Hacker News

bilbo-b-bagginslast Thursday at 1:11 AM2 repliesview on HN

You totally can build it using unsafe and generics. I’ve done it with mmap-backed byte slices for arbitrary object storage.


Replies

9rxlast Thursday at 3:09 AM

With a number of caveats. You cannot reimplement arenas as the experiment did without special hooks into the runtime. https://github.com/golang/go/blob/master/src/arena/arena.go

show 1 reply
foobiekryesterday at 3:01 AM

I have done the same; it's not natural to do it this way. Go should actually express an explicit mechanism to do this. When I did it, it felt exactly like trying to use epoll from Go: you can do it, it just feels like crap.