News for hackers. Stuff that matters.
Re:Rust 0.3 released by qznc on Friday July 13, 2012 @07:28AM (#4239306)
Why not D?
Re:Rust 0.3 released by gecko on Friday July 13, 2012 @08:35AM (#4239523)
Because, faced with the fact that C++ makes an octopus by nailing extra legs onto a dog, D decided the right thing to do was to staple-gun them onto a cheetah instead.

D, at the end of the day, is C++ with cleaner syntax. Yes, you've gotten rid of headers and some of the syntactic ambiguities, but things that were mutable are still mutable, templates are still templates, hard-to-solve threading problems are just as hard to solve, etc. Indeed, I'd argue this is one of the reasons why C++ coders generally like D: it's the same damn thing with the most painful dumbth removed.

Rust, on the other hand, focuses on having different semantics from C++, in order to make certain problems much easier to solve. The big one is immutability, which makes code easier to reason about, and vastly simplifies multithreaded code compared to its D or C++ counterparts. But there are other major semantic differences, such as region pointers, the lack of nulls, and more, that really solve the semantic issues that crop up in C++ programs.

I know people who like D, and are highly productive in it, but Rust is solving a very different problem in a very different way.

Re:Rust 0.3 released by WalterBright on Saturday July 14, 2012 @02:17AM (#4243342)
D has extensive support for transitive data immutability, and function purity. (This is quite unlike C++.)
Re:Rust 0.3 released by ntrel on Friday July 20, 2012 @10:09AM (#4270859)
> things that were mutable are still mutable

`string` is immutable. You can use immutable everywhere if you like. C++ doesn't even have transitive const.

> templates are still templates

With constraints, unlike C++.

> hard-to-solve threading problems are just as hard to solve

Have you looked at D 2.0? Globals are thread-local by default, unlike C++. Implicit sharing is disallowed, unless immutable.

> region pointers

It's early days (perhaps I don't fully get region/borrowed pointers yet) but D's `scope` parameter keyword seems very similar. It prevents an argument escaping the function call.

> lack of nulls

This is the big one. Unfortunately D doesn't seem to have an answer on this. I understand Rust uses option/sum types for this, which seems like a great idea.

Re:Rust 0.3 released by incredimike on Friday July 13, 2012 @11:46AM (#4240285)
This isn't very relevant to the topic, but I wanted to thank you for the colourful and hilarious metaphor. Cheers.
Re:Rust 0.3 released by drivebyacct2 on Saturday July 14, 2012 @12:51AM (#4243166)
This is why I'm excited to pick up Rust. I feel like Go makes it very easy for me to get running and churn stuff out with a simple syntax but Rust seems to be bringing in more of the "new" in CS and I want to give that a shot. Rust has surplanted my interest in D and this comment is pretty much exactly why. When I look at D I see a lot of C/C++ type things that make me go "Wait, I thought this was D and not C++ improved".
Re:Rust 0.3 released by sbmassey on Friday July 13, 2012 @03:08PM (#4241333)
D's garbage collection is global, and either off or on (and a lot of D libraries leak memory like crazy if it is off, so in practice it has to be on most of the time)

Rust's per task GC seems like it should allow more flexibility, and I'm hoping it would be usable in the High Frequency Trading arena, for example.

Re:Rust 0.3 released by ntrel on Friday July 20, 2012 @01:03PM (#4271744)
> D's garbage collection is global, and either off or on

That makes it sound like you can't use GC and manual memory management together; you can - std.container uses manual memory management internally for max efficiency.