Re: learning D as your first language but having difficulty in making or logic building in order to make software

2023-04-12 Thread Dom DiSc via Digitalmars-d-learn

On Tuesday, 11 April 2023 at 14:13:17 UTC, slectr wrote:
I want  to make software like krita inkscape and my own 
language using D


Although i previosly learned C and C++ i left it in the middle 
and for some reasons i dont want to learn those so i searched 
for alternatives and found D but there are not a lot of 
resources like cookbooks and videos as compared to C or C++ 
does anybody know any resources for making complex software in 
D for some practise


? Of course there are cookbooks - one even has explicitly that 
title!

Have a look on forum.dlang.org under Resources/Books.



learning D as your first language but having difficulty in making or logic building in order to make software

2023-04-11 Thread slectr via Digitalmars-d-learn
I want  to make software like krita inkscape and my own language 
using D


Although i previosly learned C and C++ i left it in the middle 
and for some reasons i dont want to learn those so i searched for 
alternatives and found D but there are not a lot of resources 
like cookbooks and videos as compared to C or C++ does anybody 
know any resources for making complex software in D for some 
practise


Re: Learning D

2021-05-14 Thread Mike Parker via Digitalmars-d-learn

On Friday, 14 May 2021 at 15:30:06 UTC, Imperatorn wrote:

https://www.amazon.com/Programming-Language-Former-Python-Developers-ebook/dp/B08MD7ZB2X

Anyone read it?


From the thread title, I thought you were asking about my book!




Re: Learning D

2021-05-14 Thread cc via Digitalmars-d-learn

On Friday, 14 May 2021 at 15:30:06 UTC, Imperatorn wrote:

https://www.amazon.com/Programming-Language-Former-Python-Developers-ebook/dp/B08MD7ZB2X

Anyone read it?


Haven't read it, the title has me at the first five words though.


Learning D

2021-05-14 Thread Imperatorn via Digitalmars-d-learn

https://www.amazon.com/Programming-Language-Former-Python-Developers-ebook/dp/B08MD7ZB2X

Anyone read it?


Re: books for learning D

2020-02-09 Thread Marcone via Digitalmars-d-learn

Programming in D - Tutorial and Reference 1st Edition
Free PDF Book.
Download: http://ddili.org/ders/d.en/index.html


Re: books for learning D

2020-01-31 Thread Jan Hönig via Digitalmars-d-learn

On Friday, 31 January 2020 at 10:51:07 UTC, mark wrote:

On Wednesday, 29 January 2020 at 11:57:14 UTC, Jan Hönig wrote:

On Monday, 13 January 2020 at 16:37:31 UTC, Ron Tarrant wrote:

On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote:

[...]


Actually, Andrei's book has been updated a few times over the 
years since first being published. The latest version says 
this on the copyright page:


D version: 2.081.1
Book revision: 2018-10-17

So, it's really only about 14 months old.


I am also curious. Where can i find the revised book.


I'd also like to know where the revised "The D Programming 
Language" by  Andrei Alexandrescu is: and whether it can be 
bought in physical form?


I think Ron confused Ali's book and Andrei's book.


Re: books for learning D

2020-01-31 Thread mark via Digitalmars-d-learn

On Wednesday, 29 January 2020 at 11:57:14 UTC, Jan Hönig wrote:

On Monday, 13 January 2020 at 16:37:31 UTC, Ron Tarrant wrote:

On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote:

I'm just starting out learning D.

Andrei Alexandrescu's "The D Programming Language" is 10 
years old, so is it still worth getting? (I don't know how 
much D has changed in 10 years.)


Actually, Andrei's book has been updated a few times over the 
years since first being published. The latest version says 
this on the copyright page:


D version: 2.081.1
Book revision: 2018-10-17

So, it's really only about 14 months old.


I am also curious. Where can i find the revised book.


I'd also like to know where the revised "The D Programming 
Language" by  Andrei Alexandrescu is: and whether it can be 
bought in physical form?


Re: books for learning D

2020-01-31 Thread Ron Tarrant via Digitalmars-d-learn

On Wednesday, 29 January 2020 at 11:57:14 UTC, Jan Hönig wrote:


I am also curious. Where can i find the revised book.


Sorry for the delay, guys. I thought I'd posted the link earlier. 
Here it is:


http://ddili.org/ders/d.en/index.html


Re: books for learning D

2020-01-30 Thread p.shkadzko via Digitalmars-d-learn

On Wednesday, 29 January 2020 at 08:56:26 UTC, rumbu wrote:

On Wednesday, 29 January 2020 at 08:40:48 UTC, p.shkadzko wrote:
Has anyone read "d programming language tutorial: A Step By 
Step Appoach: Learn d programming language Fast"?


https://www.goodreads.com/book/show/38328553-d-programming-language-tutorial?from_search=true&qid=G9QIeXioOJ&rank=3


Beware, this is a scam.
This guy has hundreds of "books". These books are promoted on 
various forums for download. Of course, you must enter your CC 
to "prove your identity".


Uh, ok, thanks for information.


Re: books for learning D

2020-01-29 Thread Jan Hönig via Digitalmars-d-learn

On Monday, 13 January 2020 at 16:37:31 UTC, Ron Tarrant wrote:

On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote:

I'm just starting out learning D.

Andrei Alexandrescu's "The D Programming Language" is 10 years 
old, so is it still worth getting? (I don't know how much D 
has changed in 10 years.)


Actually, Andrei's book has been updated a few times over the 
years since first being published. The latest version says this 
on the copyright page:


D version: 2.081.1
Book revision: 2018-10-17

So, it's really only about 14 months old.


I am also curious. Where can i find the revised book.


Re: books for learning D

2020-01-29 Thread rumbu via Digitalmars-d-learn

On Wednesday, 29 January 2020 at 08:40:48 UTC, p.shkadzko wrote:
Has anyone read "d programming language tutorial: A Step By 
Step Appoach: Learn d programming language Fast"?


https://www.goodreads.com/book/show/38328553-d-programming-language-tutorial?from_search=true&qid=G9QIeXioOJ&rank=3


Beware, this is a scam.
This guy has hundreds of "books". These books are promoted on 
various forums for download. Of course, you must enter your CC to 
"prove your identity".


Re: books for learning D

2020-01-29 Thread p.shkadzko via Digitalmars-d-learn
Has anyone read "d programming language tutorial: A Step By Step 
Appoach: Learn d programming language Fast"?


https://www.goodreads.com/book/show/38328553-d-programming-language-tutorial?from_search=true&qid=G9QIeXioOJ&rank=3


Re: Some comments on learning D using the tour

2020-01-16 Thread James Blachly via Digitalmars-d-learn

On 1/15/20 3:06 PM, mark wrote:

I am learning D for the first time.

While I wait for Mike Parker's "Learning D" book to arrive, I have 
started using the tour.


I really like the tour, especially the fact that you can run and tweak 
the code as well as read the explanations.


However, ...


Mark, thank you for your comments. It is always valuable to hear the 
perspective of someone approaching any problem or situation with a fresh 
set of eyes.




Re: Some comments on learning D using the tour

2020-01-16 Thread mark via Digitalmars-d-learn

On Thursday, 16 January 2020 at 02:32:07 UTC, Adam D. Ruppe wrote:

On Wednesday, 15 January 2020 at 20:06:01 UTC, mark wrote:
For example, I haven't found one definitive place in the docs 
that document D's strings.


My unofficial docs are built from the same source, so not 
perfect, but at least have better cross linking:


http://dpldocs.info/experimental-docs/std.string.html

might be helpful to you.


Comparing
https://dlang.org/phobos/std_string.html vs
http://dpldocs.info/experimental-docs/std.string.html
I generally find yours easier to read but miss the examples that 
are in the std docs. And in both cases there is no coverage of 
(or cross-refs to coverage of) string iteration, string indexing, 
and byte, code point, and grapheme counting. Also yours doesn't 
have the search box.


I've now discovered the std.uni and std.utf modules. There really 
ought to be cross-refs to/from these and std.string and Array 
string.


Re: Some comments on learning D using the tour

2020-01-16 Thread mark via Digitalmars-d-learn

On Thursday, 16 January 2020 at 01:02:46 UTC, Mike Parker wrote:

On Wednesday, 15 January 2020 at 20:06:01 UTC, mark wrote:


However, what I really miss is a contents page so that I can 
look at each topic and jump back when I want to recap 
something.


Please submit an enhancement request:

https://github.com/dlang-tour/core/issues


Done: https://github.com/dlang-tour/core/issues/741

For example, I haven't found one definitive place in the docs 
that document D's strings.


https://dlang.org/spec/arrays.html#strings


I'd found that, as I mentioned, but it is unsatisfactory. For 
example, it says nothing about how to iterate the characters in a 
string or about the different kinds of string lengths (byte 
count, code point count, grapheme count).


Strings are important enough to deserve their own chapter in the 
online "D Programming Language". Such a chapter ought to have 
cross-refs to arrays and draw together _all_ the relevant string 
related info.


Re: Some comments on learning D using the tour

2020-01-15 Thread Adam D. Ruppe via Digitalmars-d-learn

On Wednesday, 15 January 2020 at 20:06:01 UTC, mark wrote:
For example, I haven't found one definitive place in the docs 
that document D's strings.


My unofficial docs are built from the same source, so not 
perfect, but at least have better cross linking:


http://dpldocs.info/experimental-docs/std.string.html

might be helpful to you.


Re: Some comments on learning D using the tour

2020-01-15 Thread Mike Parker via Digitalmars-d-learn

On Wednesday, 15 January 2020 at 20:06:01 UTC, mark wrote:


However, what I really miss is a contents page so that I can 
look at each topic and jump back when I want to recap something.


Please submit an enhancement request:

https://github.com/dlang-tour/core/issues



For example, I haven't found one definitive place in the docs 
that document D's strings.


https://dlang.org/spec/arrays.html#strings


Some comments on learning D using the tour

2020-01-15 Thread mark via Digitalmars-d-learn

I am learning D for the first time.

While I wait for Mike Parker's "Learning D" book to arrive, I 
have started using the tour.


I really like the tour, especially the fact that you can run and 
tweak the code as well as read the explanations.


However, what I really miss is a contents page so that I can look 
at each topic and jump back when I want to recap something.


For example, I haven't found one definitive place in the docs 
that document D's strings. I've found the std.string module's 
docs and the Array's string docs -- which unfortunately are not 
cross-ref'd with links to each other. I know that I've covered 
strings in the tour, but with no list of contents I can't find it 
without "endlessly" clicking back to find it.


Another thing I like about the tour is that the imports specify 
the imported functions so you can see exactly where they come 
from.





Re: books for learning D

2020-01-13 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Jan 13, 2020 at 04:23:19AM -0800, Ali Çehreli via Digitalmars-d-learn 
wrote:
> On 1/13/20 2:28 AM, mark wrote:
> > I'm just starting out learning D.
> > 
> > Andrei Alexandrescu's "The D Programming Language" is 10 years old,
> > so is it still worth getting? (I don't know how much D has changed
> > in 10 years.)
[...]

I think it's still worth it.  The basics of the language haven't changed
that much.  Plus, for your reference, here's Andrei errata that updates
the book in a few places:

https://erdani.com/tdpl/errata/


T

-- 
"Outlook not so good." That magic 8-ball knows everything! I'll ask about 
Exchange Server next. -- (Stolen from the net)


Re: books for learning D

2020-01-13 Thread mark via Digitalmars-d-learn

