thanks for your response. For my problem I ended up putting my seq in an object
with the {.shallow.} attribute as suggested by Jehan.
My nim implementation still slower (by not so much) than my rust version. After
seeing the generated C code, it my be due to allot of memset(0) (some times two
consecutive memset on the exact same memory region, or memset followed directly
by a memcpy).
It is not a big problem, it just means the code C/C++ code generation backend
can benefit from some improvement.
I tend to avoid using ptr as it is not managed by the GC by my understanding.