News for hackers. Stuff that matters.
Re:Rust via its Core Values by vaibhavkul on Sunday April 03, 2016 @11:37PM (#11419251)
Maybe this is off topic, but while reading this article it occurred to me that wouldn't it be useful if the ownership transfer is syntax highlighted?

e.g. in

  let new_owner = original_owner;
  println!("{}", original_owner);
we could have original_owner on the second line have a different color signifying it doesn't own anything.

Or, does such a syntax highlighter already exist?

Re:Rust via its Core Values by kam on Monday April 04, 2016 @12:00AM (#11419325)
Atom with linter-rust highlights compile errors: http://i.imgur.com/ac7FTpW.png

Or do you have a more specific visualisation for moves/ownership in mind?

Re:Rust via its Core Values by vaibhavkul on Monday April 04, 2016 @02:56AM (#11419879)
Didn't know about linter-rust. Thanks for sharing.

It didn't occur to me that: ownership transfer means variable cannot be used, so if it's used means there's an error, so checking for error itself gives you the information that you cannot use it. So highlighting error can be used instead of the specific ownership transfer.

I don't know of any other specific cases where there's no error, but it would be helpful to have a different color for certain ownership semantics.

Re:Rust via its Core Values by kazagistar on Monday April 04, 2016 @12:31AM (#11419438)
That syntax highlighter would basically have to be attached to a compiler. If a type is Copy, then it follows move semantics instead of copy semantics. Plus, ownership can be transferred through things like method invocations as well, depending on the type signature of the method.
Re:Rust via its Core Values by nv-vn on Monday April 04, 2016 @04:06AM (#11420162)
A bunch of languages are moving towards integrating IDE tools into the compiler with some kind of API. This allows for on-the-fly type checking, better syntax highlighting, better autocompletion, automatically generating bits of boilerplate, instantly testing a block of code, etc. For a language with a great example of this, check out Idris's IDE protocol: http://docs.idris-lang.org/en/latest/reference/ide-protocol..... The way this works helps create an awesome feedback loop where the editor _is_ the REPL. Something like that would be a great addition to Rust and would definitely help improve the overall tooling for the language.
Re:Rust via its Core Values by kazagistar on Tuesday April 05, 2016 @03:53PM (#11433780)
There is a fairly extensive plan for building out IDE support for Rust: https://www.rust-lang.org/ides.html