Jump to page: 1 26  
Page
Thread overview
D vs Rust
Jan 28, 2016
nbro
Jan 28, 2016
cym13
Jan 28, 2016
jmh530
Jan 28, 2016
lobo
Jan 28, 2016
tsbockman
Jan 28, 2016
Brad Anderson
Jan 28, 2016
tsbockman
Jan 29, 2016
Sönke Ludwig
Jan 29, 2016
John Colvin
Jan 31, 2016
Walter Bright
Jan 29, 2016
Kagamin
Jan 29, 2016
jmh530
Jan 30, 2016
Kagamin
Jan 29, 2016
Guillaume Piolat
Jan 29, 2016
Saurabh Das
Jan 29, 2016
qznc
Jan 29, 2016
bearophile
Jan 29, 2016
Walter Bright
Jan 29, 2016
JohnCK
Jan 30, 2016
Laeeth Isharc
Jan 30, 2016
bearophile
Jan 31, 2016
Walter Bright
Jan 31, 2016
Laeeth Isharc
Jan 31, 2016
bearophile
Jan 31, 2016
Xinok
Jan 31, 2016
Laeeth Isharc
Feb 01, 2016
xenon325
Feb 01, 2016
bearophile
Feb 01, 2016
Marc Schütz
Jan 31, 2016
Chris Wright
Feb 01, 2016
Joakim
Mar 13, 2016
gour
Mar 15, 2016
bearophile
Mar 15, 2016
Saša Janiška
Sep 03, 2017
Eljay
Sep 03, 2017
Ali Çehreli
Sep 03, 2017
Guillaume Piolat
Sep 03, 2017
Paolo Invernizzi
Sep 04, 2017
Eljay
Sep 05, 2017
Ali Çehreli
Jan 31, 2016
Walter Bright
Jan 31, 2016
Rikki Cattermole
Jan 31, 2016
Dsby
January 28, 2016
I have loved C++ when I first started learning it a pair of years ago (then I stopped for some time for some work reasons), and quite recently I have discovered D, which seems apparently a better language from the design point of view, especially in supporting OO design and modularisation, maybe I am just wrong since I know just a little of D so far, but I really had some problems just in setting up a simple OO project, i.e. importing classes, there are .h and .cpp files, etc, which only make everything confusing and make you learn stupid things instead of being productive. D also seems to have a cleaner syntax in general. C++ is becoming more and more a mess because they keep introducing new functionalities to make C++ compete with new languages, and I'm starting hating it. Languages should not just be powerful but simple enough to be productive.

Apart from this, what are the real advantages of D over Rust? They seem to be similar languages in what they want to achieve. Rust seems to be younger and the syntax seems to be slightly different from the C-like syntax. I am not such concerned or interested with the syntax advantages of a language over the other, but more about in general what one does better than the other. Overall, which one has a better design and a more promising future? Which one is more performant, in which situations? If you could answer all these questions it would be nice. I'm still deciding which one to learn and invest my time on, but I would like to have also your more experienced and expert opinion.
January 28, 2016
On Thursday, 28 January 2016 at 22:30:51 UTC, nbro wrote:
> I have loved C++ when I first started learning it a pair of years ago (then I stopped for some time for some work reasons), and quite recently I have discovered D, which seems apparently a better language from the design point of view, especially in supporting OO design and modularisation, maybe I am just wrong since I know just a little of D so far, but I really had some problems just in setting up a simple OO project, i.e. importing classes, there are .h and .cpp files, etc, which only make everything confusing and make you learn stupid things instead of being productive. D also seems to have a cleaner syntax in general. C++ is becoming more and more a mess because they keep introducing new functionalities to make C++ compete with new languages, and I'm starting hating it. Languages should not just be powerful but simple enough to be productive.
>
> Apart from this, what are the real advantages of D over Rust? They seem to be similar languages in what they want to achieve. Rust seems to be younger and the syntax seems to be slightly different from the C-like syntax. I am not such concerned or interested with the syntax advantages of a language over the other, but more about in general what one does better than the other. Overall, which one has a better design and a more promising future? Which one is more performant, in which situations? If you could answer all these questions it would be nice. I'm still deciding which one to learn and invest my time on, but I would like to have also your more experienced and expert opinion.

