Hi Ethan,

I think it would be great if you could come up with a typical example where 
the memory sharing is an issue and leads to hard to find bugs. I ask 
because I have not seen a lot of questions on this on the mailing list and 
the bug tracker.

In practice the convention to use the suffix "!" for mutating functions 
works rather well.

Note that the reference semantic is fundamental to Julia and not limited to 
arrays (unless one uses an immutable type).
The following might be also surprising to you:

type MyType
  x::Int
end

a = MyType(1)
b = a
a.x = 2 
print(b.x) # this prints 2


Am Mittwoch, 23. April 2014 22:28:06 UTC+2 schrieb Ethan Anderes:
>
> Thanks everyone... it's super helpful to read your comments. 
>
> @Tim: ok, that makes sense and is clear. I think I was worried the 
> language would have a jumble of commands (not just in those categories you 
> list) which subtly fused variables in memory. Your comment helps me reason 
> about it.
>
>
> @Tobias: Yep, I agree the scalability of the language is key. I was just 
> hoping that we could do this while also keeping the ability of 
> non-programmers to start reasoning about Julia code immediately. I 
> definitely don't want to suggesting Julia look like Matlab or R ... I just 
> want variable assignment and functions (at the high-level prototype stage) 
> to behave in a way that a scientist/mathematician/statistician would 
> expect. BTW: when I first tried to break from Matlab and use Numpy I spent 
> a full two days on a small project that ended up being completely wrong 
> because of the shared memory issue that I didn't realize at first. I was 
> scarred, hence my sensitivity to the issue:)
>
> Again, thanks a ton and keep up the good work.
>
>

Reply via email to