What is the right level of abstractions for D?

Danni Coy via Digitalmars-d digitalmars-d at puremagic.com
Sun Nov 6 23:00:08 PST 2016


On Sat, Nov 5, 2016 at 5:47 PM, Joakim via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On Saturday, 29 October 2016 at 22:38:07 UTC, Danni Coy wrote:
>
>> The bit that sends group 3 people off screaming is static typing, once
>> you have accepted the need to explicitly type everything then Template
>> functions are pretty straight forward in D.
>>
>> 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.
>>>
>>
>> Again this boils down to static typing, once your group 3 programmer has
>> accepted this then is is a minor issue. At worst case I could see a grumble
>> then avoiding static arrays.
>>
>
> As someone who uses all three, I think you underestimate the reluctance of
> many in group 3 to learn enough to drop down into the lower-level languages.
>

What I am saying that you loose a whole bunch of people as soon as you make
the language statically typed. Of the people that you have left at worst
you will have them grumble a bit and perhaps avoid using static arrays.


> For this whip up a tool to automate some file processing quickly I
>> found D as pleasant as anything else I have used.
>>
>
> I would only use D for such a task too, but I think that is more that we
> are in group 1/2 and are reusing the tool we know.  I'm talking about
> attracting those from group 3.
>

I honestly don't think the D code I wrote was any less readable or
understandable than the python code I wrote, In both cases there are a
couple of idioms you have to learn, but the code is really concise and to
the point once you know the idioms (something that makes me a big fan of
both languages). In fact the file processing required less steps than the
Python version. I don't think I would have a harder time explaining what
the code does to a novice coder.


>
> The only thing missing are bindings for a high quality crossplatform
>> gui toolkit.
>>
>
> Have you tried DlangUI?
>
> https://github.com/buggins/dlangui
>
> I haven't tried it much, so I can't speak to quality, but it certainly is
> very cross-platform.
>

When I mean high quality I mean competitive with Qt (the current least bad
cross platform toolkit), DLangUI gets compared to the Java UI offerings
which leaves me somewhat cold. I have never met a java program with a UI I
liked.


> Where I see the future potential of D in regards to the levels 1,2 and 3
>> is having a team where different programmers are working at different
>> levels within the same language on the same project. Take a game engine,
>> typically you have low level engine guys (level 1) some guys on the engine
>> team who aren't quite as good but don't have to be (effectively level 2)
>> and the guys who do the level / ai scripting (level 3). I would quite
>> happily use D as a high level language in a team where I had a good lower
>> level team designing most of the stuff I use with my level of expertise in
>> mind as they designed it.
>>
>> To this end the really critical things for me are that my level 1 guys
>> can create code that performs in low latency environments without missing
>> deadlines and can present their APIs in such a way that is easy/enjoyable
>> for us level 3 guys to use (see the batch processing thread a little while
>> back).
>>
>
> That's an interesting use, guess Ethan is heading down that road with his
> Binderoo effort.  If D can be used like this for more than just games, it
> would create a nice niche, but I'm skeptical of attracting much of group 3.
>

Perhaps - Taking a look at my D as a scripting language code, I can't see
anything that would really turn a scripter off.
I basically use auto for every variable declaration.
Probably the most complicated thing I do is to use std.algorithm.filter and
map.

In the former case it might be nice to have some syntactic sugar in the way
that maxscript does.

for a in group where a.count > 0 do (

is easier to approach than

foreach (a; group.filter!(a.count > 0)()) {

but that is a fairly minor qwibble.

http://pastebin.com/VyAiRpyh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20161107/486ee6a4/attachment-0001.html>


More information about the Digitalmars-d mailing list