I don't really think they are similar in what they want to achieve. Rust wanted to achieve a zero-cost memory-safe model. It almost did. I said almost because the cost is on the programmer's side: you have to go out of your way and learn new mechanics to use it. It may be a good thing to use but it is clear that it needs you to develop new skills.

D on the other side wanted to be better than C++ but in the same way: if you like C++-style programming you'll be able to transfer those skills in D. If you like functionnal programming you can program in D. If you like java-style programming you can program in D. If you like C programming... well, you get the point. Of course there are things that will be different but porting a program from C doesn't imply rethinking the program: it's mostly some symbol substitutions. You won't have that with Rust.

The other point is that metaprogramming is way better in D than in Rust. Maybe Rust will eventually get better at it, but right now D is the best IMHO.

The last point is harder to explain... There is a D style, and that style is truely beautiful. I don't think it can really be explained, it has to be discovered, but no matter how much I try to learn something else I always find myself drown back to D.

Just my two cents :-)
January 28, 2016
On Thursday, 28 January 2016 at 22:30:51 UTC, nbro wrote:
> [snip]

Long discussion from last year:
http://forum.dlang.org/thread/ckjukjfkgrguhfhkdhhj@forum.dlang.org

January 28, 2016
On Thursday, 28 January 2016 at 22:30:51 UTC, nbro wrote:
> I have loved C++ when I first started learning it a pair of years ago (then I stopped for some time for some work reasons), and quite recently I have discovered D, which seems apparently a better language from the design point of view, especially in supporting OO design and modularisation, maybe I am just wrong since I know just a little of D so far, but I really had some problems just in setting up a simple OO project, i.e. importing classes, there are .h and .cpp files, etc, which only make everything confusing and make you learn stupid things instead of being productive. D also seems to have a cleaner syntax in general. C++ is becoming more and more a mess because they keep introducing new functionalities to make C++ compete with new languages, and I'm starting hating it. Languages should not just be powerful but simple enough to be productive.
>
> Apart from this, what are the real advantages of D over Rust? They seem to be similar languages in what they want to achieve. Rust seems to be younger and the syntax seems to be slightly different from the C-like syntax. I am not such concerned or interested with the syntax advantages of a language over the other, but more about in general what one does better than the other. Overall, which one has a better design and a more promising future? Which one is more performant, in which situations? If you could answer all these questions it would be nice. I'm still deciding which one to learn and invest my time on, but I would like to have also your more experienced and expert opinion.

Learn both. You will be a better programmer for it and will be in a position to make up your own mind which one *you* prefer.

I come from a heavy C/C++/Java/Python background and for me productivity is paramount. Syntax is very important because it has an impact on my productivity. I find Rust syntax really annoying. Little things in D like UFCS and optional parens make a huge difference. Big things like D templates and compile time reflection power is so easy to tap into and use that it drives Rust into the ground. For me memory safety is not a problem. Yes it bites occasionally, but never enough that its worth giving up productivity everywhere else.

bye,
lobo
January 28, 2016
On Thursday, 28 January 2016 at 22:30:51 UTC, nbro wrote:
> other. Overall, which one has a better design and a more promising future?

The long term future is "uncertain" for both I think. D depends on two people and Rust depends on Mozilla. C++ has much much wider backing.

Rust is very opinionated and you have to figure out for yourself if you want the constraints of linear typing, but the semantics are quite clean. D is closer to C++ style templating and OO, and currently focus on enabling binding to non-template C++ libraries. Rust has more developers behind it. I suggest you read Ali's online book and the online Rust tutorial to get a feel for both.

> Which one is more performant, in which situations?

D allows you to turn off boundschecks, which should make it faster. Currently safe programming in D involves the GC which is much easier, but less performant than Rusts linear typing. There are those that hope for a comparable non-GC solution for D this year, but no concrete description has emerged. Both languages have LLVM backends.


January 28, 2016
On Thursday, 28 January 2016 at 23:18:34 UTC, Ola Foaheim Grøstad wrote:
> D depends on two people

I disagree with this. Even if Walter Bright and Andrei Alexandrescu both suddenly decided to go join the Amish tomorrow, D would go on.