On Monday, 13 January 2020 at 16:37:31 UTC, Ron Tarrant wrote:
Actually, Andrei's book has been updated a few times over the 
years since first being published. The latest version says this 
on the copyright page:


D version: 2.081.1
Book revision: 2018-10-17

So, it's really only about 14 months old.


Is that an ebook edition? The "look inside" of the physical book 
shows "First Printing, May 2010".


Re: books for learning D

2020-01-13 Thread Pavel Shkadzko via Digitalmars-d-learn

On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote:

I'm just starting out learning D.

Andrei Alexandrescu's "The D Programming Language" is 10 years 
old, so is it still worth getting? (I don't know how much D has 
changed in 10 years.)


Start with "Programming in D" by Ali: 
http://ddili.org/ders/d.en/index.html
A good all-rounder book for any level, you can easily skip the 
chapters if you already know the domain. It starts slowly with a 
lot of detail (which I personally liked) but then gets a bit 
rushed and sketchy in the end still a **must-read** for anyone 
who comes from Python or any other "high level" language since a 
lot of things will be new to you.


After studying Ali's book you will be pretty much ready to code, 
in fact you'll be ready to code in roughly a week or so since D 
is such an easy language to pick up ;)


Then you can go straight to "D Cookbook" by Adam: 
https://dlang.org/blog/2016/08/04/the-origins-of-the-d-cookbook/
Don't start this book if you don't know D at least a little or if 
you're quite experienced with C++. I find that C++ devs can 
quickly jump to D. The book is basically a collection of various 
problems and solutions in D with nice explanations. I am still on 
it.


