www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Top 3 use cases for D

reply Imperatorn <johan_forsberg_86 hotmail.com> writes:
In your opinion, what is the selling point of D, the top 3 use 
cases where D would be a nice fit?

D has struggled to find a niche (because it's so flexible?), but 
is that also why it hasn't seen wider adoption?

What do you think are the top 3 places where you think "I could 
use D here instead of {language} because {reasons}"?
Sep 27
next sibling parent reply "H. S. Teoh" <hsteoh qfbox.info> writes:
On Fri, Sep 27, 2024 at 06:49:27PM +0000, Imperatorn via Digitalmars-d wrote:
 In your opinion, what is the selling point of D, the top 3 use cases
 where D would be a nice fit?
The top selling point of D for me is that it's easy to write working code in D. My typical development times are much shorter in D compared with equivalent code in C/C++/Java. D also has very nice built-in features, like unittests, which in spite of whatever warts they may have make it easy to develop correct, working code. In C/C++ I'd have to spend inordinate amounts of time debugging the code after writing it, and in other languages I'd have to resort to external test frameworks, which add to the inertia of being too lazy to actually do it. My current actual (not hypothetical!) use cases for D are: - A handy shell-script replacement that has none of the shell's irritating points (like greedy string interpolation, that leads to needless fragility and Leaning Toothpick Syndrome, plus I can get parallization almost for free with almost no effort). - Quick prototyping of programs that do complex computations -- because D has so many boilerplate-reducing features that makes it possible to try out new ideas quickly without drowning in boilerplate (like Java is wont to do). Many of these prototypes can be easily turned into real applications relatively painlessly -- because D is just so flexible that refactoring is almost always a breeze. Built-in unittests ensure refactorings don't introduce too many breakages in the transition. - Workhorse programs that I use repeatedly: because D's features make maintenance relatively easy, and adding new features often doesn't require major refactorings like the equivalent C/C++ projects often require IME.
 D has struggled to find a niche (because it's so flexible?), but is
 that also why it hasn't seen wider adoption?
I'd say the small- to medium-sized application zone is where D excels the most at. For larger applications I can't really say, haven't had too much experience in that area, but based on what I know, in a larger application that may depend on external libraries, finding said libraries may be a problem. I generally have to resort to writing my own wrappers for C APIs to call external libraries with. It's workable, but maintenance is a bit of a pain when the external APIs change.
 What do you think are the top 3 places where you think "I could use D
 here instead of {language} because {reasons}"?
I'm already using D instead of shell scripts, because D is just so much better at dealing with data manipulations than hacking the equivalent functionality with sed, awk, grep, and expr. I'm also using D instead of Perl scripts these days, because Perl is just not very maintainable once you get past a certain level of complexity (which is not very high). And I'm definitely using D instead of C/C++ in my personal projects, because it just takes far too much effort to implement things in C/C++ and afterwards it takes far too much effort to debug. In spite of its warts, D does much better in this area IME than C/C++. // Having said that, though, I'm still hesitant to introduce my C/C++-minded colleagues to D, because their first reaction would be GC-phobia, and their second reaction would be "who uses this unknown language?", and their third reaction would be "are you sure we want company products to depend on such a small unknown team?". I've no interest in participating in this fashion show, so I'm not even going to bother. On the more technical side, things like shared, which "does what it's designed to do" but nevertheless obviously screams "incomplete solution" to an outsider, or dip1000 that nobody can explain in 2 sentences before would-be adopters glaze over in their eyes, or the absence of read/write barriers that would have given us a modern, generational GC instead of the conservative compromise we have today -- these just don't look good to a newcomer. And the attribute soup looks scarier and scarier every time we attempt to fix it. Plus a ton of peripheral half-baked features that were never completed, or were completed but don't present a comprehensive solution, I honestly wouldn't know how to answer if someone asked me "why has feature X been like this for Y many years, and what are you guys doing about it?". T -- People who are more than casually interested in computers should have at least some idea of what the underlying hardware is like. Otherwise the programs they write will be pretty weird. -- D. Knuth
Sep 27
parent andy <andy example.org> writes:
On Friday, 27 September 2024 at 19:15:36 UTC, H. S. Teoh wrote:
 Quick prototyping of programs
The runnable unit-tests in the docs make exploration of the stdlib very fast. This is almost ten percent as good as a REPL, which is much better than what most compiled languages offer.
 I'd say the small- to medium-sized application zone is where D 
 excels the most at.
It definitely has some competitive advantages that are most apparent in this zone. Some small nits that would help here: Integrated unittests already help a lot, but I wish one of the popular unittest frameworks were included in the stdlib to make it zero-friction. Tuples and sumtypes are important QoL features that are missing for me that would reduce boilerplate and increase expressiveness for the straightforward data-transformation programs.
Sep 29
prev sibling next sibling parent Lance Bachmeier <no spam.net> writes:
On Friday, 27 September 2024 at 18:49:27 UTC, Imperatorn wrote:
 In your opinion, what is the selling point of D, the top 3 use 
 cases where D would be a nice fit?
Who are you selling to? That question only makes sense in the context of a specific application.
 D has struggled to find a niche (because it's so flexible?), 
 but is that also why it hasn't seen wider adoption?
Those are two different things. D has at least one wildly successful niche in interacting with C code. That is unlikely to result in wide adoption because that requires replacing Java, C++, Python, etc. Working well with C is nice but not helpful in getting on the front page of Hacker News because of some startup that's using it.
 What do you think are the top 3 places where you think "I could 
 use D here instead of {language} because {reasons}"?
Scripting and data analysis are two. Those are often done with one or a small number of programmers.
Sep 27
prev sibling next sibling parent Serg Gini <kornburn yandex.ru> writes:
On Friday, 27 September 2024 at 18:49:27 UTC, Imperatorn wrote:
 In your opinion, what is the selling point of D, the top 3 use 
 cases where D would be a nice fit?

 D has struggled to find a niche (because it's so flexible?), 
 but is that also why it hasn't seen wider adoption?

 What do you think are the top 3 places where you think "I could 
 use D here instead of {language} because {reasons}"?
Hobby projects Testing ideas for compiler Testing ideas for meta programming
Sep 27
prev sibling next sibling parent Bastiaan Veelo <Bastiaan Veelo.net> writes:
On Friday, 27 September 2024 at 18:49:27 UTC, Imperatorn wrote:
 In your opinion, what is the selling point of D, the top 3 use 
 cases where D would be a nice fit?

 D has struggled to find a niche (because it's so flexible?), 
 but is that also why it hasn't seen wider adoption?
I think not having a niche is a reason why it hasn't seen wider adoption. Also, not having a niche is what makes D attractive to us; Plus its many strong points. The top three use cases for us are replacing Pascal for number crunching, desktop applications and networking. -- Bastiaan.
Sep 30
prev sibling next sibling parent Mike Shah <mshah.475 gmail.com> writes:
On Friday, 27 September 2024 at 18:49:27 UTC, Imperatorn wrote:
 In your opinion, what is the selling point of D, the top 3 use 
 cases where D would be a nice fit?

 D has struggled to find a niche (because it's so flexible?), 
 but is that also why it hasn't seen wider adoption?

 What do you think are the top 3 places where you think "I could 
 use D here instead of {language} because {reasons}"?
D is a productive systems language. 1. It's great for scripting (it's replace my Python, because the D language scales well as my scripts inevitably grow into full programs) 2. It's great for graphics/game programming (speed of compiled code, and language is malleable to allow redesign after prototyping) 3. I've also used D for network programming (slicing into bits, and using metaprogramming for serialization is a breeze)
Sep 30
prev sibling next sibling parent reply Atila Neves <atila.neves gmail.com> writes:
On Friday, 27 September 2024 at 18:49:27 UTC, Imperatorn wrote:
 In your opinion, what is the selling point of D, the top 3 use 
 cases where D would be a nice fit?
1. Everything. 2. Everything. 3. Everything. :P
 D has struggled to find a niche (because it's so flexible?), 
 but is that also why it hasn't seen wider adoption?
I think that's probably part of it. It can do nearly anything.
 What do you think are the top 3 places where you think "I could 
 use D here instead of {language} because {reasons}"?
Subjectively, because D is the language that annoys me the least. Objectively, because I write less code with fewer bugs that does a lot more. In what other language can I write a dub package* that autowraps D code so it can be called in Excel and/or Python in two lines, one of which is an import?? * https://github.com/symmetryinvestments/autowrap
Sep 30
parent reply Araq <rumpf_a web.de> writes:
On Tuesday, 1 October 2024 at 02:56:11 UTC, Atila Neves wrote:

 Subjectively, because D is the language that annoys me the 
 least. Objectively, because I write less code with fewer bugs 
 that does a lot more. In what other language can I write a dub 
 package* that autowraps D code so it can be called in Excel 
 and/or Python in two lines, one of which is an import??

 * https://github.com/symmetryinvestments/autowrap
In any language with a decent macro system: Nim and probably Rust, Elixir and Julia...
Oct 08
parent Atila Neves <atila.neves gmail.com> writes:
On Tuesday, 8 October 2024 at 20:07:38 UTC, Araq wrote:
 On Tuesday, 1 October 2024 at 02:56:11 UTC, Atila Neves wrote:

 Subjectively, because D is the language that annoys me the 
 least. Objectively, because I write less code with fewer bugs 
 that does a lot more. In what other language can I write a dub 
 package* that autowraps D code so it can be called in Excel 
 and/or Python in two lines, one of which is an import??

 * https://github.com/symmetryinvestments/autowrap
In any language with a decent macro system: Nim and probably Rust, Elixir and Julia...
In Rust's case, at least, it would be a lot more code, and a lot more complicated. In D it's straightforward imperative code. C++ is turing-complete at compile-time just as well as D is. But a lot harder to do.
Oct 08
prev sibling next sibling parent Kagamin <spam here.lot> writes:
On Friday, 27 September 2024 at 18:49:27 UTC, Imperatorn wrote:
 In your opinion, what is the selling point of D, the top 3 use 
 cases where D would be a nice fit?
a superior choice for that. I would use D for everything else.
 What do you think are the top 3 places where you think "I could 
 use D here instead of {language} because {reasons}"?
I found my current use of D is governed by legacy: I wrote enough D code for D to be useful. If I am to use another language I'll need to write this code again and probably also redesign it to fit the new language.
Sep 30
prev sibling next sibling parent Dejan Lekic <dejan.lekic gmail.com> writes:
On Friday, 27 September 2024 at 18:49:27 UTC, Imperatorn wrote:
 In your opinion, what is the selling point of D, the top 3 use 
 cases where D would be a nice fit?

 D has struggled to find a niche (because it's so flexible?), 
 but is that also why it hasn't seen wider adoption?

 What do you think are the top 3 places where you think "I could 
 use D here instead of {language} because {reasons}"?
1) Small hobby projects 2) Education 3) Quick snippets
Oct 01
prev sibling parent MrJay <mrjcraft2021 gmail.com> writes:
On Friday, 27 September 2024 at 18:49:27 UTC, Imperatorn wrote:
 In your opinion, what is the selling point of D, the top 3 use 
 cases where D would be a nice fit?

 D has struggled to find a niche (because it's so flexible?), 
 but is that also why it hasn't seen wider adoption?

 What do you think are the top 3 places where you think "I could 
 use D here instead of {language} because {reasons}"?
I dont know what it would be useful for in the wider context of software development I will just explain my use case. I work in a fast paced industry where there are new things every single week, its art based and I need to write scripts to generate things very quickly they are one off and never used again, D is better for this than most other languages the only languages I found that were better for scripting were languages like Common lisp, scheme, and julia, languages like that are fast to write and fast to run. (obviously not including libraries otherwise python would be the best, as I prefer to write the code and not use libraries) my second use case is long term production code for generating things for work, it needs to work for a long time, and be extended with scripts in emergencies, the production code also needs to be graphical at least at some point. D is the only language I have found that allows me to do both the scripting workflow and production workflow in one language, every single other language I have tried has some major barrier, I checked dozens of programming languages, most have obvious issues where I didnt need to write any code to see it wasnt useful, like I refuse to use an interpreted language, or were too new for me to trust as I am going to be using the language for many years. I think one reason people dont use D is because its good at everything, its good at scripting and production code, but for scripting its not as good as other languages, and for production code its not as good as other languages, most people are extreme in either of those directions, few people want balance, thus why they use Rust or Go for production, and python for scripting. realistically I think its easy to prove its a dumb approach as many companies have spent millions of dollars re writing there python back-ends in faster languages, if they would have used D it literally would have saved millions of dollars, it should be an easy sell, D will save you money because worse case scenario you can always make your code faster, if you cant its a problems with your skills, not the language. so to answer your questions D's best niche at least in my opinion is any situation where its a good idea to write a script first and write production code later, which is virtually everything.
Oct 01