What is the right level of abstractions for D?

Joakim via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 28 01:46:05 PDT 2016


On Thursday, 27 October 2016 at 17:03:09 UTC, Nick Sabalausky 
wrote:
> On 10/27/2016 02:22 AM, Joakim wrote:
>>
>> 1. low-level compiled languages like C++, D, Rust, and Swift, 
>> meant for
>> performance and usually experts who want to squeeze it out
>>
>> 2. mid-level bytecode languages like Java and C#, meant for 
>> the vast
>> middle of day-to-day programmers to crank out libraries and 
>> apps that
>> perform reasonably well
>>
>> 3. high-level "scripting" languages like Ruby and Python, 
>> meant for
>> those who don't care too much for performance but just want to 
>> get
>> working code
>>
>> I think D is positioned somewhere between 1 and 2, though 
>> closer to 1.
>> However, there is sometimes talk of using D for all three, 
>> though
>> perhaps that is only meant as an added benefit for people 
>> already using
>> it for 1 or 2, ie those who already know the language better.
>>
>
> You're falling into the common fallacy that those groups are 
> mutually exclusive and that a single language can't be 
> appropriate for more than one. D is all about proving that 
> wrong, and is meant for, and good at, all three.

There are good reasons for this split, and yes, it is probably 
impossible for one language to attract all three groups. You 
could use languages from 1 and 2 for all three, with a bit more 
work, but I don't see many scripts written in C++. :)

The reason for the split is that there are different levels of 
software expertise and performance needs, and each of those 
groups is geared for a different level.  Show templates to a 
scripting user and they probably run away screaming.  D can 
probably do well with groups 1 and 2, but the level of power and 
expertise that is needed for those lower levels will scare away 
people from 3.  Those already using it for 1 and 2 may also be 
comfortable with reusing D for scripting, but that's not 
attracting people from group 3, ie those who only want something 
easy to use and don't want to know the difference between a 
static and dynamic array.

> I've noticed that, for many of the people who don't "get" D, 
> the problem they're hitting is that they're minds are so 
> twisted around by the "polyglot" culture, that they're looking 
> for "the one" tiny little niche that D is for, not seeing that, 
> and thus missing the whole entire point.

Yes, this has definitely hurt D, being stuck between 1 and 2.  
People from 2 probably look at D and think it's too low-level.  
People from 1 are always looking to squeeze out _more_ 
performance, so the GC is a way for them to just write off D.  
You and I think they're making a mistake, but maybe they're not 
wrong for their own uses.

As I said, the recent push for @nogc and C++ compatibility 
suggests that a renewed effort is being made to focus on group 1, 
particularly when combined with the D benchmarks for regex and 
recently math.  I'm happy in that space between 1 and 2, and the 
recent push to move languages from 2 to AoT compilation suggests 
that is a good place to be.  So maybe group 2 will also come to 
us. :)


More information about the Digitalmars-d mailing list