Both are undefined behavior basically. Julia array are not just a pointer.
That’s right, and that’s why I said it’s not any different from C. In julia, there’s also an user accessible address for EVERY objects. It may not be stable and all pointer stuff are “unsafe” but that’s still a well defined language semantics. Depending on what you are doing with the object, e.g. taking it’s address, passing it to a different function, etc, there are very different optimizations that can be done on them, including if the object is allocated on heap/stack/register.