News for hackers. Stuff that matters.
Re:Rust Priorities after 1.0 by jmilloy on Thursday April 16, 2015 @11:51PM (#9392165)
Is there a law for this yet? It seems like any time I see discussion about Rust, over half of the discussion is actually about Go.
Re:Rust Priorities after 1.0 by kibwen on Thursday April 16, 2015 @11:53PM (#9392168)
Likewise, in any discussion about Go on HN half of the discussion will be about Rust. A truly bewildering phenomenon.

Would anyone like to compare Rust to ATS instead? Maybe Erlang? Anybody??

Re:Rust Priorities after 1.0 by doublec on Friday April 17, 2015 @01:12AM (#9392360)
I can help with a Rust vs ATS.

ATS is more like a safe version of C wrapped in ML syntax vs Rust as a safe version of C++.

ATS is lower level. You can do memory safe pointer arithmetic whereas in Rust you'd use unsafe blocks.

Some things are implicit in Rust but explicit (and more verbose) in ATS. For example, Rust has destructors for RAII whereas ATS requires manually calling functions to clean up resources. The type checker tells you when you need to do this (via linear types) but programmer still needs to do the call.

Borrowing is automatic in Rust. In ATS it requires keeping track of borrows in proof variables and manually giving them back. Again the type checker tells you when you get it wrong but it's more verbosity.

ATS has a restricted form of dependent types - Rust is not dependently typed.

With current implementations, ATS compiles to C which can be compiled independantly of an ATS install. You can ship the C code to someone to build without them needing ATS. Rust uses LLVM.

The two languages feel very differently when programming.

Re:Rust Priorities after 1.0 by kibwen on Friday April 17, 2015 @01:48AM (#9392434)
This is awesome, I'm so happy to finally hear from somebody with experience in ATS. :)

  > For example, Rust has destructors for RAII whereas ATS 
  > requires manually calling functions to clean up 
  > resources.
This especially intrigues me, as recent events have shaken my faith a little in RAII. Who knows, maybe Rust will one day regret not embracing linear types wholeheartedly...
Re:Rust Priorities after 1.0 by doublec on Friday April 17, 2015 @06:21AM (#9393311)
I much prefer explicit over implicit so I'm not a big fan of RAII. I find it hides things that are happening in the code which makes it hard to find performance and other problems from inspection. ATS has tail call optimisation and destructors would make it hard to tell when TCO can't be done due to the hidden destructor calls.

Another nice thing ATS has is the ability to specify the API for a C function to a level of detail that enables removing a whole class of erroneous usage of the C API. I have an example of this where I start with a basic API definition and tighten it up by adding type definitions:

http://bluishcoder.co.nz/2012/08/30/safer-handling-of-c-memo...

Re:Rust Priorities after 1.0 by dorfsmay on Friday April 17, 2015 @12:10AM (#9392221)
Rust: ATS for the rest of us!
Re:Rust Priorities after 1.0 by sacado2 on Friday April 17, 2015 @05:48AM (#9393202)
And the other half is about C++.

Well, to be fair, talking about a language is also about talking about what makes it different from others.