Just because D development is currently *controlled* by two people doesn't mean that no one else is willing or able to replace them, if the need/opportunity arose.
January 28, 2016
On Thursday, 28 January 2016 at 23:28:04 UTC, tsbockman wrote:
> On Thursday, 28 January 2016 at 23:18:34 UTC, Ola Foaheim Grøstad wrote:
>> D depends on two people
>
> I disagree with this. Even if Walter Bright and Andrei Alexandrescu both suddenly decided to go join the Amish tomorrow, D would go on.
>
> Just because D development is currently *controlled* by two people doesn't mean that no one else is willing or able to replace them, if the need/opportunity arose.

Yeah, a few years ago D definitely had a Bus Factor of one but Walter (and Andrei) have successfully delegated and opened it up enough that if the worst should happen I think D could still move forward.
January 28, 2016
On Thursday, 28 January 2016 at 23:28:04 UTC, tsbockman wrote:
> On Thursday, 28 January 2016 at 23:18:34 UTC, Ola Foaheim Grøstad wrote:
>> D depends on two people
>
> I disagree with this. Even if Walter Bright and Andrei Alexandrescu both suddenly decided to go join the Amish tomorrow, D would go on.
>
> Just because D development is currently *controlled* by two people doesn't mean that no one else is willing or able to replace them, if the need/opportunity arose.

It is very difficult to predict what keeps online communities together after a crisis, or if they disband gradually, but Rust is just as vulnerable, if not more because of higher complexity. Who knows if Mozilla suddenly have to downsize? Same with Google's Dart. Or Nim.

It is much easier to predict longterm if you reach critical mass like C++ and possibly Go.
January 28, 2016
On Thursday, 28 January 2016 at 23:43:24 UTC, Ola Fosheim Grøstad wrote:
> It is very difficult to predict what keeps online communities together after a crisis, or if they disband gradually, but Rust is just as vulnerable, if not more because of higher complexity. Who knows if Mozilla suddenly have to downsize? Same with Google's Dart. Or Nim.
>
> It is much easier to predict longterm if you reach critical mass like C++ and possibly Go.

True. That's why I only quoted the "depends on two people" part when I said that I disagree - because I don't disagree with the other part:

> The long term future is "uncertain" for both I think.
January 29, 2016
On Thursday, 28 January 2016 at 22:30:51 UTC, nbro wrote:
> I have loved C++ when I first started learning it a pair of years ago (then I stopped for some time for some work reasons), and quite recently I have discovered D, which seems apparently a better language from the design point of view, especially in supporting OO design and modularisation, maybe I am just wrong since I know just a little of D so far, but I really had some problems just in setting up a simple OO project, i.e. importing classes, there are .h and .cpp files, etc, which only make everything confusing and make you learn stupid things instead of being productive. D also seems to have a cleaner syntax in general. C++ is becoming more and more a mess because they keep introducing new functionalities to make C++ compete with new languages, and I'm starting hating it. Languages should not just be powerful but simple enough to be productive.
>

> Apart from this, what are the real advantages of D over Rust?

In my uninformed opinion (I've not used Rust more than "hello world").

For D:

- no strong feelings against D syntax, it's rare that people complain about it. Rust syntax is more controversial. This shouldn't matter, but it does.

- D "duck-typed" meta-programming could well be more applicable than traits-based meta-programming. Need less names and complexity.

- using "unsafe", Rust isn't particularly more memory-safe than the @safe D subset. Which by and large native programmers don't even care that much. Top concerns with C++ would be compilation times or build complexity. D kills most memory safety concerns throught bounds check, slices or default initialization.

- Rust error handling doesn't strike me as working at scale. We are already seeing "You should not do .unwrap() in a library" advices from Rust experts. Yet .unwrap() seems to creep everywhere which conflates input errors and logical bugs.

- D has defaults that let you write ugly code. I think it's a positive. Why should you care about memory safety or immutability for a 50 line program? Cost vs benefit. You can always enforce later, but you don't get your time back.


For Rust:

- Rust has a simpler resource story. Using it is similar to using modern C++ correctly, hence the appeal for many C++ers who feel at home conceptually.

- cargo is a bit friendlier than DUB, and less controversial in its community (which is imho generational, seeing like C++ package managers are even more controversial). Maybe the package manager / build tool is the primary interest of Rust and D over C++.

- You can do composed RAII in D but using (GC + linear types) is more complex than using linear types.

- D is a large language, not sure how much relatively to Rust. I've heard Rust is complicated too.

« First   ‹ Prev
1 2 3 4 5 6