Thread overview | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 04, 2020 Reasons to use D (over alternatives like Rust) | ||||
---|---|---|---|---|
| ||||
Hi. Disclaimer: This thread isn't specifically a "this vs. that" thread but more of a "help me articulate reasons" post. For the last three or so years, I've been on a bit of a journey to find two or three languages that I can really dive into and specialize in. I came upon D by accident about a year or so ago and I really enjoyed the productivity I felt when writing it. Specifically, I liked the way it felt to write and refactor and optimize. I'm big on what the semantics and syntax of a language feels like. This is where the problem starts. I can tell people how I feel writing the language but I can't give them exact reasons as to why they'd pick D over alternatives like Rust. I was hoping I could get some opinions from the people here and maybe you guys can help me solidify some of my own understandings. Thanks in advance. |
February 04, 2020 Re: Reasons to use D (over alternatives like Rust) | ||||
---|---|---|---|---|
| ||||
Posted in reply to RaycatWhoDat | On Tuesday, 4 February 2020 at 19:57:53 UTC, RaycatWhoDat wrote:
> I can tell people how I feel writing the language but I can't give them exact reasons as to why they'd pick D over alternatives like Rust. I was hoping I could get some opinions from the people here and maybe you guys can help me solidify some of my own understandings.
>
> Thanks in advance.
If you prefer GC to borrow checker.
If you have a C++ codebase you want to interact with (D works hard on C++ interop, Rust doesn't even try).
If you have a C++ codebase you'd like to convert to another language - most C++ constructs map easily to D, with Rust you'd have to reorganize most of the application to make borrow checker happy.
|
February 04, 2020 Re: Reasons to use D (over alternatives like Rust) | ||||
---|---|---|---|---|
| ||||
Posted in reply to RaycatWhoDat | On Tuesday, 4 February 2020 at 19:57:53 UTC, RaycatWhoDat wrote:
> I can tell people how I feel writing the language but I can't give them exact reasons as to why they'd pick D over alternatives like Rust. I was hoping I could get some opinions from the people here and maybe you guys can help me solidify some of my own understandings.
Why did I pick D?
Probably the biggest reason was because writing D code didn't lock me into the D ecosystem. I can run my D code from any language with a C FFI. I could collaborate with someone and they don't have to know anything about D to run my code.
Why did I pick it over Rust?
Because it has a GC, I didn't have to read a dissertation on memory management to get started. I don't want to care about memory management. I also thought the syntax was an atrocity. Things may have changed in recent years, because I haven't been watching Rust.
Why did I pick it over Go?
I found Go to be extremely restricted, by design, along pretty much every dimension. That might work well for a large enterprise, but it's not something I wanted. D is about the exact opposite in that regard.
Why did I pick it over C++?
Because C++ is C++.
Having written all this, I don't think there are any arguments that will get you very far. There are lots of languages that can do the job. It's hard to make a case for language A over language B in 2020. It's not 2005 where Rails made it obvious that you should have been using Ruby or 1998 where Java could replace C++ in places no other language could do the job.
|
February 04, 2020 Re: Reasons to use D (over alternatives like Rust) | ||||
---|---|---|---|---|
| ||||
Posted in reply to RaycatWhoDat | On Tuesday, 4 February 2020 at 19:57:53 UTC, RaycatWhoDat wrote: > Hi. [...] > I really enjoyed the productivity I felt when writing it. Specifically, I liked the way it felt to write and refactor and optimize. I'm big on what the semantics and syntax of a language feels like. D is the one-stop shop for all your programming needs. From build scripts to quick prototypes to profiled systems. From compile time generated parsers via web servers to high performance computing. I am confident that whatever problem I am professionally confronted with in the future, it’ll be solvable with D. Bastiaan. |
February 04, 2020 Re: Reasons to use D (over alternatives like Rust) | ||||
---|---|---|---|---|
| ||||
Posted in reply to RaycatWhoDat | On 2/4/2020 11:57 AM, RaycatWhoDat wrote:
> Hi.
>
> Disclaimer: This thread isn't specifically a "this vs. that" thread but more of a "help me articulate reasons" post.
>
> For the last three or so years, I've been on a bit of a journey to find two or three languages that I can really dive into and specialize in. I came upon D by accident about a year or so ago and I really enjoyed the productivity I felt when writing it. Specifically, I liked the way it felt to write and refactor and optimize. I'm big on what the semantics and syntax of a language feels like. This is where the problem starts.
>
> I can tell people how I feel writing the language but I can't give them exact reasons as to why they'd pick D over alternatives like Rust. I was hoping I could get some opinions from the people here and maybe you guys can help me solidify some of my own understandings.
>
> Thanks in advance.
It's simply easier to write code in D.
Working with the borrow checker often means refactoring the algorithms and data structures, which takes time and effort.
On the other hand, you can port borrow-correct code to D without changing algorithms and data structures. In fact, I recommend learning how to write borrow-correct code, and using such as a matter of course. But D won't make you do it.
|
February 05, 2020 Re: Reasons to use D (over alternatives like Rust) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Wednesday, 5 February 2020 at 05:32:42 UTC, Walter Bright wrote:
> On the other hand, you can port borrow-correct code to D without changing algorithms and data structures. In fact, I recommend learning how to write borrow-correct code, and using such as a matter of course. But D won't make you do it.
Thank you all for chiming in on that.
You've given me a solid direction on how to both address conversations of that nature and how to not worry about FOMO between programming languages (which I fear is the real crux of the problem). I will look into borrow-correct code as you mentioned, Walter, and continue to work with D because it's a joy to write.
Cheers.
|
February 05, 2020 Re: Reasons to use D (over alternatives like Rust) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Wednesday, 5 February 2020 at 05:32:42 UTC, Walter Bright wrote: > On the other hand, you can port borrow-correct code to D without changing algorithms and data structures. In fact, I recommend learning how to write borrow-correct code, and using such as a matter of course. But D won't make you do it. That'd be like saying, why use @safe, you can port all @safe code to @system and it'll be easier to write. Just learn how to write @safe code without @safe. The user can't be trusted to write correct safe code, that's why the compiler has to be able to check it. If you are using the GC, then there's no point to writing borrow-correct code. You are just wasting your time. The whole purpose of borrow-correct code is to not use a GC. A GC solves the same problems, it just has it's own downsides. It does take time and effort, but the result is usually better performance and safety. https://blog.discordapp.com/why-discord-is-switching-from-go-to-rust-a190bbca2b1f That's not the only company that's switched to rust that has seen it's benefits either. |
February 05, 2020 Re: Reasons to use D (over alternatives like Rust) | ||||
---|---|---|---|---|
| ||||
Posted in reply to RaycatWhoDat | On Wednesday, 5 February 2020 at 16:29:15 UTC, RaycatWhoDat wrote:
> On Wednesday, 5 February 2020 at 05:32:42 UTC, Walter Bright wrote:
>
> Thank you all for chiming in on that.
>
> You've given me a solid direction on how to both address conversations of that nature and how to not worry about FOMO between programming languages (which I fear is the real crux of the problem). I will look into borrow-correct code as you mentioned, Walter, and continue to work with D because it's a joy to write.
>
> Cheers.
Borrow correct code isn't that hard to learn. It's when you need multiple mutable references and interior mutability hell starts to break loose in Rust. This is also why I think the memory model of Rust is the wrong way to go. D has a more liberal memory model which suits people accustomed to C++ better. I hope that D isn't going to adopt any more of these memory model features from Rust. I'm not sure how much the @live feature will be used in D, maybe it will just gather dust, we will see.
BTW, I'm not sure if you have noticed, Firefox has become quite buggy lately. Can't say if it is the fault of Rust though. Chromium based browsers seem to work well in those situations Firefox behaves badly. I've read somewhere in a Rust forum "if it compiles it works" which is a hilarious comment.
|
February 05, 2020 Re: Reasons to use D (over alternatives like Rust) | ||||
---|---|---|---|---|
| ||||
Posted in reply to IGotD- | On Wed, Feb 05, 2020 at 08:17:46PM +0000, IGotD- via Digitalmars-d wrote: [...] > BTW, I'm not sure if you have noticed, Firefox has become quite buggy lately. Can't say if it is the fault of Rust though. Chromium based browsers seem to work well in those situations Firefox behaves badly. [...] What kind of bugs, though? If it's not memory-related bugs I'm highly skeptical it has any connection with the language of choice. T -- He who does not appreciate the beauty of language is not worthy to bemoan its flaws. |
February 05, 2020 Re: Reasons to use D (over alternatives like Rust) | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On Wednesday, 5 February 2020 at 20:51:39 UTC, H. S. Teoh wrote:
> On Wed, Feb 05, 2020 at 08:17:46PM +0000, IGotD- via Digitalmars-d wrote: [...]
>> BTW, I'm not sure if you have noticed, Firefox has become quite buggy lately. Can't say if it is the fault of Rust though. Chromium based browsers seem to work well in those situations Firefox behaves badly.
> [...]
>
> What kind of bugs, though? If it's not memory-related bugs I'm highly skeptical it has any connection with the language of choice.
>
>
> T
Behavioral bugs like page not rendered correctly, sometimes tab is completely blank. I just wanted to connect to how some people think that Rust we lead to bug free programs which is a fantasy.
|
Copyright © 1999-2021 by the D Language Foundation