Remix.run Logo
bilbo-b-baggins 3 days ago

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

9rx 3 days ago | parent | next [-]

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

trhway 3 days ago | parent [-]

The special hooks for context and arena (actually arena(s) can be part of context) should have eliminated the need to change signatures for threading context and arena handles through the chain of calls. Instead there should have been an API (both - internal and user accessible) to check and pick, if present, the closest one on stack (somewhat similar to how you can get ClassLoader and the hierarchy of them in Java)

foobiekr 2 days ago | parent | prev [-]

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.