I keep coming back to nim, but I always run aground when it comes to something as simple as "pass the pointer to a struct," because that's somehow bizarrely undocumented in the language.

In fact, in testing, you cannot addr() an object/struct, so ... am I supposed to heap-allocate a pointer, cast and rebuild it, and then pass said pointer before deallocating it later? Because if so, that's moronic in a GC'd language with faculties for producing an untraced pointer (as opposed to a traced reference) specifically for interfacing with C.

Circling back to this, do any #nimlang developers have a recommendation for how to pass a pointer of an object to a foreign C function? Or dereference a C pointer?

Basically looking for the equivalent of passing &x and *x (where x is a nim object / struct).