"The D Programming Language" book by Andrei: 
https://www.amazon.com/gp/product/0321635361/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0321635361&linkCode=as2&tag=dlang-20&linkId=BOLS7NQK6MXCZTMG
I really enjoy Anrei's style of writing but I think this book is 
mostly an good evening read that is -- it is more about the 
history and ideas behind D. Good for high level understanding of 
the language concepts. (Correct me if I am wrong because I 
haven't read it fully yet).


Finally, you have plenty of materials on dlang website:
https://dlang.org/comparison.html
https://dlang.org/articles/index.html



Re: books for learning D

2020-01-13 Thread mark via Digitalmars-d-learn

On Monday, 13 January 2020 at 16:45:46 UTC, mark wrote:

On Monday, 13 January 2020 at 16:37:31 UTC, Ron Tarrant wrote:
Actually, Andrei's book has been updated a few times over the 
years since first being published. The latest version says 
this on the copyright page:


D version: 2.081.1
Book revision: 2018-10-17

So, it's really only about 14 months old.


Is that an ebook edition? The "look inside" of the physical 
book shows "First Printing, May 2010".


(Oh, you can't post-edit like in discourse.)

Anyway, I'll start with Mike's and if I get on with D I'll 
probably get all three.


Re: books for learning D

2020-01-13 Thread Ron Tarrant via Digitalmars-d-learn

On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote:

I'm just starting out learning D.

Andrei Alexandrescu's "The D Programming Language" is 10 years 
old, so is it still worth getting? (I don't know how much D has 
changed in 10 years.)


Actually, Andrei's book has been updated a few times over the 
years since first being published. The latest version says this 
on the copyright page:


D version: 2.081.1
Book revision: 2018-10-17

So, it's really only about 14 months old.


Re: books for learning D

2020-01-13 Thread Adam D. Ruppe via Digitalmars-d-learn

On Monday, 13 January 2020 at 11:58:51 UTC, mark wrote:
Both those books are published by Packt who normally have no 
quality control at all as I've discovered to my cost.


I found working with Packt to be difficult on a lot of levels 
too. Like chapter 1 of my book had various symbols mangled 
through the review process... and that made it to print. (I 
realized the problem through the chapter 2 process at least and 
fixed most of it there, but once chapter 1 was submitted there 
was no chance to go back and fix it.)


So like there's stuff like

import foo;;;

with 3 ; actually in there. Ugh. But at least those are easy to 
fix if you already know basic D syntax and doesn't affect the 
explanatory text, which (I think anyway) mostly turned quite good.


I also have downloads of the intended code samples on my website:

http://arsdnet.net/dcode/book/

so you can look there too (and copy/paste more easily!).

also spying the code samples there will give you some idea of 
what the text is about before buying as well.


I recently did an unofficial second edition of the socket sample 
on my blog too so that's a freebie lol 
http://dpldocs.info/this-week-in-d/Blog.Posted_2019_11_11.html#sockets-tutorial


Re: books for learning D

2020-01-13 Thread mark via Digitalmars-d-learn
Thanks for all the comments. Look's like I'll be buying Mike's 
"Learning D"!


Re: books for learning D

2020-01-13 Thread René Heldmaier via Digitalmars-d-learn

On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote:

I'm just starting out learning D.

Andrei Alexandrescu's "The D Programming Language" is 10 years 
old, so is it still worth getting? (I don't know how much D has 
changed in 10 years.)


I found the book amazing. It not only explains the language, but 
also how things work behind the scenes. For a book on programming 
languages it's written in an entertaining style. It's also a joy 
to see how beautiful the design of D is, compared to languages 
like C++ or C#.


But...

The book is definitely not written for beginners. You should at 
least have a good understanding of C (Especially the concept of 
pointers). Even though the chapter on pointers is only 2 pages 
long, the word "pointer" occurs 155 times in the book (I made a 
quick search over my ebook version).


Re: books for learning D

2020-01-13 Thread Mike Parker via Digitalmars-d-learn

On Monday, 13 January 2020 at 11:58:51 UTC, mark wrote:



Both those books are published by Packt who normally have no 
quality control at all as I've discovered to my cost. However


It's hit and miss in my experience. I've picked up some utter 
crap from them, but I've also found some real gems. There's no 
real vetting of the authors they sign, so the writing quality and 
knowledge level vary. Assuming those are up to snuff, much 
depends on feedback from the technical reviewers and the author's 
ability to evaluate the editor's revisions.


Packt's editors follow a rote process where certain words and 
phrases are *always* replaced from a set of alternatives and 
certain phrases are *always* inserted in certain circumstances 
(e.g., to introduce a code snippet) without any regard for the 
surrounding context. Fortunately, they give the author a chance 
to review the edits before publication. In my case, they were 
willing to accept my revision of the revisions (the ones I 
caught, anyway). Sadly, I never had a chance to do the same with 
the two chapters they published online.


I can attest that Adam's and Kai's books are worth the buy. I own 
and have enjoyed both. If either of them were to do a 2nd 
edition, I'd pick it up!





Re: books for learning D

2020-01-13 Thread Ali Çehreli via Digitalmars-d-learn

On 1/13/20 2:28 AM, mark wrote:

I'm just starting out learning D.

Andrei Alexandrescu's "The D Programming Language" is 10 years old, so 
is it still worth getting? (I don't know how much D has changed in 10 
years.)




Yes, Andrei's book is dated but it offers a great perspective on D and 
programming languages in general.


Unfortunately, my book is lagging behind as well. For example, I still 
have to replace post-blit with copy constructors.


I recommend Mike's book as well and Adam's book is a great complement to 
all the tutorials. Kai's book is great too but it is on vibe.d and I 
don't know how much vibe.d has changed since the book was written.


Ali


Re: books for learning D

2020-01-13 Thread mark via Digitalmars-d-learn

On Monday, 13 January 2020 at 11:35:51 UTC, bachmeier wrote:

On Monday, 13 January 2020 at 11:20:31 UTC, mark wrote:
On Monday, 13 January 2020 at 11:13:32 UTC, Ferhat Kurtulmuş 
wrote:
On Monday, 13 January 2020 at 11:08:45 UTC, Ferhat Kurtulmuş 
wrote:

On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote:

I'm just starting out learning D.

Andrei Alexandrescu's "The D Programming Language" is 10 
years old, so is it still worth getting? (I don't know how 
much D has changed in 10 years.)


Depending on your background:

https://wiki.dlang.org/First_Language
https://wiki.dlang.org/Coming_From


Even if you are not new to programming this book would be a 
good start:

http://ddili.org/ders/d.en/index.html


Thanks for the links.

I should have said that I find it a *lot* easier learning from 
a print book than online which is why I asked about the 
Alexandrescu book.


Has D changed enough in 10 years to outdate that book? I know 
most other languages have but I'm completely new to D.


I'll also throw out that the books by Andrei, Mike Parker, and 
Adam Ruppe are available on O'Reilly's Safari if you have 
access. You could see which you like best and order that one.


Both those books are published by Packt who normally have no 
quality control at all as I've discovered to my cost. However 
they do seem to have people with good D credentials as 
reviewers/foreword writers, so I guess I'll try Parker's after 
I've tried the "official" one.

Thanks.


Re: books for learning D

2020-01-13 Thread bachmeier via Digitalmars-d-learn

On Monday, 13 January 2020 at 11:20:31 UTC, mark wrote:
On Monday, 13 January 2020 at 11:13:32 UTC, Ferhat Kurtulmuş 
wrote:
On Monday, 13 January 2020 at 11:08:45 UTC, Ferhat Kurtulmuş 
wrote:

On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote:

I'm just starting out learning D.

Andrei Alexandrescu's "The D Programming Language" is 10 
years old, so is it still worth getting? (I don't know how 
much D has changed in 10 years.)


Depending on your background:

https://wiki.dlang.org/First_Language
https://wiki.dlang.org/Coming_From


Even if you are not new to programming this book would be a 
good start:

http://ddili.org/ders/d.en/index.html


Thanks for the links.

I should have said that I find it a *lot* easier learning from 
a print book than online which is why I asked about the 
Alexandrescu book.


Has D changed enough in 10 years to outdate that book? I know 
most other languages have but I'm completely new to D.


I'll also throw out that the books by Andrei, Mike Parker, and 
Adam Ruppe are available on O'Reilly's Safari if you have access. 
You could see which you like best and order that one.


Re: books for learning D

2020-01-13 Thread bachmeier via Digitalmars-d-learn

On Monday, 13 January 2020 at 11:20:31 UTC, mark wrote:
On Monday, 13 January 2020 at 11:13:32 UTC, Ferhat Kurtulmuş 
wrote:
On Monday, 13 January 2020 at 11:08:45 UTC, Ferhat Kurtulmuş 
wrote:

On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote:

I'm just starting out learning D.

Andrei Alexandrescu's "The D Programming Language" is 10 
years old, so is it still worth getting? (I don't know how 
much D has changed in 10 years.)


Depending on your background:

https://wiki.dlang.org/First_Language
https://wiki.dlang.org/Coming_From


Even if you are not new to programming this book would be a 
good start:

http://ddili.org/ders/d.en/index.html


Thanks for the links.

I should have said that I find it a *lot* easier learning from 
a print book than online which is why I asked about the 
Alexandrescu book.


Has D changed enough in 10 years to outdate that book? I know 
most other languages have but I'm completely new to D.


Ali's book
http://ddili.org/ders/d.en/index.html
is D's "official tutorial". You can buy a print copy. If you have 
experience with other languages, Mike Parker's Learning D is also 
an excellent choice. There's nothing wrong with Andrei's book for 
a beginner, but I would personally recommend those two over 
Andrei's for someone new to D.


Re: books for learning D

2020-01-13 Thread mark via Digitalmars-d-learn
On Monday, 13 January 2020 at 11:13:32 UTC, Ferhat Kurtulmuş 
wrote:
On Monday, 13 January 2020 at 11:08:45 UTC, Ferhat Kurtulmuş 
wrote:

On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote:

I'm just starting out learning D.

Andrei Alexandrescu's "The D Programming Language" is 10 
years old, so is it still worth getting? (I don't know how 
much D has changed in 10 years.)


Depending on your background:

https://wiki.dlang.org/First_Language
https://wiki.dlang.org/Coming_From


Even if you are not new to programming this book would be a 
good start:

http://ddili.org/ders/d.en/index.html


Thanks for the links.

I should have said that I find it a *lot* easier learning from a 
print book than online which is why I asked about the 
Alexandrescu book.


Has D changed enough in 10 years to outdate that book? I know 
most other languages have but I'm completely new to D.


Re: books for learning D

2020-01-13 Thread IGotD- via Digitalmars-d-learn

On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote:

I'm just starting out learning D.

Andrei Alexandrescu's "The D Programming Language" is 10 years 
old, so is it still worth getting? (I don't know how much D has 
changed in 10 years.)


Andrei Alexandrescu's is still a good read for those who wants to 
learn D coming from other languages. What I like about the book 
is that he also could explain the reasoning behind different 
design choices. Some of it might be out of date but not that much 
and it is still useful.


Re: books for learning D

2020-01-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Monday, 13 January 2020 at 11:08:45 UTC, Ferhat Kurtulmuş 
wrote:

On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote:

I'm just starting out learning D.

Andrei Alexandrescu's "The D Programming Language" is 10 years 
old, so is it still worth getting? (I don't know how much D 
has changed in 10 years.)


Depending on your background:

https://wiki.dlang.org/First_Language
https://wiki.dlang.org/Coming_From


Even if you are not new to programming this book would be a good 
start:

http://ddili.org/ders/d.en/index.html


Re: books for learning D

2020-01-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn

On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote:

I'm just starting out learning D.

Andrei Alexandrescu's "The D Programming Language" is 10 years 
old, so is it still worth getting? (I don't know how much D has 
changed in 10 years.)


Depending on your background:

https://wiki.dlang.org/First_Language
https://wiki.dlang.org/Coming_From


books for learning D

2020-01-13 Thread mark via Digitalmars-d-learn

I'm just starting out learning D.

Andrei Alexandrescu's "The D Programming Language" is 10 years 
old, so is it still worth getting? (I don't know how much D has 
changed in 10 years.)




Re: Meson build system user learning D.

2019-06-23 Thread Mike Brockus via Digitalmars-d-learn

On Monday, 27 May 2019 at 16:49:45 UTC, Russel Winder wrote:
On Mon, 2019-05-27 at 16:13 +, Mike Brockus via 
Digitalmars-d-learn wrote:

[…]

I tried that custom command voodoo then I tried to use 'dub' 
as a method for hunting down dependencies.  Basically got 
something like this.


Apologies but I am not sure what you have tried. Installing 
unit- threaded as a shared library is so as to build a D 
project without dub at all. What I didn't say in the previous 
email is that if you are installing libraries not to the 
standard place you have to set some environment variables. In 
my case, consistent with the build instructions I gave for my 
case:


PKG_CONFIG_PATH=.:/home/users/russel/Built/share/pkgconfig:/home/users/russel/Built/lib/pkgconfig
 LD_LIBRARY_PATH=.:/home/users/russel/Built/lib

Having . in the paths is not something everyone does though.


'''
 Found DUB: /usr/local/bin/dub (DUB version 1.15.0, built 
on

May  4 2019)
 Dependency unit-threaded found: NO

 meson.build:71:0: ERROR: Dependency "unit-threaded" not 
found

'''


This seems like you are using Dub from within the Meson/Ninja 
build, this is not something I do. I know you can use Dub from 
Meson to deal with dependencies, but this is not something I 
do. I build all the dependencies and then build the application 
without Dub.


If using Dub from Meson to handle dependencies becomes the de 
facto standard I'll give it a whirl.


I finally got D unit testing working without having to include 
main, it was only a compiler flag away and with the help of other 
D programmers.


https://github.com/squidfarts/d-porject

However that doesn’t mean I gave up on unit-threaded it’s just 
that I should start with using what is already provided by the 
language and if I happen to grow out of the basic tools then I 
will try again.  😊


Re: Meson build system user learning D.

2019-05-27 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2019-05-27 at 16:13 +, Mike Brockus via Digitalmars-d-learn 
wrote:
> […]
> 
> I tried that custom command voodoo then I tried to use 'dub' as a 
> method for hunting down dependencies.  Basically got something 
> like this.

Apologies but I am not sure what you have tried. Installing unit-
threaded as a shared library is so as to build a D project without dub
at all. What I didn't say in the previous email is that if you are
installing libraries not to the standard place you have to set some
environment variables. In my case, consistent with the build
instructions I gave for my case:

PKG_CONFIG_PATH=.:/home/users/russel/Built/share/pkgconfig:/home/users/russel/Built/lib/pkgconfig
LD_LIBRARY_PATH=.:/home/users/russel/Built/lib

Having . in the paths is not something everyone does though.

> '''
>  Found DUB: /usr/local/bin/dub (DUB version 1.15.0, built on 
> May  4 2019)
>  Dependency unit-threaded found: NO
> 
>  meson.build:71:0: ERROR: Dependency "unit-threaded" not found
> '''

This seems like you are using Dub from within the Meson/Ninja build,
this is not something I do. I know you can use Dub from Meson to deal
with dependencies, but this is not something I do. I build all the
dependencies and then build the application without Dub.

If using Dub from Meson to handle dependencies becomes the de facto
standard I'll give it a whirl.

-- 
Russel.
===
Dr Russel Winder  t: +44 20 7585 2200
41 Buckmaster Roadm: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk



signature.asc
Description: This is a digitally signed message part


Re: Meson build system user learning D.

2019-05-27 Thread Mike Brockus via Digitalmars-d-learn

On Thursday, 23 May 2019 at 06:14:11 UTC, Russel Winder wrote:
On Thu, 2019-05-23 at 04:21 +, Mike Brockus via 
Digitalmars-d-learn wrote:

[…]

That is cool that Atila was kind enough to accept the 
meson.build file.  But how do I use the written meson.build 
that is apparently in the subdirectory directory "build"?  
Just asking because normally I see a meson.build in the root 
of the project.


Having the meson.build in the project root directory is the 
norm, and that was where I put it originally. However, Atila 
chose to leave only the Dub build in the root directory and 
place all other build-related files in the build directory. 
This is not a problem since Meson is entirely happy with that 
structure.


I have my clone of unit-threaded in
~/Repositories/Git/Fork/Unit_Threaded and
I build in ~/BuildArea/Unit_Threaded. My meson command in the 
build

directory is:

meson --prefix=$HOME/Built 
~/Repositories/Git/Fork/Unit_Threaded/built


and this works fine. I then build and install using Ninja. To 
date it all works for me. If you try this and something goes 
wrong put an issue on the unit-threaded GitHub project area and 
email me in case I don't get a notification from the issue 
system.


I tried that custom command voodoo then I tried to use 'dub' as a 
method for hunting down dependencies.  Basically got something 
like this.


'''
Found DUB: /usr/local/bin/dub (DUB version 1.15.0, built on 
May  4 2019)

Dependency unit-threaded found: NO

meson.build:71:0: ERROR: Dependency "unit-threaded" not found
'''


Re: Meson build system user learning D.

2019-05-22 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2019-05-23 at 04:21 +, Mike Brockus via Digitalmars-d-learn 
wrote:
> […]
> 
> That is cool that Atila was kind enough to accept the meson.build 
> file.  But how do I use the written meson.build that is 
> apparently in the subdirectory directory "build"?  Just asking 
> because normally I see a meson.build in the root of the project.

Having the meson.build in the project root directory is the norm, and
that was where I put it originally. However, Atila chose to leave only
the Dub build in the root directory and place all other build-related
files in the build directory. This is not a problem since Meson is
entirely happy with that structure.

I have my clone of unit-threaded in
~/Repositories/Git/Fork/Unit_Threaded and 
I build in ~/BuildArea/Unit_Threaded. My meson command in the build
directory is:

meson --prefix=$HOME/Built ~/Repositories/Git/Fork/Unit_Threaded/built

and this works fine. I then build and install using Ninja. To date it
all works for me. If you try this and something goes wrong put an issue
on the unit-threaded GitHub project area and email me in case I don't
get a notification from the issue system.

-- 
Russel.
===
Dr Russel Winder  t: +44 20 7585 2200
41 Buckmaster Roadm: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk



signature.asc
Description: This is a digitally signed message part


Re: Meson build system user learning D.

2019-05-22 Thread Mike Brockus via Digitalmars-d-learn

On Tuesday, 21 May 2019 at 10:59:40 UTC, Russel Winder wrote:
On Tue, 2019-05-21 at 05:21 +, Mike Brockus via 
Digitalmars-d-learn wrote:



[…]
The solution from Reddit solves the problem for 'dub' but as 
part of my project C to D I wanted to use Meson and run test 
with whatever is available, coming next week I will try to 
incorporate 'unit-threaded' and if it works then I can tell 
Meson to include it as my decency and to use 'dub' to get it 
for me so I can focus on writing test for my code.  I am 
currently working on becoming an Android app developer leaning 
Kotlin and on the weekends it's D.


I use unit-threaded for my D code tests. Atila was kind enough 
to allow me to add a Meson build to unit-threaded. I therefore 
build and install a shared library of unit-threaded so as to 
avoid use of Dub in the Meson build of my D projects.



[…]

However it is good to know that there is currently no compiler 
for D on a AVR chip.


I thought GCC had an AVR backend so that GDC provides D on AVR.


That is cool that Atila was kind enough to accept the meson.build 
file.  But how do I use the written meson.build that is 
apparently in the subdirectory directory "build"?  Just asking 
because normally I see a meson.build in the root of the project.





Re: Meson build system user learning D.

2019-05-21 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2019-05-21 at 05:21 +, Mike Brockus via Digitalmars-d-learn wrote:
> 
[…]
> The solution from Reddit solves the problem for 'dub' but as part 
> of my project C to D I wanted to use Meson and run test with 
> whatever is available, coming next week I will try to incorporate 
> 'unit-threaded' and if it works then I can tell Meson to include 
> it as my decency and to use 'dub' to get it for me so I can focus 
> on writing test for my code.  I am currently working on becoming 
> an Android app developer leaning Kotlin and on the weekends it's 
> D.

I use unit-threaded for my D code tests. Atila was kind enough to allow me to
add a Meson build to unit-threaded. I therefore build and install a shared
library of unit-threaded so as to avoid use of Dub in the Meson build of my D
projects.

> […]
> 
> However it is good to know that there is currently no compiler 
> for D on a AVR chip.

I thought GCC had an AVR backend so that GDC provides D on AVR.

-- 
Russel.
===
Dr Russel Winder  t: +44 20 7585 2200
41 Buckmaster Roadm: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk



signature.asc
Description: This is a digitally signed message part


Re: Meson build system user learning D.

2019-05-20 Thread Mike Brockus via Digitalmars-d-learn

On Tuesday, 21 May 2019 at 03:07:20 UTC, Johannes Loher wrote:

On Sunday, 19 May 2019 at 16:47:39 UTC, Mike Brockus wrote:

On Sunday, 19 May 2019 at 07:46:11 UTC, Johannes Loher wrote:

Am 18.05.19 um 08:20 schrieb Mike Brockus:

[...]


Hey there,

I already tried to answer your questions on reddit.

You can post links here by simply pasting the URL (the link 
will not be highlighted in the editor, but it will be when it 
is posted).


Regarding your problem: Could you please describe what you 
are actually trying to do? Are you trying to use D in an 
exisiting Meson project (as an addition to the existing 
code)? Why are you trying to use the Unity test framework (I 
only had a quick look at it, but from what I saw it uses a 
lot of preprocessor macros which will make it difficult to 
get it wotk work properly with D). Why not use the built-in 
unittests or one of the many already existing unit testing 
frameworks for D ([1], [2], [3], [4], [5])?


[1] https://code.dlang.org/packages/unit-threaded
[2] https://code.dlang.org/packages/dunit
[3] https://code.dlang.org/packages/d-unit
[4] https://code.dlang.org/packages/fluent-asserts
[5] https://code.dlang.org/packages/trial


I am trying to do two things one being able to turn a pure C 
project into a pure D project without destroying the existing 
file structure.

The project (https://github.com/squidfarts/c-project.git)

The other is to make a new Arduino UNO board project that 
leverages existing C and C++ code so I can spend small amounts 
of time writing new D code as I update all of my Arduino 
applications.


I would like to use the Unity test framework for that Arduino 
UNO based project that uses D, C, C++ and both Meson build 
system and Conan package manager.  The part with C and C++ are 
just for linking with the Arduino libraries, including exiting 
classes while I write new D code to replace the existing C and 
C++ code where ever it makes since.  Conan is used to get both 
the Unity and CMock from GitHub.


For the pure D project I would like to use whatever D provides 
me.  Since you provided this list I would start with 
unit-threaded and see if it can help with this main function 
problem.


Hey again, does my answer from reddit not solve your first 
problem (keeping the existing file structure)? As mentioned, 
using Unity for the tests does not really make sense with D, 
though it might be possible to use it with dpp ([1]).


Regarding your second problem: The Arduino UNO is based on the 
ATmega328P, which is an AVR chip. There is currently no D 
compiler available, that targets AVR, so you won‘t be able to 
use D for programming your Arduino UNO for now. There have been 
discussions about this ([2], [3]), but for now it is simply not 
possible.


[1] https://github.com/atilaneves/dpp
[2] 
https://forum.dlang.org/thread/1328258826.2142.4.camel@ububox?page=1
[3] 
https://forum.dlang.org/thread/zvderukicijcuxgqg...@forum.dlang.org


The solution from Reddit solves the problem for 'dub' but as part 
of my project C to D I wanted to use Meson and run test with 
whatever is available, coming next week I will try to incorporate 
'unit-threaded' and if it works then I can tell Meson to include 
it as my decency and to use 'dub' to get it for me so I can focus 
on writing test for my code.  I am currently working on becoming 
an Android app developer leaning Kotlin and on the weekends it's 
D.


As for Arduino I was thinking more in the ways of using D to 
interface with existing C functionality in the Arduino, for this 
to work I think I just need to tell Meson to make this a C, C++, 
D project.  Something like this:


# Root meson.build

project('uno_proj', 'c', 'cpp', 'd')# this would work...

subdir('src')



# src/main.d
extern (C) void setup(); // This should call the defections for 
the most important

extern (C) void loop();  // functions in any Arduino program.


void setup()
{
// some code here.
}// end of function setup

void loop()
{
// Whatever the program needs to do.
}// end of function loop



In the actual project the meson.build in the 'src' directory is 
where I manage generating the other required files also, this was 
just meant to be like pseudocode example to give some idea as to 
what I meant.


However it is good to know that there is currently no compiler 
for D on a AVR chip.










Re: Meson build system user learning D.

2019-05-20 Thread Johannes Loher via Digitalmars-d-learn

On Sunday, 19 May 2019 at 16:47:39 UTC, Mike Brockus wrote:

On Sunday, 19 May 2019 at 07:46:11 UTC, Johannes Loher wrote:

Am 18.05.19 um 08:20 schrieb Mike Brockus:

[...]


Hey there,

I already tried to answer your questions on reddit.

You can post links here by simply pasting the URL (the link 
will not be highlighted in the editor, but it will be when it 
is posted).


Regarding your problem: Could you please describe what you are 
actually trying to do? Are you trying to use D in an exisiting 
Meson project (as an addition to the existing code)? Why are 
you trying to use the Unity test framework (I only had a quick 
look at it, but from what I saw it uses a lot of preprocessor 
macros which will make it difficult to get it wotk work 
properly with D). Why not use the built-in unittests or one of 
the many already existing unit testing frameworks for D ([1], 
[2], [3], [4], [5])?


[1] https://code.dlang.org/packages/unit-threaded
[2] https://code.dlang.org/packages/dunit
[3] https://code.dlang.org/packages/d-unit
[4] https://code.dlang.org/packages/fluent-asserts
[5] https://code.dlang.org/packages/trial


I am trying to do two things one being able to turn a pure C 
project into a pure D project without destroying the existing 
file structure.

The project (https://github.com/squidfarts/c-project.git)

The other is to make a new Arduino UNO board project that 
leverages existing C and C++ code so I can spend small amounts 
of time writing new D code as I update all of my Arduino 
applications.


I would like to use the Unity test framework for that Arduino 
UNO based project that uses D, C, C++ and both Meson build 
system and Conan package manager.  The part with C and C++ are 
just for linking with the Arduino libraries, including exiting 
classes while I write new D code to replace the existing C and 
C++ code where ever it makes since.  Conan is used to get both 
the Unity and CMock from GitHub.


For the pure D project I would like to use whatever D provides 
me.  Since you provided this list I would start with 
unit-threaded and see if it can help with this main function 
problem.


Hey again, does my answer from reddit not solve your first 
problem (keeping the existing file structure)? As mentioned, 
using Unity for the tests does not really make sense with D, 
though it might be possible to use it with dpp ([1]).


Regarding your second problem: The Arduino UNO is based on the 
ATmega328P, which is an AVR chip. There is currently no D 
compiler available, that targets AVR, so you won‘t be able to use 
D for programming your Arduino UNO for now. There have been 
discussions about this ([2], [3]), but for now it is simply not 
possible.


[1] https://github.com/atilaneves/dpp
[2] 
https://forum.dlang.org/thread/1328258826.2142.4.camel@ububox?page=1
[3] 
https://forum.dlang.org/thread/zvderukicijcuxgqg...@forum.dlang.org


Re: Meson build system user learning D.

2019-05-19 Thread Mike Brockus via Digitalmars-d-learn

On Sunday, 19 May 2019 at 07:46:11 UTC, Johannes Loher wrote:

Am 18.05.19 um 08:20 schrieb Mike Brockus:
Hello there this is your hometown Meson build system user here 
just

happen to have a
question related to unit testing in D.

So is there a way to run the unit-test in the test main as a 
costume

test runner in
"test/test.d", and run the executable program in "src/main.d", 
with this

resulting in two
executable binaries one for test and one for the program?

I was considering using Unity test framework so I would know 
that if I was running the test runner that it was definitely 
the custom test runner returning the value of all test cases 
ran and not a mistake of running the main executable program.  
But I am not sure if that would insulate the D programming 
community by not using the provided unit testing functionality 
in D.


I am mostly trying to make a version based on an existing C 
template but

with D language
syntax using whatever tools D provides along side Meson build 
system.  I

would give you
the link(s) but I haven't figured out how to add links here on 
the D

forum, and I just
registered.

Thanks...


Hey there,

I already tried to answer your questions on reddit.

You can post links here by simply pasting the URL (the link 
will not be highlighted in the editor, but it will be when it 
is posted).


Regarding your problem: Could you please describe what you are 
actually trying to do? Are you trying to use D in an exisiting 
Meson project (as an addition to the existing code)? Why are 
you trying to use the Unity test framework (I only had a quick 
look at it, but from what I saw it uses a lot of preprocessor 
macros which will make it difficult to get it wotk work 
properly with D). Why not use the built-in unittests or one of 
the many already existing unit testing frameworks for D ([1], 
[2], [3], [4], [5])?


[1] https://code.dlang.org/packages/unit-threaded
[2] https://code.dlang.org/packages/dunit
[3] https://code.dlang.org/packages/d-unit
[4] https://code.dlang.org/packages/fluent-asserts
[5] https://code.dlang.org/packages/trial


I am trying to do two things one being able to turn a pure C 
project into a pure D project without destroying the existing 
file structure.

The project (https://github.com/squidfarts/c-project.git)

The other is to make a new Arduino UNO board project that 
leverages existing C and C++ code so I can spend small amounts of 
time writing new D code as I update all of my Arduino 
applications.


I would like to use the Unity test framework for that Arduino UNO 
based project that uses D, C, C++ and both Meson build system and 
Conan package manager.  The part with C and C++ are just for 
linking with the Arduino libraries, including exiting classes 
while I write new D code to replace the existing C and C++ code 
where ever it makes since.  Conan is used to get both the Unity 
and CMock from GitHub.


For the pure D project I would like to use whatever D provides 
me.  Since you provided this list I would start with 
unit-threaded and see if it can help with this main function 
problem.


Re: Meson build system user learning D.

2019-05-19 Thread Johannes Loher via Digitalmars-d-learn
Am 18.05.19 um 08:20 schrieb Mike Brockus:
> Hello there this is your hometown Meson build system user here just
> happen to have a
> question related to unit testing in D.
> 
> So is there a way to run the unit-test in the test main as a costume
> test runner in
> "test/test.d", and run the executable program in "src/main.d", with this
> resulting in two
> executable binaries one for test and one for the program?
> 
> I was considering using Unity test framework so I would know that if I
> was running the test runner that it was definitely the custom test
> runner returning the value of all test cases ran and not a mistake of
> running the main executable program.  But I am not sure if that would
> insulate the D programming community by not using the provided unit
> testing functionality in D.
> 
> I am mostly trying to make a version based on an existing C template but
> with D language
> syntax using whatever tools D provides along side Meson build system.  I
> would give you
> the link(s) but I haven't figured out how to add links here on the D
> forum, and I just
> registered.
> 
> Thanks...

Hey there,

I already tried to answer your questions on reddit.

You can post links here by simply pasting the URL (the link will not be
highlighted in the editor, but it will be when it is posted).

Regarding your problem: Could you please describe what you are actually
trying to do? Are you trying to use D in an exisiting Meson project (as
an addition to the existing code)? Why are you trying to use the Unity
test framework (I only had a quick look at it, but from what I saw it
uses a lot of preprocessor macros which will make it difficult to get it
wotk work properly with D). Why not use the built-in unittests or one of
the many already existing unit testing frameworks for D ([1], [2], [3],
[4], [5])?

[1] https://code.dlang.org/packages/unit-threaded
[2] https://code.dlang.org/packages/dunit
[3] https://code.dlang.org/packages/d-unit
[4] https://code.dlang.org/packages/fluent-asserts
[5] https://code.dlang.org/packages/trial


Meson build system user learning D.

2019-05-17 Thread Mike Brockus via Digitalmars-d-learn
Hello there this is your hometown Meson build system user here 
just happen to have a

question related to unit testing in D.

So is there a way to run the unit-test in the test main as a 
costume test runner in
"test/test.d", and run the executable program in "src/main.d", 
with this resulting in two

executable binaries one for test and one for the program?

I was considering using Unity test framework so I would know that 
if I was running the test runner that it was definitely the 
custom test runner returning the value of all test cases ran and 
not a mistake of running the main executable program.  But I am 
not sure if that would insulate the D programming community by 
not using the provided unit testing functionality in D.


I am mostly trying to make a version based on an existing C 
template but with D language
syntax using whatever tools D provides along side Meson build 
system.  I would give you
the link(s) but I haven't figured out how to add links here on 
the D forum, and I just

registered.

Thanks...


Re: Learning D - modules packages and the package.d

2018-04-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, April 04, 2018 04:54:50 Ali via Digitalmars-d-learn wrote:
> I am going through the Learning D book by Michael Parker
> So every now and then I will make post about the book
> either critics of the book, book content or questions
>
>
> First critic
> chapter 2 - the special package module
>
> this small section, suggest an idiom to create a package which
> can have any name
> the book suggest somepack
> and inside it add a module package.d , so you will end up
> somepack/package.d
> inside the file add
>
> > module somepack; //notice this named after the folder
> > //then public import std.stdio, somepack.one, somepack.two;
> > //etc
>
> at first i though package.d is special name, as in i must call
> the file package.d or this trick or idiom to work
> also it felt weird that the module name, is named after the
> folder name, which previously was referred to as the package name
>
> anyway, i started playing with this, and renaming everything
> and my conclusion is
>
> i not really sure, if D really support or have packages
> as in D is aware that some modules are together in a package
>
> it seems to me at this time D only support modules
> modules can have names with . in them
> you can use the . in module names to make it seem as if its
> packages
>
> > import io = long.module.name
>
> also seem as a trick that complements having modules with long
> names with dots in them
>
> and it seems you really need to match file and module names
>
> my critic of the chapter 2 so far, the book doesn't really help
> clarify this situation
> i am relieved though to learn that D doesnt treat special
> file/module names as special

In general, modules correspond to files, and packages correspond to folders.
That can be played with by naming modules with names that don't match their
file names, but it tends to cause problems with build tools. In general,
modules and packages should match their corresponding file and folder names
if you don't want problems.

package.d is a special case. package is not a legal module name, so when the
package.d feature was added to the language, the odds of it conflicting with
any existing files were very low. What happens with package.d is that when
you try to import a package rather than a module, the compiled looks for a
package.d file within the package that you're trying to import, and it
imports that module. The typical thing to do is to have the module name
within that module match the package name. I don't know what happens if you
try to do otherwise, but I wouldn't expect it to work, because in this case,
the compiler is specifically looking for package.d and not the module with
with matching module declaration. _That_ is all that's special about
package.d - it's what's imported you try to import a package.

Now, if there is a package.d, it's typically the case that it has public
import statements for the modules inside the package so that importing the
package will then import all of the modules within the package, but what
actually gets imported when importing the package is entirely dependent on
what's in package.d. It can define symbols of its own, and it doesn't _have_
to publicly import anything. And since public imports can be used in any
module, there's nothing really special about them in package.d. It's just
that using them in package.d makes it possible to have it be the case that
importing a package imports all of the modules within that package.

The entire reason that the package.d feature was added to the language was
so that a module could be broken up into multiple modules within a package
with the same name without breaking code in the process - e.g.
std.algorithm, std.container, std.datetime, and std.range were all
originally modules, but now, they're all packages. Personally, I don't think
that it's great practice to use package.d if you don't have to (and
importing that many symbols at once can negatively impact compilation
times), but some folks like to use it for their libraries so that you can
import everything at once.

- Jonathan M Davis



Re: Learning D - modules packages and the package.d

2018-04-03 Thread Ali via Digitalmars-d-learn

On Wednesday, 4 April 2018 at 04:54:50 UTC, Ali wrote:
at first i though package.d is special name, as in i must call 
the file package.d or this trick or idiom to work


the trick was to have one module that public import all the 
modules you import as group in other modules


so instead of importing a dozen or so modules, you only import 
one module that imports everything you need


Learning D - modules packages and the package.d

2018-04-03 Thread Ali via Digitalmars-d-learn

I am going through the Learning D book by Michael Parker
So every now and then I will make post about the book
either critics of the book, book content or questions


First critic
chapter 2 - the special package module

this small section, suggest an idiom to create a package which 
can have any name

the book suggest somepack
and inside it add a module package.d , so you will end up 
somepack/package.d

inside the file add


module somepack; //notice this named after the folder
//then public import std.stdio, somepack.one, somepack.two; 
//etc


at first i though package.d is special name, as in i must call 
the file package.d or this trick or idiom to work
also it felt weird that the module name, is named after the 
folder name, which previously was referred to as the package name


anyway, i started playing with this, and renaming everything
and my conclusion is

i not really sure, if D really support or have packages
as in D is aware that some modules are together in a package

it seems to me at this time D only support modules
modules can have names with . in them
you can use the . in module names to make it seem as if its 
packages



import io = long.module.name


also seem as a trick that complements having modules with long 
names with dots in them


and it seems you really need to match file and module names

my critic of the chapter 2 so far, the book doesn't really help 
clarify this situation
i am relieved though to learn that D doesnt treat special 
file/module names as special


Re: The first example in the Learning D book, wont compile

2018-03-26 Thread Graham Fawcett via Digitalmars-d-learn

On Sunday, 25 March 2018 at 21:02:26 UTC, Ali wrote:

On Sunday, 25 March 2018 at 20:52:29 UTC, Ali wrote:

On Sunday, 25 March 2018 at 20:45:58 UTC, Ali wrote:
I now see my typo, should be retro, not range


We need better IDEs, this would have been easily highlighted by 
a good ide


I pasted your code into Spacemacs, and it highlighted the error 
immediately. What editor are you using?


Graham



Re: The first example in the Learning D book, wont compile

2018-03-25 Thread Ali via Digitalmars-d-learn

On Sunday, 25 March 2018 at 20:52:29 UTC, Ali wrote:

On Sunday, 25 March 2018 at 20:45:58 UTC, Ali wrote:
I now see my typo, should be retro, not range


We need better IDEs, this would have been easily highlighted by a 
good ide


Re: The first example in the Learning D book, wont compile

2018-03-25 Thread Seb via Digitalmars-d-learn

On Sunday, 25 March 2018 at 20:45:58 UTC, Ali wrote:

Hi

The first example in the Learning D book

import core.thread;
import std.stdio;

void main() {
import std.range: iota, range;
write("Greeting in, ");
foreach(num; iota(1, 4).range) {
writef("%s...", num);
stdout.flush();
Thread.sleep(1.seconds);
}
writeln();
writeln("Hello, World");
}


wont compile and give this error

hello.d(5): Error: module `std.range` import range not found

this should be an easy issue to fix, except that googling this 
error doesnt return anything useful


The problem is `std.range : range` - range is not a symbol of 
std.range:


---
import core.thread;
import std.stdio;

void main() {
import std.range: iota;
write("Greeting in, ");
foreach(num; iota(1, 4)) {
writef("%s...", num);
stdout.flush();
Thread.sleep(1.seconds);
}
writeln();
writeln("Hello, World");
}
---

https://run.dlang.io/is/p9rFrS


Re: The first example in the Learning D book, wont compile

2018-03-25 Thread Ali via Digitalmars-d-learn

On Sunday, 25 March 2018 at 20:45:58 UTC, Ali wrote:

Hi

The first example in the Learning D book

import core.thread;
import std.stdio;

void main() {
import std.range: iota, range;
write("Greeting in, ");
foreach(num; iota(1, 4).range) {
writef("%s...", num);
stdout.flush();
Thread.sleep(1.seconds);
}
writeln();
writeln("Hello, World");
}


wont compile and give this error

hello.d(5): Error: module `std.range` import range not found

this should be an easy issue to fix, except that googling this 
error doesnt return anything useful



I now see my typo, should be retro, not range




The first example in the Learning D book, wont compile

2018-03-25 Thread Ali via Digitalmars-d-learn

Hi

The first example in the Learning D book

import core.thread;
import std.stdio;

void main() {
import std.range: iota, range;
write("Greeting in, ");
foreach(num; iota(1, 4).range) {
writef("%s...", num);
stdout.flush();
Thread.sleep(1.seconds);
}
writeln();
writeln("Hello, World");
}


wont compile and give this error

hello.d(5): Error: module `std.range` import range not found

this should be an easy issue to fix, except that googling this 
error doesnt return anything useful


Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-05 Thread Chris via Digitalmars-d-learn

On Tuesday, 2 December 2014 at 21:10:33 UTC, Meta wrote:
On Tuesday, 2 December 2014 at 16:38:34 UTC, Mayuresh Kathe 
wrote:
While I have been a programmer for close to 23 years, it's 
been mostly API level code cobbling work.


Would like to learn "D", but am a bit intimidated by the fact 
that I don't have much of a grasp over the foundational stuff 
(discrete mathematics, machine organization, etc.) and hence 
am preparing for the same.


Would like to know if there be anything else I should work 
through before approaching "D" via Mr. Alexandrescu's book.


Thanks.


An interesting thing about D (that C++ shares to a degree) is 
that it is sufficiently high level that you can write programs 
while knowing nothing about the underlying machine. At the same 
time (again, like C++) it is sufficiently low level that you 
have full access to the machine's capabilities if you want to 
use them. If you want to write an operating system in D, you 
will need to know about machine organization. If you are 
writing a command-line utility to process text, you don't need 
to know or care about the specifics of the underlying hardware.


And don't forget - and I'll say this again and again - the 
modeling power of D. Machines are only as intelligent as we make 
them (not talking about Terminator or The Matrix here!) and D is 
a good tool to make a machine work like reality.


Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-05 Thread Mengu via Digitalmars-d-learn
On Wednesday, 3 December 2014 at 02:41:16 UTC, Shriramana Sharma 
via Digitalmars-d-learn wrote:

On Tue, Dec 2, 2014 at 10:45 PM, Mayuresh Kathe via
Digitalmars-d-learn  wrote:
Okay, if that is the case, I'll dive into Mr. Alexandrescu's 
book as soon as

I get my copy.
BTW, how come all of you address him as Andrei?


Heh -- possibly you haven't interacted on international 
technical
mailing lists like this. For us (you and me) in India we are 
used to
employ/expect such honorifics, and in fact it would be 
considered
somewhat disrespectful if we didn't, but in my early days 
interacting

with people from "western" countries on the net, I was actually
discouraged from using "Mr" because it made people feel "old"! 
:-)


FWIW while we're talking honorifics, he's *Dr* Alexandrescu as 
in Ph D

doc. :-) [I'm one too, but you won't find me having mentioned it
anywhere earlier! :-) That's informal.]

Re Andrei's book versus Ali's, the latter is a more starting 
from the

basics approach whereas Andrei's book is more targeted at people
coming from other languages. (This is a judgment I read 
somewhere --

perhaps on this forum? -- and which I agree with, sorta.)


yes, you are totally right. Ali's book is aiming at teaching D 
language to complete beginners where Andrei's book is aiming at 
teaching D language to people who are already programmers.


Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Shriramana Sharma via Digitalmars-d-learn
On Tue, Dec 2, 2014 at 10:45 PM, Mayuresh Kathe via
Digitalmars-d-learn  wrote:
> Okay, if that is the case, I'll dive into Mr. Alexandrescu's book as soon as
> I get my copy.
> BTW, how come all of you address him as Andrei?

Heh -- possibly you haven't interacted on international technical
mailing lists like this. For us (you and me) in India we are used to
employ/expect such honorifics, and in fact it would be considered
somewhat disrespectful if we didn't, but in my early days interacting
with people from "western" countries on the net, I was actually
discouraged from using "Mr" because it made people feel "old"! :-)

FWIW while we're talking honorifics, he's *Dr* Alexandrescu as in Ph D
doc. :-) [I'm one too, but you won't find me having mentioned it
anywhere earlier! :-) That's informal.]

Re Andrei's book versus Ali's, the latter is a more starting from the
basics approach whereas Andrei's book is more targeted at people
coming from other languages. (This is a judgment I read somewhere --
perhaps on this forum? -- and which I agree with, sorta.)

-- 
Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा



Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Meta via Digitalmars-d-learn

On Tuesday, 2 December 2014 at 16:38:34 UTC, Mayuresh Kathe wrote:
While I have been a programmer for close to 23 years, it's been 
mostly API level code cobbling work.


Would like to learn "D", but am a bit intimidated by the fact 
that I don't have much of a grasp over the foundational stuff 
(discrete mathematics, machine organization, etc.) and hence am 
preparing for the same.


Would like to know if there be anything else I should work 
through before approaching "D" via Mr. Alexandrescu's book.


Thanks.


An interesting thing about D (that C++ shares to a degree) is 
that it is sufficiently high level that you can write programs 
while knowing nothing about the underlying machine. At the same 
time (again, like C++) it is sufficiently low level that you have 
full access to the machine's capabilities if you want to use 
them. If you want to write an operating system in D, you will 
need to know about machine organization. If you are writing a 
command-line utility to process text, you don't need to know or 
care about the specifics of the underlying hardware.


Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Ali Çehreli via Digitalmars-d-learn

On 12/02/2014 09:15 AM, Mayuresh Kathe wrote:

> BTW, how come all of you address him as Andrei?
> Is this group that informal?

First name is the normal way of referring to colleagues here in the US, 
at least in Silicon Valley. Even the CEOs, board members, and all the 
other "top" people are referred to by their first names, even in person.


Ali



Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Dec 02, 2014 at 05:46:04PM +, Mayuresh Kathe via 
Digitalmars-d-learn wrote:
> On Tuesday, 2 December 2014 at 17:33:18 UTC, Gary Willoughby wrote:
> >On Tuesday, 2 December 2014 at 17:15:28 UTC, Mayuresh Kathe wrote:
> >>Okay, if that is the case, I'll dive into Mr. Alexandrescu's book as
> >>soon as I get my copy.
> >
> >No need to wait that long. I second H.S. Teoh's suggestion to
> >recommend reading this book too:
> >
> >http://ddili.org/ders/d.en/intro.html
> >
> >It's free, downloadable and right up to date.
> 
> Yes, prima-facie it definitely looks good.
> Will start off with it while I await delivery of Andrei's book to my
> location.

Keep in mind that there's an errata for Andrei's book:

http://erdani.com/tdpl/errata/


T

-- 
Life would be easier if I had the source code. -- YHL


Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Mayuresh Kathe via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 17:33:18 UTC, Gary Willoughby 
wrote:
On Tuesday, 2 December 2014 at 17:15:28 UTC, Mayuresh Kathe 
wrote:
Okay, if that is the case, I'll dive into Mr. Alexandrescu's 
book as soon as I get my copy.


No need to wait that long. I second H.S. Teoh's suggestion to 
recommend reading this book too:


http://ddili.org/ders/d.en/intro.html

It's free, downloadable and right up to date.


Yes, prima-facie it definitely looks good.
Will start off with it while I await delivery of Andrei's book to 
my location.


Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Gary Willoughby via Digitalmars-d-learn

On Tuesday, 2 December 2014 at 17:15:28 UTC, Mayuresh Kathe wrote:
Okay, if that is the case, I'll dive into Mr. Alexandrescu's 
book as soon as I get my copy.


No need to wait that long. I second H.S. Teoh's suggestion to 
recommend reading this book too:


http://ddili.org/ders/d.en/intro.html

It's free, downloadable and right up to date.


Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Mayuresh Kathe via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 17:10:57 UTC, Tobias Pankrath 
wrote:

Thanks for the welcome. :)

