Hello, folks! Newbie to D, have some questions!

Moritz Maxeiner via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Feb 18 14:05:21 PST 2017


On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
> My rudimentary knowledge of the D ecosystem tells me that there 
> is a GC in D, but that can be turned off. Is this correct?

Technically yes; you will lose core functionality, though, if you 
do.
I don't have the complete list at hand, but e.g. dynamic and 
associative arrays are one of the things you won't be able to use 
without the GC IIRC. If you use the reference compiler (dmd), you 
can use the flag `-vgc` to be shown all the GC allocations in a D 
program.

On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
> Also, some threads online mention that if we do turn off GC, 
> some of the core std libraries may not fully work. Is this 
> presumption also correct?

Yes. Everything in Phobos that uses features depending on the GC 
won't work anymore.

On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
> In this regard, I am curious to know if I would face any issues 
> (with my intent in mind), or will I do just fine?

If you don't turn the GC off you should be fine. The GC will - 
AFAIK - only perform a collection cycle as a result of an 
allocation call to it, so you can avoid slow collection cycles 
without turning it off.

On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
> If you could share your experiences and domains of use, that 
> would also be very helpful for me.

I mostly use D for writing tools for my own use that have to 
interact with C APIs.

On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
> Secondly, how stable is the language and how fast is the pace 
> of development on D?

The parts of the language I need are pretty stable, but I don't 
think I use even half of what the language offers (D is very 
complex).
Regarding speed, you can see the numbers (git tags) for yourself 
here[0].

On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
> 2. I am also curious as to what would be the best path for a 
> complete beginner to D to learn it effectively?

That's usually not something someone can tell you, since every 
person learns differently.
Personally, when I started with D (back in D1 days) I read the 
articles about it and then just tried writing tools in it, so I 
suggest reading these[1]

On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
> I am a relatively fast learner (and I learn better by context, 
> as in, some core unifying idea described and then elucidated 
> through big examples instead of learning in bits and pieces).

I'd describe D's unifying idea as "allow people to write complex, 
native software without all the C/C++ insanity". Though D comes 
with it's own share of insanity, of course.

On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
> Are there any books/video tutorials that you would recommend 
> (aside from this site itself).

I personally would not recommend books at the very start of 
learning a language (if one is already proficient with native 
programming in general), but only after one has already gotten 
comfortable with it and is looking for a comprehensive overview.
Regardless, I've heard good things about two books[2][3].
Since I loathe video tutorials I can't add anything on that point.

On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
> 3. Are there some small-scale Open Source projects that you 
> would recommend to peruse to get a feel for and learn idiomatic 
> D?

Technically there's no such thing as idiomatic D as D is 
multi-paradigm. You can see some sensible idioms here[4], but no, 
I would not recommend reading anyone's D code just to get a 
feeling for "idiomatic D".

On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
> 4. I have heard good reports of D's metaprogramming 
> capabilities (ironically enough, primarily from a thread on the 
> Rust user group),

This doesn't surprise me, honestly, since Rust's (compile time) 
metaprogramming capabilities are below D's and from my experience 
people in both communities are well aware of that. There are 
threads on Reddit about this topic if you have the time to dig 
them up. D's advanced compile time features are one of the main 
reasons I'm unlikely to switch to anything else for my tools (in 
my experience there is no other native programming language that 
let's me get things done as fast - in terms of development time - 
as D).

On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
> and coming from a Common Lisp (and some  Racket) background, I 
> am deeply interested in this aspect. Are  D macros as powerful 
> as Lisp macros? Are they semantically similar (for instance, I 
> found Rust's macros are quite similar to Racket's)?

D does not have macros, it has compile time function 
execution[5], templates[6],
  mixins[7], and template mixins[8].

On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
> 5. Supposing I devote the time and energy and get up to speed 
> on D, would the core language team be welcoming if I feel like 
> I can contribute?

I have never tried adding something to druntime or phobos myself, 
so I'm not in a position to comment on this.

[0] https://github.com/dlang/phobos/releases
[1] http://dlang.org/articles.html
[2] The D Programming Language, Andrei Alexandrescu
[3] Programming in D: Tutorial and Reference, Ali Cehreli
[4] https://p0nce.github.io/d-idioms/
[5] 
https://tour.dlang.org/tour/en/gems/compile-time-function-evaluation-ctfe
[6] http://dlang.org/templates-revisited.html
[7] http://dlang.org/mixin.html
[8] http://dlang.org/spec/template-mixin.html



More information about the Digitalmars-d-learn mailing list