5 ms·
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.
by jmilloy 12y ago
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.
- kibwen 12y agoLikewise, 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??
- dorfsmay 12y agoRust: ATS for the rest of us!
- doublec 12y agoI 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.
- kibwen 12y agoThis 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...
- doublec 12y agoI 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-memory-in-ats.html http://bluishcoder.co.nz/2012/08/30/safer-handling-of-c-memo...
- sacado2 12y agoAnd 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.