I think I'll just work through Discrete Mathematics and 
Machine Organization before approaching Mr. Alexandrescu's 
book, would take up only 6 ~ 8 months of my time, and would be 
really good for me in the long term.


No! If you know how to program and want to learn D, start 
reading Andrei's book now. Any discrete math class is only a 
distraction. Read up on discrete math in parallel or if the 
need arises.


Okay, if that is the case, I'll dive into Mr. Alexandrescu's book 
as soon as I get my copy.


BTW, how come all of you address him as Andrei?
Is this group that informal?
Asking, just so that I don't become the odd man. :)


Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread John Colvin via Digitalmars-d-learn

On Tuesday, 2 December 2014 at 17:15:28 UTC, Mayuresh Kathe wrote:

BTW, how come all of you address him as Andrei?
Is this group that informal?
Asking, just so that I don't become the odd man. :)


This group is definitely that informal. First names are the norm 
here.


Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread CraigDillabaugh via Digitalmars-d-learn

On Tuesday, 2 December 2014 at 17:04:57 UTC, Mayuresh Kathe wrote:
On Tuesday, 2 December 2014 at 16:54:50 UTC, CraigDillabaugh 
wrote:
On Tuesday, 2 December 2014 at 16:38:34 UTC, Mayuresh Kathe 
wrote:

