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

timmyjose via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Feb 18 13:48:02 PST 2017


On Saturday, 18 February 2017 at 21:27:55 UTC, sarn wrote:
> On Saturday, 18 February 2017 at 20:15:55 UTC, timmyjose wrote:
>> [...]
>
> Hi :)
>
>> [...]
>
> Okay, yes, it's easy to turn off or control the GC.  It's also 
> easy to control memory allocation in general (unlike, say, 
> Java, where it's practically impossible to do anything without 
> writing "new").
>
> Also, yes, a lot of the standard library doesn't work if you do 
> that.  A lot does work, but a lot doesn't.  The biggest blocker 
> is the use of exceptions, which currently rely on GC (though 
> there's interest in changing that).
>
> But I think the real answer to your question is in this thread:
> https://forum.dlang.org/thread/o6c9tj$2bdp$1@digitalmars.com
> (Silicon Valley D Meetup - January 26, 2017 - "High Performance 
> Tools in D" by Jon Degenhardt)
>
>> [...]
>
> When I first started using D about four years ago, it was easy 
> to hit compiler bugs and basic things that didn't work.  It 
> don't find that happens much nowadays when I'm doing everyday 
> programming.
>
> There's plenty of new stuff happening, like escape analysis, 
> but the foundation is getting pretty good.  I think the biggest 
> gap is the number of libraries compared to, say, Python, but 
> personally I'm happy binding to C libraries, and there are 
> plenty of them.
>
>> [...]
>
> Some people have written tutorials.  It sounds like you're 
> already experienced with programming, so the fastest way is 
> probably to just dive in.  Get the basics from a small 
> tutorial, then pick a small project (or some practice 
> programming problems) and start coding with the standard 
> library docs on hand :)
>
>> [...]
>
> Lisp macros let you rewrite features at the interpreter level.  
> Walter Bright has explicitly said he doesn't like that kind of 
> macro (I don't think he even likes the C preprocessor's macros).
>
> D's metaprogramming is more constrained in that sense, but it's 
> powerful at code generation (see templates and the "mixin" 
> keyword), compile-time code execution, and compile-time 
> introspection.  Compile-time introspection is one of my 
> favourite features.  If, for example, you need an array of all 
> the names of single argument methods (or whatever) from a 
> class, you can get it.
>
> Take a look at ctRegex in the standard library for a great 
> example of what can be done.
>
>> [...]
>
> I'm not the core team, but I'm confident the answer is yes :)

Wow! That was an excellent response. Thank you!

I'll be sure to check out the thread that you linked in detail (a 
lot of it went over my head, but I'm sure it'll all make more 
sense soon). I also managed to dig out the YouTube link from 
there. :-)

Also, thanks for sharing your experience. It really does help. I 
was a bit apprehensive because these days rather than the effort, 
I'm more concerned with the time invested (who isn't, right?), 
and reading that your experience with D helps put me at ease.

About metaprogramming, yes, that is one part that I'm really 
interested in, and I would love to explore that area 
thoroughly!The introspection example is pretty cool! I'm pretty 
sure I'll have tons of questions once I get going with D, and the 
community has been very welcoming so far! :-)


More information about the Digitalmars-d-learn mailing list