www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Help here: How did you get started with D.

reply aberba <karabutaworld gmail.com> writes:
I'm looking to do a general but brief post on getting started 
with D. Not everything will be written by me since I'm aware 
there's several existing resources...more of creating an entry 
point to all those resources (and writing more only when 
necessary). I'm looking to cover areas such as:

* Pros of D... general D's strength kind of getting you excited.
* Leaning resources.
* Development tools available in D Window, Linux, Mac
* Setting up a development environment
* Resources from web/server-side developers (which I know more  
about than the others by experience)
* Resources for game and graphics developers
* Resources for scientific computing
* Resources for desktops development (system, GUIs, ...??)
* Resources for data science (taken separately from general 
scientific computation)
* Resources for embedded programming
* Resources for ??? (Let me know what else I'm missing)
* How and where to get help
* D community platforms (forum, IRC, ???)
* How to contribute to D


The point of this post is to:
1. Know what helped you get started with D
2. What else you think its worth mentioning
3. Things that weren't immediately obvious when you started using 
D and you probably found out the hard way.


I'm trying to balance between keeping it short but detailed 
enough to make it useful to all sorts of people looking to get 
started with D.

I think I'll probably do a separate on on contributing back to 
the D ecosystem and tools...open source outreach kind of post.

So please let me have your input.
Jul 04 2020
next sibling parent reply Yatheendra <indra yath.io> writes:
If web is your thing and you want to keep it short, why not a 
post focused on developing, deploying on servers, etc. on *nix? 
The desktop stuff involving Windows or OSX could be another post.
Jul 04 2020
parent aberba <karabutaworld gmail.com> writes:
On Saturday, 4 July 2020 at 11:43:49 UTC, Yatheendra wrote:
 If web is your thing and you want to keep it short, why not a 
 post focused on developing, deploying on servers, etc. on *nix? 
 The desktop stuff involving Windows or OSX could be another 
 post.
It's not a detailed post or tutorial of any kind. What I meant is the actual resources to reference since I'm not in those communities so there may be tools I don't know about.
Jul 04 2020
prev sibling next sibling parent reply oddp <oddp posteo.de> writes:
On 2020-07-04 12:32, aberba via Digitalmars-d wrote:
 So please let me have your input.
Well, most somewhat popular languages have curated lists such as this one: https://github.com/zhaopuming/awesome-d Back then, I enjoyed having access to posts that highlighted and explained key aspects of dlang: https://seb.wilzba.ch/b/2018/02/the-expressive-c17-coding-challenge-in-d/ https://wiki.dlang.org/Component_programming_with_ranges http://jordi.inversethought.com/blog/advent-of-d/ https://dlang.org/blog/the-gc-series/
Jul 04 2020
parent reply aberba <karabutaworld gmail.com> writes:
On Saturday, 4 July 2020 at 17:47:30 UTC, oddp wrote:
 On 2020-07-04 12:32, aberba via Digitalmars-d wrote:
 So please let me have your input.
Well, most somewhat popular languages have curated lists such as this one: https://github.com/zhaopuming/awesome-d
Yep, well aware of that.
 Back then, I enjoyed having access to posts that highlighted 
 and explained key aspects of dlang:

 https://seb.wilzba.ch/b/2018/02/the-expressive-c17-coding-challenge-in-d/
 https://wiki.dlang.org/Component_programming_with_ranges
 http://jordi.inversethought.com/blog/advent-of-d/
 https://dlang.org/blog/the-gc-series/
Ok good to know, I assume you came from the side where you're already comfortable with these.
Jul 04 2020
parent reply Jan =?UTF-8?B?SMO2bmln?= <hrominium gmail.com> writes:
On Saturday, 4 July 2020 at 20:15:27 UTC, aberba wrote:
 On Saturday, 4 July 2020 at 17:47:30 UTC, oddp wrote:
 On 2020-07-04 12:32, aberba via Digitalmars-d wrote:
 So please let me have your input.
Well, most somewhat popular languages have curated lists such as this one: https://github.com/zhaopuming/awesome-d
Yep, well aware of that.
 Back then, I enjoyed having access to posts that highlighted 
 and explained key aspects of dlang:

 https://seb.wilzba.ch/b/2018/02/the-expressive-c17-coding-challenge-in-d/
 https://wiki.dlang.org/Component_programming_with_ranges
 http://jordi.inversethought.com/blog/advent-of-d/
 https://dlang.org/blog/the-gc-series/
Ok good to know, I assume you came from the side where you're already comfortable with these.
If you collect this information, will you collect it on wiki.dlang.org?
Jul 05 2020
parent reply aberba <karabutaworld gmail.com> writes:
On Sunday, 5 July 2020 at 07:00:16 UTC, Jan Hönig wrote:
 On Saturday, 4 July 2020 at 20:15:27 UTC, aberba wrote:
 On Saturday, 4 July 2020 at 17:47:30 UTC, oddp wrote:
 On 2020-07-04 12:32, aberba via Digitalmars-d wrote:
 So please let me have your input.
Well, most somewhat popular languages have curated lists such as this one: https://github.com/zhaopuming/awesome-d
Yep, well aware of that.
 Back then, I enjoyed having access to posts that highlighted 
 and explained key aspects of dlang:

 https://seb.wilzba.ch/b/2018/02/the-expressive-c17-coding-challenge-in-d/
 https://wiki.dlang.org/Component_programming_with_ranges
 http://jordi.inversethought.com/blog/advent-of-d/
 https://dlang.org/blog/the-gc-series/
Ok good to know, I assume you came from the side where you're already comfortable with these.
If you collect this information, will you collect it on wiki.dlang.org?
I'm not sure. My tone and flow doesn't quite go like the official language. More human centered language...if that makes sense. But if turns out interesting, I'm willing to do it for D. Especially since it's going to be an opinionated with strong focus on the most reliable, most quality resources.
Jul 05 2020
parent Jon Degenhardt <jond noreply.com> writes:
On Sunday, 5 July 2020 at 11:22:12 UTC, aberba wrote:
 On Sunday, 5 July 2020 at 07:00:16 UTC, Jan Hönig wrote:
 On Saturday, 4 July 2020 at 20:15:27 UTC, aberba wrote:
 If you collect this information, will you collect it on 
 wiki.dlang.org?
I'm not sure. My tone and flow doesn't quite go like the official language. More human centered language...if that makes sense. But if turns out interesting, I'm willing to do it for D. Especially since it's going to be an opinionated with strong focus on the most reliable, most quality resources.
New references you find could be added to the Articles or Tutorials pages under the "Documentation" section of the wiki. Those pages are reference lists, so writing style is not an issue. * https://wiki.dlang.org/Articles * https://wiki.dlang.org/Tutorials --Jon
Jul 05 2020
prev sibling next sibling parent reply BoraxMan <rotflol2 hotmail.com> writes:
On Saturday, 4 July 2020 at 10:32:12 UTC, aberba wrote:

 The point of this post is to:
 1. Know what helped you get started with D
For what it is worth, as a hobby programmer; Mostly the dlang.org site itself, including the tour and perusing through the documentation. Also I referred to Ali's online D Programming Book as well. I often find introductory tutorials too brief and simple.
 2. What else you think its worth mentioning
There seems to be some conflicting information online? Perhaps due to outdated information. But for tutorials, examples, I find it easier to understand when a "real life" usage for that function or language feature is used. Take mixins for example, rather than mixin("int b = 5;") as an example, which is pointless, it is better to use an example where a mixin WOULD be required and useful. I think this helps with comprehension. When you are trying to grasp the concept, it just seems easier to understand it, when you can see what problems that concept would be used to solve. It might make the example longer, but it makes the concept clearer and leads you faster to the "A-ha!" moment.
 3. Things that weren't immediately obvious when you started 
 using D and you probably found out the hard way.
How to properly use C++ classes in D,and what the rules and techniques are for doing that. In particular, what you can, and can't do with a C++ class from D. I was looking at using D for a FLTK based GUI program, but found myself looking at the few scant examples trying to figure out what I could do which would work, and would not work.
Jul 06 2020
parent aberba <karabutaworld gmail.com> writes:
On Monday, 6 July 2020 at 12:19:12 UTC, BoraxMan wrote:
 On Saturday, 4 July 2020 at 10:32:12 UTC, aberba wrote:

 The point of this post is to:
 1. Know what helped you get started with D
For what it is worth, as a hobby programmer; Mostly the dlang.org site itself, including the tour and perusing through the documentation. Also I referred to Ali's online D Programming Book as well.
Good to know. Ali's books is quite a gift to the community.
 2. What else you think its worth mentioning
There seems to be some conflicting information online? Perhaps due to outdated information.
That's a know issue. I'm not sure what can be done about that considering someone needs to do it.
 But for tutorials, examples, I find it easier to understand 
 when a "real life" usage for that function or language feature 
 is used.  Take mixins for example, rather than mixin("int b = 
 5;") as an example, which is pointless, it is better to use an 
 example where a mixin WOULD be required and useful.

 I think this helps with comprehension.  When you are trying to 
 grasp the concept, it just seems easier to understand it, when 
 you can see what problems that concept would be used to solve.  
 It might make the example longer, but it makes the concept 
 clearer and leads you faster to the "A-ha!" moment.
The Phobos docs is fairly good in comparison to what's available elsewhere. But sometimes I wished some of the could be more practical oriented like Ali's book style. I guess you could say I could also do something about it, which is fair enough. Ha ha. I'm getting there. For a long time I didn't know how the D ecosystem (development side) works.
 3. Things that weren't immediately obvious when you started 
 using D and you probably found out the hard way.
How to properly use C++ classes in D,and what the rules and techniques are for doing that. In particular, what you can, and can't do with a C++ class from D. I was looking at using D for a FLTK based GUI program, but found myself looking at the few scant examples trying to figure out what I could do which would work, and would not work.
I believe now you've figured something out. A brief write-up on some readme, even if not much, could be useful to others looking to figure things out.
Jul 06 2020
prev sibling next sibling parent reply solidstate1991 <laszloszeremi outlook.com> writes:
On Saturday, 4 July 2020 at 10:32:12 UTC, aberba wrote:
 I'm looking to do a general but brief post on getting started 
 with D. Not everything will be written by me since I'm aware 
 there's several existing resources...more of creating an entry 
 point to all those resources (and writing more only when 
 necessary). I'm looking to cover areas such as:

 * Pros of D... general D's strength kind of getting you excited.
I was looking a more "system-level" alternative to Java. As C++ looked a bit scary and very janky (it's like programming in two languages at the same time, also there's the header), I took a look at D I've heard a few things at the time.
 * Leaning resources.
Ali Mehdi's book a good resource and starting point. Also it's very similar to other languages, like C and Java.
 * Development tools available in D Window, Linux, Mac
When I started out, I used a barely functioning CodeBlocks plugin, later I switched to Xamarin, then to VS2015/17, now I'm using VSCode for coding and compiling. I also use VS2019 as a Windows debugger, while I'll either go with GDB or LLDB for Linux.
 * Setting up a development environment
Just install DMD (LDC if you need the optimization and/or vectors), and VSCode with it's codeD extension.
 * Resources for game and graphics developers
Unfortunately there's not much at the moment due to the lack of engines for the language, however I'm planning on writing an article on the basic tips on game engine writing in D.
 * How and where to get help
This forum, also most of the D community is good. I only found one or two "weird" people, that's all.
 * D community platforms (forum, IRC, ???)
Join the D language Discord if you haven't yet.
 * How to contribute to D
Mine is mostly through creating my own libraries around stuff that I don't find in other libraries. No container library that satisfies my needs? Write `collections-d`! Need a better image library than what currently is available? Write `dimage`! Most of them don't have a good README.MD yet, my goal is to fix this issue ASAP.
Jul 07 2020
parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
 On Saturday, 4 July 2020 at 10:32:12 UTC, aberba wrote:
 I'm looking to do a general but brief post on getting started with
 D.  Not everything will be written by me since I'm aware there's
 several existing resources...more of creating an entry point to all
 those resources (and writing more only when necessary). I'm looking
 to cover areas such as:
 
 * Pros of D... general D's strength kind of getting you excited.
Where do I even begin... :-P When I first found D, I was looking for a better programming language than C/C++. Had been using C/C++ for at least a decade by then, but was becoming increasingly dissatisfied. Initial impressions (in no particular order): - Pros: - Compiled language (I was, and still am, skeptical of VMs). - Cleaner template syntax. - Built-in AA's. - Sane string handling. - Syntactic similarity to C/C++. - Binary compatibility with C/C++. - Cons: - GC: having been burned by early, poorer GC implementations in Java way back when, and having acquired tons of GC Phobia from C/C++, I was a big skeptic of GCs. Later impressions (also in no particular order): - Pros: - Metaprogramming: the biggest reason I still use D in spite of its flaws. - GC: yeah, I had an about-face on this one. Andrei's article about GC performance convinced me to at least give D a try. Gradually I discovered the advantages of GC and have been loving it ever since. - Arrays & slicing. Strings as arrays: not perfect, but practical, convenient, powerful. - Ranges. - Built-in unittests. The quality of my code improved by leaps and bounds because of this one feature alone. - Delegates: used correctly, they can really clean up your code by minimizing unnecessary dependencies. - foreach - final switch - compile speed - `dmd -`, the single best thing that's ever happened to DMD, which allows D one-liners to replace messy shell scripts. - The smooth transformation from throw-away script to full-fledged program over time. - Multi-paradigm: fit the language to your problem domain, rather than contorting your problem to fit the language's straitjacket. - Many others too numerous to list. - Cons: - Corner-case inconsistencies in the language, like the haphazard is() expressions, shared, ref, etc.. Fortunately these are relatively rare. - C-style integer promotion. Esp. auto-promotion from narrow ints to int, which are an annoyance. - Old Phobos modules that aren't up to the standard of modern D. - Mismanaged/missed opportunities and indecisions due to community disagreements. - dub: really needs to either embrace and allow easy interop with existing build frameworks like make, scons, etc., or else provide a big enough value in functionality and QoI to provide a compelling reason to adopt its mode of usage. Currently it tries to do what e.g. Gradle does, but poorly, so it neither satisfies interop with make-likes nor does what it does well enough that one might find a compelling reason to switch. [...]
 * Leaning resources.
TDPL: the one reason I dived deep into using D instead of just wading on the shallow end of the pool writing hello world programs. Also dlang.org docs. For all of its flaws, the online docs have come a long way, and definitely better than when I first started (there was almost no docs, and what was there was incomplete, outdated, and generally not very useful). The forums/mailing lists. People are generally very helpful. Reading Phobos source code is also highly recommended for the serious programmer -- except for a few dirty/ugly corners, it's generally a lot more readable than other languages' standard lib source code. (Try reading glibc source code, for example. Or ncurses. Or maybe, don't; they will give you a splitting headache for days.) [...]
 * Development tools available in D Window, Linux, Mac
Linux: dmd, ldc2 are really all I need. Linux is my IDE. :-D For editing code, I use vim. For builds, any sane build system would do, like tup or scons. If you must, use dub for fetching dependencies, but personally I'd just use a dummy empty project just for pulling in dependencies, and doing the actual build with a real build system instead. For profiling, I recommend google-perftools.
 * Setting up a development environment
apt-get install vim scons gdb Ready! ;-) [...]
 * Resources for game and graphics developers
For simple casual 2D games, I highly recommend using Adam Ruppe's arsd.* libraries. No fuss, no muss, they get right on the job, have no frilly dependencies, and generally work great for getting things up and running immediately. For larger projects, though, it's true there's somewhat of a vacuum. There's Derelict (which I've been meaning to try but never got around to is for, oh, a decade now :-/). If you want a full-fledged modern 3D engine, consider using D's C interop features to interface with an existing one, like Unity. (No idea how well that works in practice, though.) [...]
 * How and where to get help
This forum, and the D.learn forum. Apparently some helpful people like Adam are on IRC as well, and apparently also on Reddit. Don't use those places myself, though. [...]
 * How to contribute to D
1. Discover a problem (e.g., in Phobos). 2. File a bug. 3. Get impatient with slow response (or total lack thereof), and go read Phobos source code yourself. 4. Discover how readable Phobos source code is, fix the bug yourself, submit a PR. 5. Take a good, long nap. Well, more like hibernation, until some kind reviewer soul takes pity on your languishing PR and gives feedback. 6. Fix all issues raised, take another good, winter-long nap as the autotester churns along its days-long backlog. 7. Wake up to find PR merged. Profit! ;-) (Alternative to step 5: raise holy hell in the forums until enough people pay attention to your PR, then go to step 6.) Or, another scenario: 1. Discover some missing functionality that you need. 2. File an enhancement request / beg for somebody to write this for you on the forum. 3. Lose patience over the lack of change/progress / get tired of the never-ending debates that never result in any actual work getting done, and proceed to write the darned thing yourself. 4. Publish the code on github / code.dlang.org, brag about it on the forums, and earn lots of gratitude and praise. 5. Profit! ;-) T -- EMACS = Extremely Massive And Cumbersome System
Jul 07 2020
next sibling parent Adam D. Ruppe <destructionator gmail.com> writes:
On Tuesday, 7 July 2020 at 22:17:12 UTC, H. S. Teoh wrote:
 Apparently some helpful people like Adam are on IRC
 as well
IRC rox. As long as you can handle me spamming non-stop about the random thoughts on my mind. Lately I've been talking as much in there about solar power and house projects as I do about D :P but if anyone stops in and asks stuff, yeah, we all try to help if we're online. there's lulls though where nobody is paying attention, so you might not get an instant response.
 and apparently also on Reddit.
i hate reddit
Jul 07 2020
prev sibling parent aberba <karabutaworld gmail.com> writes:
On Tuesday, 7 July 2020 at 22:17:12 UTC, H. S. Teoh wrote:
 
[...]
Thank you! First time I'm reading about certain things myself. Very insightful. Really going to be using a lot from this. Also, wish more people discard their GC phobia-ness and see D's GC as something that works for many use cases. It'll be very interesting to see a debugging session on D. I'm not sure there's enough learning resources on that.
Jul 08 2020
prev sibling next sibling parent aberba <karabutaworld gmail.com> writes:
On Saturday, 4 July 2020 at 10:32:12 UTC, aberba wrote:
 * Resources for embedded programming
Does this statement still stand for D?
 Being targeted at 32 bit and 64 bit machines, D is not designed 
 for embedded development on small devices.
Jul 11 2020
prev sibling parent reply tastyminerals <tastyminerals gmail.com> writes:
On Saturday, 4 July 2020 at 10:32:12 UTC, aberba wrote:
 I'm looking to do a general but brief post on getting started 
 with D. Not everything will be written by me since I'm aware 
 there's several existing resources...more of creating an entry 
 point to all those resources (and writing more only when 
 necessary). I'm looking to cover areas such as:

 * Pros of D... general D's strength kind of getting you excited.
 * Leaning resources.
 * Development tools available in D Window, Linux, Mac
 * Setting up a development environment
 * Resources from web/server-side developers (which I know more  
 about than the others by experience)
 * Resources for game and graphics developers
 * Resources for scientific computing
 * Resources for desktops development (system, GUIs, ...??)
 * Resources for data science (taken separately from general 
 scientific computation)
 * Resources for embedded programming
 * Resources for ??? (Let me know what else I'm missing)
 * How and where to get help
 * D community platforms (forum, IRC, ???)
 * How to contribute to D


 The point of this post is to:
 1. Know what helped you get started with D
 2. What else you think its worth mentioning
 3. Things that weren't immediately obvious when you started 
 using D and you probably found out the hard way.


 I'm trying to balance between keeping it short but detailed 
 enough to make it useful to all sorts of people looking to get 
 started with D.

 I think I'll probably do a separate on on contributing back to 
 the D ecosystem and tools...open source outreach kind of post.

 So please let me have your input.
For scientific computing. D Mir -- high-performance numeric library. github: https://github.com/libmir/mir-algorithm docs: http://mir-algorithm.libmir.org/mir_ndslice_slice.html Vectorflow -- neural network library for on CPU training. github: https://github.com/Netflix/vectorflow docs: dub build -b ddox && dub run -b ddox Lubeck -- linear algebra library based on D Mir. github: https://github.com/kaleidicassociates/lubeck grain -- deep learning library (very early stages and looks like the author is busy with another project). github: https://github.com/ShigekiKarita/grain pdf: https://github.com/ShigekiKarita/grain-talk/blob/master/slide.pdf For data science. dstats -- statistics library for D. I am not aware if it is maintained though. https://github.com/DlangScience/dstats
Jul 16 2020
parent aberba <karabutaworld gmail.com> writes:
On Thursday, 16 July 2020 at 19:08:22 UTC, tastyminerals wrote:
 On Saturday, 4 July 2020 at 10:32:12 UTC, aberba wrote:
 [...]
For scientific computing. D Mir -- high-performance numeric library. github: https://github.com/libmir/mir-algorithm docs: http://mir-algorithm.libmir.org/mir_ndslice_slice.html [...]
Nice, thank you! I've begun writing it.
Jul 16 2020