clip


Thanks for the welcome. :)

I think I'll just work through Discrete Mathematics and Machine 
Organization before approaching Mr. Alexandrescu's book, would 
take up only 6 ~ 8 months of my time, and would be really good 
for me in the long term.


I certainly wouldn't discourage from studying Discrete Mathematics
or Machine Organization, as they are very helpful, but they
are by no means per-requisites for Andrei's book - or D for that
matter.

Anyway, whatever course you decide to follow - have fun. S


Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Tobias Pankrath via Digitalmars-d-learn

Thanks for the welcome. :)

I think I'll just work through Discrete Mathematics and Machine 
Organization before approaching Mr. Alexandrescu's book, would 
take up only 6 ~ 8 months of my time, and would be really good 
for me in the long term.


No! If you know how to program and want to learn D, start reading 
Andrei's book now. Any discrete math class is only a distraction. 
Read up on discrete math in parallel or if the need arises.




Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Mayuresh Kathe via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 16:54:50 UTC, CraigDillabaugh 
wrote:
On Tuesday, 2 December 2014 at 16:38:34 UTC, Mayuresh Kathe 
wrote:
While I have been a programmer for close to 23 years, it's 
been mostly API level code cobbling work.


Would like to learn "D", but am a bit intimidated by the fact 
that I don't have much of a grasp over the foundational stuff 
(discrete mathematics, machine organization, etc.) and hence 
am preparing for the same.


