www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Learning D

reply "Ryan" <dlang zipxap.com> writes:
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... Hmmmm... 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?
Aug 25 2014
next sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
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... Hmmmm... 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.
Aug 25 2014
prev sibling next sibling parent reply "Kiith-Sa" <kiithsacmp gmail.com> writes:
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... Hmmmm... 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
Aug 25 2014
next sibling parent reply "Ryan" <dlang zipxap.com> writes:
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.
Aug 25 2014
next sibling parent reply "Ryan" <dlang zipxap.com> writes:
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.
Aug 25 2014
parent reply "Colin" <grogan.colin gmail.com> writes:
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 <project name here> Then, in monoD, File -> Open -> C:\Path\To\Project\dub.json Then your good to go regarding MonoD.
Aug 25 2014
parent reply "Ryan" <dlang zipxap.com> writes:
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 <project name here> 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?
Aug 25 2014
next sibling parent "Dicebot" <public dicebot.lv> writes:
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.
Aug 25 2014
prev sibling parent Mike Parker <aldacron gmail.com> writes:
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
Aug 26 2014
prev sibling parent reply "Kiith-Sa" <kiithsacmp gmail.com> writes:
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)
Aug 25 2014
parent Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Mon, 2014-08-25 at 18:09 +0000, Kiith-Sa via Digitalmars-d-learn
wrote:
[=E2=80=A6]
 I have no experience with GtkD, but with DUB you shouldn't need=20
 to mess with .lib files at all. DUB automatically downloads and=20
 compiles any libraries specified with dub.json, *and* links them=20
 with the compiled project.
=20
 (still, it'd be better if someone with GtkD/MonoD experience=20
 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=E2=84=A2 --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Aug 26 2014
prev sibling parent Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Mon, 2014-08-25 at 17:09 +0000, Kiith-Sa via Digitalmars-d-learn
wrote:
[=E2=80=A6]
 I don't use an IDE, but MonoD seems to be the most recommended=20
 cross-platform option. It has a wiki page here if it helps:=20
 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/ --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Aug 26 2014
prev sibling next sibling parent reply "Weaseldog" <weaseldog gmail.com> writes:
Not sure how up your alley this is, but vim support for D is 
excellent.
Aug 25 2014
parent "H. S. Teoh via Digitalmars-d-learn" <digitalmars-d-learn puremagic.com> writes:
On Tue, Aug 26, 2014 at 02:13:04AM +0000, 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
Aug 25 2014
prev sibling next sibling parent "eles" <eles eles.com> writes:
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/
Aug 25 2014
prev sibling next sibling parent Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Mon, 2014-08-25 at 16:46 +0000, Ryan via Digitalmars-d-learn wrote:
[=E2=80=A6]
 What Widget library should I use?  I started with GTKD, but since=20
 there are no tutorials does this mean nobody actually does this? =20
 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. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Aug 26 2014
prev sibling parent reply "HeiHon" <sorry nomail.com> writes:
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.
Aug 26 2014
parent reply "Ryan" <dlang zipxap.com> writes:
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"?
Aug 27 2014
next sibling parent Mike Parker <aldacron gmail.com> writes:
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
Aug 27 2014
prev sibling parent Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Wed, 2014-08-27 at 13:25 +0000, Ryan via Digitalmars-d-learn wrote:
[=E2=80=A6]
 I'm thinking I will probably create a more in depth GTK+ hello=20
 world that attempts to covers some of the current D landscape. =20
Exactly what I am doing :-)
 For instance I now understand how DMD and RDMD work and how they=20
 are different from one another. But I do not yet understand how=20
 to use DUB, or why I would choose it over one of the many other=20
 build systems such as CMakeD2, DSSS, XfBuild, Bud, RDMD, or=20
 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. [=E2=80=A6]
=20
 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. [=E2=80=A6] --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Aug 28 2014