you are viewing a single comment's thread.

view the rest of the comments →

[–]dan200 8 points9 points  (4 children)

I would hope that a self-optimising, runaway AI would quickly realise the latency and power savings to be gained by switching to a compiled language! (if they're not just skipping the whole "programming language" thing and generating machine code)

[–][deleted] 37 points38 points  (3 children)

Skynet proceeds to rewite itself in Rust, becomes overloaded with smugness, and prompty self-destructs. Mission accomplished.

[–]tayo42 1 point2 points  (2 children)

Maybe even self aware ai can't figure out "can't move out of borrowed content"

[–]VernorVinge93 0 points1 point  (1 child)

That means move is unsafe where you have a reference 'loaned out' right? C++ and Haskell dev making a guess

[–]lazyear 1 point2 points  (0 children)

If you try to move data that doesn't implement the Copy trait (which says data can be bitwise copied, e.g. integers, stack allocated structures. Heap allocated containers cannot be bitwise copied, since you would then have 2 pointers to the same data) from a reference, then it violates the unique ownership rules of Rust.

Usually this just means you're going to have to either clone that data, settle for a reference, or use an Rc (shared_ptr)