Would like to know if there be anything else I should work 
through before approaching "D" via Mr. Alexandrescu's book.


Thanks.


If you have been programming for 23 years there is absolutely 
no reason why you should struggle with D due to your lack of 
discrete math, machine organization knowledge, etc.  You 
certainly shouldn't have any trouble following Andrei's book, 
which is very easy to follow, although having some discrete 
math is helpful in keeping up with some of his forum posts :o)


Welcome to the D world!


Thanks for the welcome. :)

I think I'll just work through Discrete Mathematics and Machine 
Organization before approaching Mr. Alexandrescu's book, would 
take up only 6 ~ 8 months of my time, and would be really good 
for me in the long term.


Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread CraigDillabaugh via Digitalmars-d-learn

On Tuesday, 2 December 2014 at 16:38:34 UTC, Mayuresh Kathe wrote:
While I have been a programmer for close to 23 years, it's been 
mostly API level code cobbling work.


Would like to learn "D", but am a bit intimidated by the fact 
that I don't have much of a grasp over the foundational stuff 
(discrete mathematics, machine organization, etc.) and hence am 
preparing for the same.


Would like to know if there be anything else I should work 
through before approaching "D" via Mr. Alexandrescu's book.


Thanks.


If you have been programming for 23 years there is absolutely no 
reason why you should struggle with D due to your lack of 
discrete math, machine organization knowledge, etc.  You 
certainly shouldn't have any trouble following Andrei's book, 
which is very easy to follow, although having some discrete math 
is helpful in keeping up with some of his forum posts :o)


Welcome to the D world!



Re: Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Dec 02, 2014 at 04:38:33PM +, Mayuresh Kathe via 
Digitalmars-d-learn wrote:
> While I have been a programmer for close to 23 years, it's been mostly
> API level code cobbling work.
> 
> Would like to learn "D", but am a bit intimidated by the fact that I
> don't have much of a grasp over the foundational stuff (discrete
> mathematics, machine organization, etc.) and hence am preparing for
> the same.
> 
> Would like to know if there be anything else I should work through
> before approaching "D" via Mr. Alexandrescu's book.
[...]

Ali Cehreli's D book is another excellent resource:

http://ddili.org/ders/d.en/intro.html


--T


Learning D for a non computer science background person : pre-requisite knowledge?

2014-12-02 Thread Mayuresh Kathe via Digitalmars-d-learn
While I have been a programmer for close to 23 years, it's been 
mostly API level code cobbling work.


Would like to learn "D", but am a bit intimidated by the fact 
that I don't have much of a grasp over the foundational stuff 
(discrete mathematics, machine organization, etc.) and hence am 
preparing for the same.


Would like to know if there be anything else I should work 
through before approaching "D" via Mr. Alexandrescu's book.


Thanks.


Re: Learning D the GTK+ way [was Learning D]

2014-08-28 Thread Russel Winder via Digitalmars-d-learn
On Wed, 2014-08-27 at 13:25 +, Ryan via Digitalmars-d-learn wrote:
[…]
> I'm thinking I will probably create a more in depth GTK+ hello 
> world that attempts to covers some of the current D landscape.  

Exactly what I am doing :-)

> For instance I now understand how DMD and RDMD work and how they 
> are different from one another. But I do not yet understand how 
> to use DUB, or why I would choose it over one of the many other 
> build systems such as CMakeD2, DSSS, XfBuild, Bud, RDMD, or 
> premake4.  Especially DSSS vs DUB. Is DUB a replacement for DSSS?

Don't forget SCons, which has built in support for D as a first class
language, peer with C, C++ and Fortran.

Dub is shaping up to be the One True Build system for D. Hopefully it
also build C and C++, I haven't tried that.

[…]
> 
> Next on my list is to attempt to create a Glade hello world in D.

Ensure you use GTK+ 3 widgets. The new GTK+ idiom is to use an
Application instance and an ApplicationWindow for the top-level window.
All windows should probably use HeaderBars rather than having menus.

[…]

-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


signature.asc
Description: This is a digitally signed message part


Re: Learning D

2014-08-27 Thread Mike Parker via Digitalmars-d-learn

On 8/27/2014 10:25 PM, Ryan wrote:




DSSS, XfBuild, Bud, RDMD, or premake4.  Especially DSSS vs DUB. Is DUB a
replacement for DSSS?


You can look at it that way. It's both a package manager and build tool. 
DSSS was abandoned long ago. Why not other tools -- XfBuild is no longer 
maintained (AFAIK); Bud is long, long dead; RDMD is a build tool, but 
not a package manager. D support in existing C/C++ has been spotty in 
the past, though they may be up to date now -- but again, those are 
build tools and not package managers. The community has standardized 
around dub. You don't have to use it if you don't want to, but it will 
make your life easier if you do. In will eventually be bundled with DMD 
and will be the defacto build tool and package manager.




