Is this explanation on Nim manual not good enough to stop people using `cast` for `ref`, `string` or `seq` type variables? https://nim-lang.org/docs/manual.html#statements-and-expressions-type-casts > Type casts are a crude mechanism to interpret the bit pattern of an expression as if it would be of another type. Type casts are only needed for low-level programming and are inherently unsafe. `ref` is actually a pointer and managed by Nim. Bit copying `ref` can destroys Nim's memory management. `string` and `seq` are objects containing a pointer to heap managed by Nim. Bit copying them can destroys Nim's memory management.