I also don't understand why there are multiple code repositories and
where to find what (http://code.dlang.org vs
http://www.dsource.org/projects/).  I understand that Open Source is
decentralized, but when you're talking about a relatively small user
group like D it seems very confusing.


code.dlang.org is not a code repository, but a package registry. The 
code for each project is hosted either at github or BitBucket. The 
registry is where dub looks to find the dependencies you list in your 
dub.json file. If the package is listed in the registry, it will then 
follow the registered link to pull the source from github or BitBucket. 
You don't need to look there yourself unless you want to see what has 
been registered and what has been recently updated. You can also create 
your own locations for dub to search for packages, including locally. 
code.dlang.org is the default.


dsource.org is dead, dead, dead. The guy with the keys no longer 
maintains it. Look through the newsgroup archives here and you can find 
a couple of recent discussions about it. Most (all?) of the projects 
that are still active have moved on github or BitBucket long ago. The 
rest are abandoned.




Last, I've been in the Java/C# world so long that I don't understand why
I need to provide the source code to statically link a *.lib file.  I
started exploring dynamic link libraries, and this too seems very
confusing to me.  Perhaps there is a better way to do this?  Perhaps I
just don't understand it well enough yet?


You don't need the source of a library to link with it, but to compile 
any modules that use it. During the compile step, the compiler needs to 
know which symbols are available and visible to the modules it is 
compiling, much like a C compiler needs the headers. This isn't 
necessary in a language like Java as all the information the compiler 
needs is available in the bytecode of the class files. The object file 
formats used by C/C++/D do not contain that information.


You can also use a stripped down version of the source, a .di file, 
which functions like a C header. These can be created manually or by 
passing the -H option to DMD (I'm unfamiliar with LDC or GDC options) 
during compilation.





Next on my list is to attempt to create a Glade hello world in D.

Can I host a tutorial here on dlang.org?  If so does it belong under
"How-tos" or "Articles"?







---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com



Re: Learning D

2014-08-27 Thread Ryan via Digitalmars-d-learn
Thanks again for all the responses.  I've made tremendous 
progress understanding the D build process.


I'm thinking I will probably create a more in depth GTK+ hello 
world that attempts to covers some of the current D landscape.  
For instance I now understand how DMD and RDMD work and how they 
are different from one another. But I do not yet understand how 
to use DUB, or why I would choose it over one of the many other 
build systems such as CMakeD2, DSSS, XfBuild, Bud, RDMD, or 
premake4.  Especially DSSS vs DUB. Is DUB a replacement for DSSS?


I also don't understand why there are multiple code repositories 
and where to find what (http://code.dlang.org vs 
http://www.dsource.org/projects/).  I understand that Open Source 
is decentralized, but when you're talking about a relatively 
small user group like D it seems very confusing.


Last, I've been in the Java/C# world so long that I don't 
understand why I need to provide the source code to statically 
link a *.lib file.  I started exploring dynamic link libraries, 
and this too seems very confusing to me.  Perhaps there is a 
better way to do this?  Perhaps I just don't understand it well 
enough yet?


Next on my list is to attempt to create a Glade hello world in D.

Can I host a tutorial here on dlang.org?  If so does it belong 
under "How-tos" or "Articles"?







Re: Learning D

2014-08-26 Thread HeiHon via Digitalmars-d-learn

On Monday, 25 August 2014 at 16:46:11 UTC, Ryan wrote:
What IDE should I use? I'm not big fan of Eclipse, although if 
I had to use it this wouldn't be a dealbreaker.  Give me 
something easy and lightweight, unless you've got a GUI builder 
(this is why I started with MonoDevelop, though this isn't 
working so well for me).


If you can do without all bells and whistles of a fullblown IDE, 
you can try geany. I really like it and do all my D (and 
python/shell/perl) work with geany.


http://www.geany.org/

You just install dmd (or gdc or ldc) and add it to your PATH.
You download and install geany.
You configure the build/compile settings for geany eg:
rdmd --build-only --force -debug "%f"

And there you go.

Geany is available for Windows and Linux.


Re: Learning D

2014-08-26 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-08-25 at 16:46 +, Ryan via Digitalmars-d-learn wrote:
[…]
> What Widget library should I use?  I started with GTKD, but since 
> there are no tutorials does this mean nobody actually does this?  
> Should I use DWT?  What about QT?

GtkD should work for you. I would have preferred Qt for portability but
QtD doesn't work for me, I actually want to use QML, and GtkD just
worked.

I didn't bother with an IDE to start with just used Emacs and a Shell,
though I am sure VIM would do as well, Sublime Text or even Notepad
++ :-)

I created a directory with a source directory added the D source in it
and then edited a Dub specification file, ran dub and it all just
compiled to a working executable.

-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


signature.asc
Description: This is a digitally signed message part


Re: Learning D

2014-08-26 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-08-25 at 18:09 +, Kiith-Sa via Digitalmars-d-learn
wrote:
[…]
> I have no experience with GtkD, but with DUB you shouldn't need 
> to mess with .lib files at all. DUB automatically downloads and 
> compiles any libraries specified with dub.json, *and* links them 
> with the compiled project.
> 
> (still, it'd be better if someone with GtkD/MonoD experience 
> could clarify)

Dub happily downloads the GtkD source and builds the library, and then
builds the application. I am happy to report that creating a working
GtkD program with Dub was straightforward, It Just Worked™
-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


signature.asc
Description: This is a digitally signed message part


Re: Learning D

2014-08-26 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-08-25 at 17:09 +, Kiith-Sa via Digitalmars-d-learn
wrote:
[…]
> I don't use an IDE, but MonoD seems to be the most recommended 
> cross-platform option. It has a wiki page here if it helps: 
> http://wiki.dlang.org/Mono-D

I just tried following the instructions at http://wiki.dlang.org/Mono-D
and for Debian Sid, it doesn't work, I cannot get a MonoD install.

Yes, Debian only has MonoDevelop 4, I downloaded MonoDevelop 5.4 from
the site http://simendsjo.me/files/abothe/

-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


signature.asc
Description: This is a digitally signed message part


Re: Learning D

2014-08-26 Thread Mike Parker via Digitalmars-d-learn

On 8/26/2014 5:37 AM, Ryan wrote:


Then I thought I'd learn dub.  Well, this is NOT going well... I did a
git clone of gtk-d, then tried to build with dub (renamed the
package.json to dub.json), and it told me "Conflicting package
multi-reference" I have no clue and I've tried removing package
references


Any libraries you want to use that are registered in the dub registry[1] 
(which gtk-d is) should be added to your project's dub.json as 
dependencies (see [2] for an example of using gtk-d). This will cause 
dub to download and compile the libraries for you. You never have to 
pull any of them down or compile them yourself.




I tried "dub remove gtk-d --version=*" but it just lists out excuses why
it can't work... "no retrieval journal found for...", "Untracked file
found"



This command will only remove libraries that dub is managing, not 
anything you have downloaded outside of dub and compiled directly.




So then I try every variation of "dub remove-local" and "dub
remove-path" I can think of.



remove-local is the inverse of add-local, which you might use when you 
want to test a dub-enabled library that hasn't yet been added to the 
registry (such as a new but unreleased version of a registered library, 
or a library you are developing locally but haven't yet released). 
add-local tells dub to look on the local filesystem rather than through 
the dub registry for the library.


I haven't looked at add-/remove-path yet, so no comment on those.

[1] http://code.dlang.org/
[2] http://code.dlang.org/packages/gtk-d


---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com



Re: Learning D

2014-08-26 Thread eles via Digitalmars-d-learn

On Monday, 25 August 2014 at 16:46:11 UTC, Ryan wrote:

Me: Software developer for 30 years.




What IDE should I use? I'm not big fan of Eclipse, although if


If you are an Eclipse (CDT) user for C/C++, then you will find a 
very similar plugin for D, called DDT, here:


http://code.google.com/p/ddt/


Re: Learning D

2014-08-25 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Aug 26, 2014 at 02:13:04AM +, Weaseldog via Digitalmars-d-learn 
wrote:
> Not sure how up your alley this is, but vim support for D is
> excellent.

I use vim for D.


T

-- 
War doesn't prove who's right, just who's left. -- BSD Games' Fortune


Re: Learning D

2014-08-25 Thread Weaseldog via Digitalmars-d-learn
Not sure how up your alley this is, but vim support for D is 
excellent.


Re: Learning D

2014-08-25 Thread Dicebot via Digitalmars-d-learn

On Monday, 25 August 2014 at 20:37:16 UTC, Ryan wrote:
Then I thought I'd learn dub.  Well, this is NOT going well... 
I did a git clone of gtk-d, then tried to build with dub 
(renamed the package.json to dub.json), and it told me 
"Conflicting package multi-reference" I have no clue and 
I've tried removing package references


I tried "dub remove gtk-d --version=*" but it just lists out 
excuses why it can't work... "no retrieval journal found 
for...", "Untracked file found"


Why you try removing from dub something you have manually cloned? 
It is not even aware of local gtk-d copy if you just cloned with 
registering local path.


Expected approach is to create a new dub project and add gtk-d to 
dependencies - rest is up to how well-maintained gtk-d itself is.


Re: Learning D

2014-08-25 Thread Ryan via Digitalmars-d-learn

On Monday, 25 August 2014 at 18:12:25 UTC, Colin wrote:

On Monday, 25 August 2014 at 17:57:54 UTC, Ryan wrote:

Anyone know MonoDevelop?

Why is the "Edit References" context menu item missing.  I 
have it at the top (Project->Edit References...) but when I 
click it nothing happens. Grrr.


I couldnt figure it out either tbh (creating dub projects using 
MonoD)


I just fire up a command line, go to my workspace folder, and do
dub init 

Then, in monoD, File -> Open -> C:\Path\To\Project\dub.json

Then your good to go regarding MonoD.



Yeah, I gave up on MonoD to try and figure out what is going on 
behind the scenes by compiling with text files... I had a little 
success compiling, followed by a failure to run because I don't 
have the right version of GTK+ on my system...


Then I thought I'd learn dub.  Well, this is NOT going well... I 
did a git clone of gtk-d, then tried to build with dub (renamed 
the package.json to dub.json), and it told me "Conflicting 
package multi-reference" I have no clue and I've tried 
removing package references


I tried "dub remove gtk-d --version=*" but it just lists out 
excuses why it can't work... "no retrieval journal found for...", 
"Untracked file found"


So then I try every variation of "dub remove-local" and "dub 
remove-path" I can think of.


I give up.  Why not just have a "dub 
-IFuckedUpSoLetsStartOverCleanSlated" option?








Re: Learning D

2014-08-25 Thread Colin via Digitalmars-d-learn

On Monday, 25 August 2014 at 17:57:54 UTC, Ryan wrote:

Anyone know MonoDevelop?

Why is the "Edit References" context menu item missing.  I have 
it at the top (Project->Edit References...) but when I click it 
nothing happens. Grrr.


I couldnt figure it out either tbh (creating dub projects using 
MonoD)


I just fire up a command line, go to my workspace folder, and do
dub init 

Then, in monoD, File -> Open -> C:\Path\To\Project\dub.json

Then your good to go regarding MonoD.



Re: Learning D

2014-08-25 Thread Kiith-Sa via Digitalmars-d-learn

On Monday, 25 August 2014 at 17:47:47 UTC, Ryan wrote:
Thanks for both responses.  This is the information I was 
looking for.


I have DMD, GTK# (For MonoDevelop), MonoDevelop, MonoD, dubs, 
and GTKD installed.


I've got some things to compile... So the crux of my issue is 
that I can't figure out how to link lib files in MonoDevelop.  
I wonder if there is a problem in the latest version or 
something.


I have no experience with GtkD, but with DUB you shouldn't need 
to mess with .lib files at all. DUB automatically downloads and 
compiles any libraries specified with dub.json, *and* links them 
with the compiled project.


(still, it'd be better if someone with GtkD/MonoD experience 
could clarify)


Re: Learning D

2014-08-25 Thread Ryan via Digitalmars-d-learn

Anyone know MonoDevelop?

Why is the "Edit References" context menu item missing.  I have 
it at the top (Project->Edit References...) but when I click it 
nothing happens. Grrr.




Re: Learning D

2014-08-25 Thread Ryan via Digitalmars-d-learn
Thanks for both responses.  This is the information I was looking 
for.


I have DMD, GTK# (For MonoDevelop), MonoDevelop, MonoD, dubs, and 
GTKD installed.


I've got some things to compile... So the crux of my issue is 
that I can't figure out how to link lib files in MonoDevelop.  I 
wonder if there is a problem in the latest version or something.


Re: Learning D

2014-08-25 Thread Kiith-Sa via Digitalmars-d-learn

On Monday, 25 August 2014 at 16:46:11 UTC, Ryan wrote:

Me: Software developer for 30 years.

So perhaps this is old fashion, but I wanted to start using D 
by whipping together nice little personal utilities.


I tried installing MonoDevelop and Mono-D.  I can't even figure 
out the basics, such as adding references to a project.  There 
are no options in the context menus, and although it looks like 
drag an drop might work (a '+' sign appears by the cursor), 
dropping a file from the filesystem doesn't work either.


Although I dream of someday being able to add a reference to a 
project, I'm not really sure what I might drag in.  I managed 
to download and compile GtkD, since it seems like a GUI would 
be a nice place to start (again, old fashion).  I got three 
*.lib files out of it... H... Maybe these are references??


I had installed the Visual Studio plugin, but I don't want to 
use this since I would like to eventually migrate away from 
Windows.


Let me cut to the chase.  I have no friggin' clue how to start, 
and I can't seem to find a tutorial anywhere...


What IDE should I use? I'm not big fan of Eclipse, although if 
I had to use it this wouldn't be a dealbreaker.  Give me 
something easy and lightweight, unless you've got a GUI builder 
(this is why I started with MonoDevelop, though this isn't 
working so well for me).


What Widget library should I use?  I started with GTKD, but 
since there are no tutorials does this mean nobody actually 
does this?  Should I use DWT?  What about QT?


I just want something simple and mainstream to start learning D 
with.


Any thoughts?


I don't use an IDE, but MonoD seems to be the most recommended 
cross-platform option. It has a wiki page here if it helps: 
http://wiki.dlang.org/Mono-D


I recommend only using an IDE that uses DUB 
(http://code.dlang.org/about), which is becoming the de facto 
standard for building D projects, and is cross-IDE, allowing you 
to move between IDEs and to work with developers using other 
IDEs. MonoD probably uses this, as does DDT(Eclipse). I have no 
idea what interface MonoD or other IDEs offer for DUB, but DUB 
uses a 'dub.json' file where you specify libraries you use and 
their versions. DUB will automatically download the libraries 
when you compile the project. Available DUB packages 
(libraries/apps) are listed at http://code.dlang.org . That is 
probably also the best list of D libs we have at the moment, 
although many projects are not there yet.


Only use DWT if you like Java-style code. QtD is not in usable 
state yet. GtkD should be good, better for 'big' apps (i.e. more 
features), TkD for simple ones (simpler to use).



To learn about the language itself, this (free) book is really 
good:

http://ddili.org/ders/d.en/index.html


Re: Learning D

2014-08-25 Thread John Colvin via Digitalmars-d-learn

On Monday, 25 August 2014 at 16:46:11 UTC, Ryan wrote:

Me: Software developer for 30 years.

So perhaps this is old fashion, but I wanted to start using D 
by whipping together nice little personal utilities.


I tried installing MonoDevelop and Mono-D.  I can't even figure 
out the basics, such as adding references to a project.  There 
are no options in the context menus, and although it looks like 
drag an drop might work (a '+' sign appears by the cursor), 
dropping a file from the filesystem doesn't work either.


Although I dream of someday being able to add a reference to a 
project, I'm not really sure what I might drag in.  I managed 
to download and compile GtkD, since it seems like a GUI would 
be a nice place to start (again, old fashion).  I got three 
*.lib files out of it... H... Maybe these are references??


I had installed the Visual Studio plugin, but I don't want to 
use this since I would like to eventually migrate away from 
Windows.


Let me cut to the chase.  I have no friggin' clue how to start, 
and I can't seem to find a tutorial anywhere...


What IDE should I use? I'm not big fan of Eclipse, although if 
I had to use it this wouldn't be a dealbreaker.  Give me 
something easy and lightweight, unless you've got a GUI builder 
(this is why I started with MonoDevelop, though this isn't 
working so well for me).


What Widget library should I use?  I started with GTKD, but 
since there are no tutorials does this mean nobody actually 
does this?  Should I use DWT?  What about QT?


I just want something simple and mainstream to start learning D 
with.


Any thoughts?


Mono-D + dub (see code.dlang.org) is the easiest way to get 
things working quickly. Mono-D has builtin support for dub.


For learning D, see Ali's book: 
http://ddili.org/ders/d.en/index.html (from scratch) or Andrei's 
"The D Programming Language" (for the more experienced). Adam D. 
Ruppe's "D Cookbook" also has interesting examples of usage.


Learning D

2014-08-25 Thread Ryan via Digitalmars-d-learn

Me: Software developer for 30 years.

So perhaps this is old fashion, but I wanted to start using D by 
whipping together nice little personal utilities.


I tried installing MonoDevelop and Mono-D.  I can't even figure 
out the basics, such as adding references to a project.  There 
are no options in the context menus, and although it looks like 
drag an drop might work (a '+' sign appears by the cursor), 
dropping a file from the filesystem doesn't work either.


Although I dream of someday being able to add a reference to a 
project, I'm not really sure what I might drag in.  I managed to 
download and compile GtkD, since it seems like a GUI would be a 
nice place to start (again, old fashion).  I got three *.lib 
files out of it... H... Maybe these are references??


I had installed the Visual Studio plugin, but I don't want to use 
this since I would like to eventually migrate away from Windows.


Let me cut to the chase.  I have no friggin' clue how to start, 
and I can't seem to find a tutorial anywhere...


What IDE should I use? I'm not big fan of Eclipse, although if I 
had to use it this wouldn't be a dealbreaker.  Give me something 
easy and lightweight, unless you've got a GUI builder (this is 
why I started with MonoDevelop, though this isn't working so well 
for me).


What Widget library should I use?  I started with GTKD, but since 
there are no tutorials does this mean nobody actually does this?  
Should I use DWT?  What about QT?


I just want something simple and mainstream to start learning D 
with.


Any thoughts?



Re: Learning D as main systems programming language

2014-01-10 Thread Dejan Lekic

On Friday, 10 January 2014 at 00:05:35 UTC, Goran Petrevski wrote:
You might want to look into XOmB: 
https://github.com/xomboverlord/xomb


Isn't it written in D1? Not sure about that...


So what if it is written in D1? :) It should not be a big problem 
to "port" it to D2.
Second interesting project that is kinda related to the topic: 
https://bitbucket.org/timosi/minlibd .


More: http://wiki.dlang.org/Other_Dev_Tools


Re: Learning D as main systems programming language

2014-01-09 Thread Goran Petrevski
You might want to look into XOmB: 
https://github.com/xomboverlord/xomb


Isn't it written in D1? Not sure about that...


Re: Learning D as main systems programming language

2014-01-09 Thread qznc
On Wednesday, 8 January 2014 at 23:38:31 UTC, Goran Petrevski 
wrote:
I'm new in the programming, systems programming especially, but 
I want to learn D more as a systems programming language and by 
that I mean avoiding libraries at all. My goal is to write a 
simple operating system totaly in D (using Assembly wherever is 
needed) and by progressing in that project, learning this 
powerfull language as the main systems programming language. 
Any help/advice on this goal will be really 
helpful/appreciated. Thanks in advance.


You might want to look into XOmB: 
https://github.com/xomboverlord/xomb


Re: Learning D as main systems programming language

2014-01-08 Thread Jakob Ovrum
On Thursday, 9 January 2014 at 03:36:30 UTC, Rikki Cattermole 
wrote:
You won't have access to the GC so a lot of language features 
(like slices) are out of the question.


Slices are fine, it's just the slice concatenation operators that 
must be disabled. This is easily accomplished by simply not 
implementing the runtime functions that support them, thus 
causing a linker error if used.


Re: Learning D as main systems programming language

2014-01-08 Thread Adam D. Ruppe
On Thursday, 9 January 2014 at 03:36:30 UTC, Rikki Cattermole 
wrote:
I don't know how easy it would be to get a bootloader to call a 
D kernel although it has been done.


Pretty easy if you use GRUB. You can just compile a regular linux 
program with a linker script and load it right up.


My minimal.zip (a bit of a misnomer as it is more than minimal 
including some experimentation) has some code to run D on bare 
x86 metal

arsdnet.net/dcode/minimal.zip


Re: Learning D as main systems programming language

2014-01-08 Thread Rikki Cattermole
On Wednesday, 8 January 2014 at 23:38:31 UTC, Goran Petrevski 
wrote:
I'm new in the programming, systems programming especially, but 
I want to learn D more as a systems programming language and by 
that I mean avoiding libraries at all. My goal is to write a 
simple operating system totaly in D (using Assembly wherever is 
needed) and by progressing in that project, learning this 
powerfull language as the main systems programming language. 
Any help/advice on this goal will be really 
helpful/appreciated. Thanks in advance.


Based upon what I've read on the forum:
Try and get a minimal druntime first. Doing so will make you 
understand what is required to make it work.
You won't have access to the GC so a lot of language features 
(like slices) are out of the question.


There are some copies of druntime floating about for embedded 
which will probably help you.


I don't know how easy it would be to get a bootloader to call a D 
kernel although it has been done.


Learning D as main systems programming language

2014-01-08 Thread Goran Petrevski
I'm new in the programming, systems programming especially, but I 
want to learn D more as a systems programming language and by 
that I mean avoiding libraries at all. My goal is to write a 
simple operating system totaly in D (using Assembly wherever is 
needed) and by progressing in that project, learning this 
powerfull language as the main systems programming language. Any 
help/advice on this goal will be really helpful/appreciated. 
Thanks in advance.


Re: Learning D - first steps and best practices

2013-10-18 Thread Gary Willoughby
On Sunday, 29 September 2013 at 07:13:26 UTC, Stefan Larsson 
wrote:

Hello,

I have started my journey to learn D after using C/C++ and 
Python for many years. I am studying the book "The 
D-Programming Language" by Andrei Alexandrescu and I have tried 
to search the D-newsgroups for proper advice without success 
and I am humbly seeking enlightenment in the following topics...


When i first started using D i found the two biggest barriers to 
entry were UFCS and D's Template syntax. Luckily i've covered 
both on my blog to give newcomers a quick leg up. Andrei's book 
is great and very thorough but without the two points above being 
explained fully the first half can be confusing.


http://nomad.so/2013/07/templates-in-d-explained/
http://nomad.so/2013/08/alternative-function-syntax-in-d/

These are explained later in the book but examples use them long 
before they are covered.


  1   2   >