www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - how to install?

reply glen worstell <glen worstell.com> writes:
I've spent hours trying to install d and related stuff on windows xp so I can
run the "hello world" example. The docs on the internet that I have found are
incomplete or incorrect. Walter Bright kindly replied to my emails, but he
seems not to know how to do it either. The nice book "Learning to Tango with
d" has a section on installing, but it is incorrect also. I got as far as this
error message when trying to compile:

jake hello.d
object.d: module object cannot read file 'object.d' same result with >dmd hello.d I am not a newbie (except to d) and I know about paths, environment variables, .ini files, etc. For my first test I don't care which library I use. Could someone post a one-paragraph description of what to download, where to put it (what directory structure, etc), what mods to make to path or sc,ini, etc? It should not be that difficult to describe. I've installed (without help beyond the installation instructions) and written significant programs in c, Thanks in advance to some kind person... g.
Feb 20 2008
next sibling parent reply Ary Borenszweig <ary esperanto.org.ar> writes:
Download dmd: http://ftp.digitalmars.com/dmd.1.026.zip
Download dmc: http://ftp.digitalmars.com/dmc.zip

Extract dmd.1.026.zip in some directory (for instance C:\d).
Extract dmc.zip in that same directory. It will probably ask you whether 
to overrite some files, say yes.

Assuming you installed everything in C:\d, you should have something 
like this in your hard drive, assuming you insta:

C:\d\dmd
C:\d\dm

Add the following paths to your PATH environment variable:

C:\d\dmd\bin
C:\d\dm\bin

That's it. Now try dmd hello.d

glen worstell escribió:
 I've spent hours trying to install d and related stuff on windows xp so I can
 run the "hello world" example. The docs on the internet that I have found are
 incomplete or incorrect. Walter Bright kindly replied to my emails, but he
 seems not to know how to do it either. The nice book "Learning to Tango with
 d" has a section on installing, but it is incorrect also. I got as far as this
 error message when trying to compile:
 
 jake hello.d
object.d: module object cannot read file 'object.d' same result with >dmd hello.d I am not a newbie (except to d) and I know about paths, environment variables, .ini files, etc. For my first test I don't care which library I use. Could someone post a one-paragraph description of what to download, where to put it (what directory structure, etc), what mods to make to path or sc,ini, etc? It should not be that difficult to describe. I've installed (without help beyond the installation instructions) and written significant programs in c, Thanks in advance to some kind person... g.
Feb 20 2008
next sibling parent reply Bill Baxter <dnewsgroup billbaxter.com> writes:
Ary Borenszweig wrote:
 Download dmd: http://ftp.digitalmars.com/dmd.1.026.zip
 Download dmc: http://ftp.digitalmars.com/dmc.zip
 
 Extract dmd.1.026.zip in some directory (for instance C:\d).
 Extract dmc.zip in that same directory. It will probably ask you whether 
 to overrite some files, say yes.
 
 Assuming you installed everything in C:\d, you should have something 
 like this in your hard drive, assuming you insta:
 
 C:\d\dmd
 C:\d\dm
 
 Add the following paths to your PATH environment variable:
 
 C:\d\dmd\bin
 C:\d\dm\bin
 
 That's it. Now try dmd hello.d
...if he's on Windows. :-) (and if it's Windows, be sure to use a path without spaces or funky characters in it!) --bb
Feb 20 2008
parent reply glen worstell <glen worstell.com> writes:
Thanks, Bill, for your post re installing d.

Of course I am "on Windows", as mentioned in my post. However, your advice about
spaces in the path is extremely important, if true, because lots of programs
normally go in "C:\Program Files\..."

I'll want to verify that before I post my short and complete instructions for
newbies on installing d. This assumes that I will be able to finish the
"complete"
part - Ary's post didn't cover what to do about source files in directories
other
than the one where the sample hello.d file is located. I also think a few words
for newbies about the different "standard" libraries might be in order, but I
don't yet know enough to comment on that.

Thanks again,
g.
Feb 20 2008
next sibling parent Bill Baxter <dnewsgroup billbaxter.com> writes:
glen worstell wrote:
 Thanks, Bill, for your post re installing d.
 
 Of course I am "on Windows", as mentioned in my post. However, your advice
about
Doh! I swear I scanned your message up and down 3 times looking for any mention of platform and didn't see it. But it's 3am here and I just woke up -- so maybe that explains it. :-) --bb
Feb 20 2008
prev sibling parent reply jcc7 <technocrat7 gmail.com> writes:
== Quote from glen worstell (glen worstell.com)'s article
 Thanks, Bill, for your post re installing d.

 Of course I am "on Windows", as mentioned in my post. However, your
 advice about spaces in the path is extremely important, if true,
 because lots of programs normally go in "C:\Program Files\..."

 I'll want to verify that before I post my short and complete
 instructions for newbies on installing d. This assumes that I will
 be able to finish the "complete" part - Ary's post didn't cover what
 to do about source files in directories other than the one where the
 sample hello.d file is located. I also think a few words
 for newbies about the different "standard" libraries might be in
 order, but I don't yet know enough to comment on that.
I know there's a rumor out there that there is more than one "standard" library. I think this is false since Phobos has always been the standard library. On the other hand, there are alternate runtime libraries (Tango being the most popular alternate runtime library). I haven't read the Tango book, so I wouldn't know much about it. Does it require you to install Tango to learn D? I don't know if that's the best way to learn D. Perhaps there's some documentation at the Tango website that will help you get installed and set up. That'd be great news. Also, you might be able to get some more information about Tango in their forums and through IRC: http://www.dsource.org/projects/tango/wiki/Contact But using Tango may not be the best way for a newbie to start out with D. It might be easier to start out learning D by learning Phobos. YYMV.
Feb 20 2008
next sibling parent reply Chris Miller <lordSaurontheGreat gmail.com> writes:
jcc7 Wrote:

 == Quote from glen worstell (glen worstell.com)'s article
 Thanks, Bill, for your post re installing d.

 Of course I am "on Windows", as mentioned in my post. However, your
 advice about spaces in the path is extremely important, if true,
 because lots of programs normally go in "C:\Program Files\..."

 I'll want to verify that before I post my short and complete
 instructions for newbies on installing d. This assumes that I will
 be able to finish the "complete" part - Ary's post didn't cover what
 to do about source files in directories other than the one where the
 sample hello.d file is located. I also think a few words
 for newbies about the different "standard" libraries might be in
 order, but I don't yet know enough to comment on that.
I know there's a rumor out there that there is more than one "standard" library. I think this is false since Phobos has always been the standard library.
I'd love to start saying things, but it's not my language, and not my place to tell Walter how to do things.
 On the other hand, there are alternate runtime libraries (Tango being the most
 popular alternate runtime library).
 
 I haven't read the Tango book, so I wouldn't know much about it. Does it
require
 you to install Tango to learn D? I don't know if that's the best way to learn
D.
If you want to "Learn to Tango with D" I can imagine it would be very beneficial to install Tango.
 Perhaps there's some documentation at the Tango website that will help you get
 installed and set up. That'd be great news. Also, you might be able to get some
 more information about Tango in their forums and through IRC:
 http://www.dsource.org/projects/tango/wiki/Contact
 
 But using Tango may not be the best way for a newbie to start out with D. It
might
 be easier to start out learning D by learning Phobos. YYMV.
I think you need to make a big distinction. D is a programming language. Phobos and Tango are libraries. Standard system libraries like Phobos and Tango are almost part of the language, but they're not. I learned most everything I know about D by reading the DMD 1.0 specification document(1). For instance, if you know Java, it's technically possible to run javac without the JDK. You won't have access to base functionality like an interface to use the base object class, but you can create real bytecode which does real things in a real Java Runtime Environment. Likewise, you can compile D without Phobos or Tango. You won't have the object.d interface to the object structure, and you won't be able to do hardly anything, but you can compile real code into real executables which do real things on real processors. As a system library I think Tango is better. Others prefer Phobos. Someone should combine the two and make a new library called Demos (after Mars' other moon). I don't have the time, so I won't complain. But you should make the distinction between D and the library. They're very different things. That's of course assuming that there isn't some hidden magic functionality which needs otherwise. But my Java example still holds (how else could they build JRuby?) (1) http://www.prowiki.org/wiki4d/wiki.cgi?LanguageSpecification
Feb 20 2008
next sibling parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Chris Miller wrote:

 Likewise, you can compile D without Phobos or Tango.  You won't have
 the object.d interface to the object structure, and you won't be able
 to do hardly anything, but you can compile real code into real
 executables which do real things on real processors.
Actually the standard library and needed runtime are joined-at-the-hip in Phobos, so you need to implement a few selected routines from it. (this is addressed in Tango, which splits the library into separate entities for things like runtime and garbage collector for instance) But, yeah, you can use D with the C standard library if you like... In fact, this is still the way shown by the first "hello.d" in DMD.
 As a system library I think Tango is better.  Others prefer Phobos.
 Someone should combine the two and make a new library called Demos
 (after Mars' other moon).  I don't have the time, so I won't
 complain.
Actually the name "Deimos" has already been used for the etc.x.y (Phobos being the "std" group, and Deimos being the "etc" group). It is abandoned now, see: http://www.dsource.org/projects/deimos, think the original idea was for code to move from Deimos to Phobos ? So I guess it would better be called "Phoenix" or something... http://nssdc.gsfc.nasa.gov/planetary/mars_future.html
 But you should make the distinction between D and the
 library.  They're very different things.  That's of course assuming
 that there isn't some hidden magic functionality which needs
 otherwise.  But my Java example still holds (how else could they
 build JRuby?)
There is some hidden stuff, but in theory it's a very good idea to try and separate concerns. Then again "Java" is also a pretty horrible example on how to confuse different meanings of a word. (Java, Java Virtual Machine, Java Desktop - and even Java ASP 4) --anders
Feb 21 2008
prev sibling next sibling parent reply jcc7 <technocrat7 gmail.com> writes:
== Quote from Chris Miller (lordSaurontheGreat gmail.com)'s article
 jcc7 Wrote:
 == Quote from glen worstell (glen worstell.com)'s article
 But using Tango may not be the best way for a newbie to start out
 with D. It might be easier to start out learning D by learning
 Phobos. YYMV.
I think you need to make a big distinction. D is a programming language. Phobos and Tango are libraries.
Yes, but the compiler requires a runtime library to do anything useful. And I think it's worth noting that Phobos has been and continues to be the standard runtime library for D. I'm not saying that Tango isn't an alternative runtime library. It clearly is an option that a lot of people prefer. But the standard is Phobos. I'm just tired of hearing people complain about "too many standard libraries" when the problem is that people just don't like the standard runtime library. A clearly stated problem is a step toward a solution.
 Standard system libraries like Phobos and Tango are almost part of
 the language, but they're not.  I learned most everything I know
 about D by reading the DMD 1.0 specification document(1).
Perhaps you wrote "Standard system libraries like Phobos and Tango" when you meant "Runtime system libraries like Phobos and Tango". Or maybe standard means something different to you than it does to me. If I had a point worth making, I must have made it by now.
Feb 21 2008
parent Chris Miller <lordSaurontheGreat gmail.com> writes:
jcc7 Wrote:

 == Quote from Chris Miller (lordSaurontheGreat gmail.com)'s article
 jcc7 Wrote:
 == Quote from glen worstell (glen worstell.com)'s article
 But using Tango may not be the best way for a newbie to start out
 with D. It might be easier to start out learning D by learning
 Phobos. YYMV.
I think you need to make a big distinction. D is a programming language. Phobos and Tango are libraries.
Yes, but the compiler requires a runtime library to do anything useful. And I think it's worth noting that Phobos has been and continues to be the standard runtime library for D. I'm not saying that Tango isn't an alternative runtime library. It clearly is an option that a lot of people prefer. But the standard is Phobos. I'm just tired of hearing people complain about "too many standard libraries" when the problem is that people just don't like the standard runtime library. A clearly stated problem is a step toward a solution.
 Standard system libraries like Phobos and Tango are almost part of
 the language, but they're not.  I learned most everything I know
 about D by reading the DMD 1.0 specification document(1).
Perhaps you wrote "Standard system libraries like Phobos and Tango" when you meant "Runtime system libraries like Phobos and Tango". Or maybe standard means something different to you than it does to me.
Yes, I mispoke. It seems you knew what I was saying, and hopefully that made up for the inaccuracies and ambiguity in my English.
Feb 22 2008
prev sibling next sibling parent glen worstell <glen worstell.com> writes:
Chris Miller Wrote:

...

 I think you need to make a big distinction.  D is a programming language. 
Phobos and Tango are libraries.
 
 Standard system libraries like Phobos and Tango are almost part of the
language, but they're not.  I learned most everything I know about D by reading
the DMD 1.0 specification document(1).
 
This seems to me to be very misleading to newbies to d. To clarify, in d the library (phobos or tango) IS part of the compiler implementation, and the compiler you get with tango is not the latest compiler and does not even implement the same language as you get with the latest version of phobos. The problem for the user is that he/she has to choose one compiler/library over the other. You cannot use one compiler (version) with the other library. In practice this means that if you spend some time coding with one and then decide to use the other, you will need to rewrite and retest a bunch of stuff. The latest compiler version will probably always be the one that you get with phobos. As bug fixing and enhancements seem to be happening at a pretty good pace, this is a strong argument for phobos. OTHO, if you like the tango library better (and many people do) and you are satisfied with the particular implementation of the compiler that comes with it (and you don't think it has too many bugs and you don't think you need the d language that comes with the latest compiler which is different in small or sometimes big ways from the one that comes with tango) then you may be happy with tango. IMHO, this situation is unnecessary and is really, really dumb. OTOH, this stuff is all free and it seems to be pretty good - good enough to use for real world applications. Therefore I want to be careful not to complain, so please take this paragraph as a plea from a user rather than a criticism. In fact, I offer a very large THANK YOU to the phobos team and to the tango team. Having coded in many different languages I offer my opinion of d: it's design is programming language. g.
Feb 21 2008
prev sibling parent reply glen worstell <glen worstell.com> writes:
Chris Miller Wrote:

...

 I think you need to make a big distinction.  D is a programming language. 
Phobos and Tango are libraries.
 
 Standard system libraries like Phobos and Tango are almost part of the
language, but they're not.  I learned most everything I know about D by reading
the DMD 1.0 specification document(1).
 
This seems to me to be very misleading to newbies to d. To clarify, in d the library (phobos or tango) IS part of the compiler implementation, and the compiler you get with tango is not the latest compiler and does not even implement the same language as you get with the latest version of phobos. The problem for the user is that he/she has to choose one compiler/library over the other. You cannot use one compiler (version) with the other library. In practice this means that if you spend some time coding with one and then decide to use the other, you will need to rewrite and retest a bunch of stuff. The latest compiler version will probably always be the one that you get with phobos. As bug fixing and enhancements seem to be happening at a pretty good pace, this is a strong argument for phobos. OTHO, if you like the tango library better (and many people do) and you are satisfied with the particular implementation of the compiler that comes with it (and you don't think it has too many bugs and you don't think you need the d language that comes with the latest compiler which is different in small or sometimes big ways from the one that comes with tango) then you may be happy with tango. IMHO, this situation is unnecessary and is really, really dumb. OTOH, this stuff is all free and it seems to be pretty good - good enough to use for real world applications. Therefore I want to be careful not to complain, so please take this paragraph as a plea from a user rather than a criticism. In fact, I offer a very large THANK YOU to the phobos team and to the tango team. Having coded in many different languages I offer my opinion of d: it's design is programming language. g.
Feb 21 2008
parent reply "Kris" <foo bar.com> writes:
eeek ... this is quite wrong Glen, but hopefully some of that can be 
remedied:

The compilers are *not* different in the way you describe them.  There are 
currently two D compilers - one from Walter (dmd) and one based around the 
GNU compiler collection (gdc).  The DMD bundle that people download from 
digitalmars comes with the original library called phobos. The DMD complier 
itself has a Win32 and a linux variation.

On the other hand, the bundles you can download from the dsource (Tango) 
site have three principal options: DMD+Tango/Win32, DMD+Tango/linux, 
GDC+Tango/linux. You can also get the Tango library without a compiler at 
all (for building on another O/S for example). Further, if you want to use 
the phobos library /together/ with the Tango library, you can download one 
of those combined bundles from dsource also (and it is trivial to get both 
libraries functioning together when you use that bundle).

Chris Miller is correct when he draws a distinction between the language and 
the library. However, there's a third part which makes the picture a bit 
murky - there's a 'runtime' aspect also, which includes things like the 
garbage-collector and various other support goodies. Currently those are 
implemented differently between phobos and Tango, although a convergence is 
apparently making some headway.

The combined phobos/Tango bundle you can get at dsource uses the Tango 
runtime, and some very minor tweaks are made to the phobos library to make 
it operate in that environment instead (e.g. the phobos runtime is flushed, 
and the Thread module is mutated). The reason why it's often best to use 
that bundle instead of trying to combine them yourself is this: with that 
bundle there is just one runtime component, and the sc.ini file is 
configured appropriately such that ppl don't have to fuss around with it.

I think many would agree that this is not an ideal situation, but we'll get 
through it. D is a bit of a grass-roots things, and it would arguably be in 
a worse place if developers were merely content with the status-quo. After 
all, /not/ being content with the status-quo is why Walter devised the D 
language in the first place ;)





"glen worstell" <glen worstell.com> wrote in message 
news:fpl9mb$125h$1 digitalmars.com...
 Chris Miller Wrote:

 ...

 I think you need to make a big distinction.  D is a programming language. 
 Phobos and Tango are libraries.

 Standard system libraries like Phobos and Tango are almost part of the 
 language, but they're not.  I learned most everything I know about D by 
 reading the DMD 1.0 specification document(1).
This seems to me to be very misleading to newbies to d. To clarify, in d the library (phobos or tango) IS part of the compiler implementation, and the compiler you get with tango is not the latest compiler and does not even implement the same language as you get with the latest version of phobos. The problem for the user is that he/she has to choose one compiler/library over the other. You cannot use one compiler (version) with the other library. In practice this means that if you spend some time coding with one and then decide to use the other, you will need to rewrite and retest a bunch of stuff. The latest compiler version will probably always be the one that you get with phobos. As bug fixing and enhancements seem to be happening at a pretty good pace, this is a strong argument for phobos. OTHO, if you like the tango library better (and many people do) and you are satisfied with the particular implementation of the compiler that comes with it (and you don't think it has too many bugs and you don't think you need the d language that comes with the latest compiler which is different in small or sometimes big ways from the one that comes with tango) then you may be happy with tango. IMHO, this situation is unnecessary and is really, really dumb. OTOH, this stuff is all free and it seems to be pretty good - good enough to use for real world applications. Therefore I want to be careful not to complain, so please take this paragraph as a plea from a user rather than a criticism. In fact, I offer a very large THANK YOU to the phobos team and to the tango team. Having coded in many different languages I offer my opinion of d: it's design is absolutely excellent, and it may someday g.
Feb 21 2008
parent reply glen worstell <glen worstell.com> writes:
Kris Wrote:

 eeek ... this is quite wrong Glen, but hopefully some of that can be 
 remedied:
 
 ...
Thanks for the excellent description of a situation that is more complicated than I had indicated. Your description should be very helpful to anyone first learning about d. It would be nice if it could be posted in a place that new people might be more likely to find. Perhaps Walter would put it on his web site? However, I stand by the main claim of my post: I have to choose between using d 2.x and phobos, or d 1.x and tango. As far as I can tell, and your post does not contradict this; I cannot use d2.x with tango (on windows). The comment that I am "quite wrong" seems to be an issue with semantics rather than substance, at least from a user's point of view. Furthermore, d 2.x is different enough from d 1.x that I, and probably many users, would prefer to use it. I also have the impression that bugs will be fixed faster in d2.x, although I could be wrong about this. As d is evolving I'd like to use the latest version, which can be done with phobos and not with tango. If I am incorrect and it is possible to use d 2.x with tango, please let me know how to do it, and I will apologize and post a correction with instructions. My ultimate goal was (is) to describe to newbies how to simply install both versions of compiler/library on windows xp, and why they need to choose before building a substantial application, because d/phobos is not the same language or library as d/tango, and d/phobos/tango is not the same language as d/phobos (if you use the d2.x version of d/phobos). I do think that perhaps I should modify my newbie instructions to include the third choice, d/phobos/tango, as it might be a better choice than d/tango. I've not tried it yet, but will do so soon. Thanks for taking the time to clarify the issues as you see them. To summarize my understanding: it seems to me that the user, on windows, today, has 4 choices: d1.x/phobos d2.x/phobos d1.x/tango d1.x/phobos/tango Does this seem correct to you? g. PS - Nowhere in my posts have I mentioned the 500 different versions of linux. However, if it is possible to use d2.x/tango/phobos (or just d2.x/tango) on one of the common linux versions, I'll dump windows for my d evaluation. :)
Feb 22 2008
next sibling parent Chris Miller <lordSaurontheGreat gmail.com> writes:
glen worstell Wrote:
 PS - Nowhere in my posts have I mentioned the 500 different versions of 
 linux. However, if it is possible to use d2.x/tango/phobos (or just
d2.x/tango)  
 on one of the common linux versions, I'll dump windows for my d evaluation. 
 :)
I am not aware of a GDC version implementing the D 2.0 standards. As far as I know, GDC is waiting on D 2.0 to finalize before going ahead and implementing a D 2.0 compliant GCC frontend. Personally I'm avoiding D 2.0 until it both finalizes and all the libraries move into it as well. Imagine getting to the top of the hill only to find there's no one there to share it with. It would be depressing at the very least. I know GDC works with Phobos, I haven't even tried with Tango yet (working on making it work with Windows first - I try and do the hardest things first for some strange reason.)
Feb 22 2008
prev sibling parent "Kris" <foo bar.com> writes:
Ah yes;  I was over-simplfying the situation, as you point out. There is an 
experimental version of D called D2, whose principal features (i.e. const) 
seem to change with the wind <g>. The only so-called stable specification 
for D is actually the D1 incarnation, which is deemed to be 'solidified' 
with a stake in the ground for about a year now. The book you have is based 
around D1

Tango supports the stable D1 language specification only because, at this 
time, D2 is too much of a moving target. We do have an 'experimental' branch 
of Tango with D2 support in there (kudos to Keinfarbton and Schvieguy), but 
we won't release that until D2 becomes more stable.

My apologies for overlooking the D1/D2 distinction, Glen. Cheers!

- Kris



"glen worstell" <glen worstell.com> wrote in message 
news:fpn0qs$56a$1 digitalmars.com...
 Kris Wrote:

 eeek ... this is quite wrong Glen, but hopefully some of that can be
 remedied:

 ...
Thanks for the excellent description of a situation that is more complicated than I had indicated. Your description should be very helpful to anyone first learning about d. It would be nice if it could be posted in a place that new people might be more likely to find. Perhaps Walter would put it on his web site? However, I stand by the main claim of my post: I have to choose between using d 2.x and phobos, or d 1.x and tango. As far as I can tell, and your post does not contradict this; I cannot use d2.x with tango (on windows). The comment that I am "quite wrong" seems to be an issue with semantics rather than substance, at least from a user's point of view. Furthermore, d 2.x is different enough from d 1.x that I, and probably many users, would prefer to use it. I also have the impression that bugs will be fixed faster in d2.x, although I could be wrong about this. As d is evolving I'd like to use the latest version, which can be done with phobos and not with tango. If I am incorrect and it is possible to use d 2.x with tango, please let me know how to do it, and I will apologize and post a correction with instructions. My ultimate goal was (is) to describe to newbies how to simply install both versions of compiler/library on windows xp, and why they need to choose before building a substantial application, because d/phobos is not the same language or library as d/tango, and d/phobos/tango is not the same language as d/phobos (if you use the d2.x version of d/phobos). I do think that perhaps I should modify my newbie instructions to include the third choice, d/phobos/tango, as it might be a better choice than d/tango. I've not tried it yet, but will do so soon. Thanks for taking the time to clarify the issues as you see them. To summarize my understanding: it seems to me that the user, on windows, today, has 4 choices: d1.x/phobos d2.x/phobos d1.x/tango d1.x/phobos/tango Does this seem correct to you? g. PS - Nowhere in my posts have I mentioned the 500 different versions of linux. However, if it is possible to use d2.x/tango/phobos (or just d2.x/tango) on one of the common linux versions, I'll dump windows for my d evaluation. :)
Feb 22 2008
prev sibling parent Jesse Phillips <jessekphillips gmail.com> writes:
On Wed, 20 Feb 2008 20:05:47 +0000, jcc7 wrote:

 == Quote from glen worstell (glen worstell.com)'s article
 Thanks, Bill, for your post re installing d.

 Of course I am "on Windows", as mentioned in my post. However, your
 advice about spaces in the path is extremely important, if true,
 because lots of programs normally go in "C:\Program Files\..."

 I'll want to verify that before I post my short and complete
 instructions for newbies on installing d. This assumes that I will be
 able to finish the "complete" part - Ary's post didn't cover what to do
 about source files in directories other than the one where the sample
 hello.d file is located. I also think a few words for newbies about the
 different "standard" libraries might be in order, but I don't yet know
 enough to comment on that.
I know there's a rumor out there that there is more than one "standard" library. I think this is false since Phobos has always been the standard library. On the other hand, there are alternate runtime libraries (Tango being the most popular alternate runtime library). I haven't read the Tango book, so I wouldn't know much about it. Does it require you to install Tango to learn D? I don't know if that's the best way to learn D. Perhaps there's some documentation at the Tango website that will help you get installed and set up. That'd be great news. Also, you might be able to get some more information about Tango in their forums and through IRC: http://www.dsource.org/projects/tango/wiki/Contact But using Tango may not be the best way for a newbie to start out with D. It might be easier to start out learning D by learning Phobos. YYMV.
jcc7, True Tango is not a standard library, however it has been embraced by a large portion of the community, weather it official or not new users will run into the same problems if it was official (in fact I think it would be simpler if there were two official standard libraries). As for the last point, I think Tango might be the best library for a newbie to start out with, excluding the more difficult setup, because there is a book teaching it. As a side note the book only requires a tango install because it uses Stdout for output during the D introduction portion.
Feb 20 2008
prev sibling parent reply glen worstell <glen worstell.com> writes:
Thanks, Ary, for the short, clear, and correct instructions. In seconds I was
able
to compile and run hello.d

However, when I copy hello.d to some other directory, I get the following error
message:

D:\glensDocs\dmdProgs>dmd hello.d
hello.d(2): module Stdout cannot read file 'tango\io\Stdout.d'

At least now, thanks to your instructions, I can try out d. I'll spend some more
hours determining how to use d with source code in an arbitrary directory, or
maybe you or some other kind person will take a minute to describe how to set up
the correct environment variables, or sc.ini, or whatever.

Once I get this all sorted out, with the help of other users, I'll write it up
and
ask Walter to put it on his web site.

Cheers,
g.
Feb 20 2008
parent Bill Baxter <dnewsgroup billbaxter.com> writes:
glen worstell wrote:
 Thanks, Ary, for the short, clear, and correct instructions. In seconds I was
able
 to compile and run hello.d
 
 However, when I copy hello.d to some other directory, I get the following error
 message:
 
 D:\glensDocs\dmdProgs>dmd hello.d
 hello.d(2): module Stdout cannot read file 'tango\io\Stdout.d'
 
 At least now, thanks to your instructions, I can try out d. I'll spend some
more
 hours determining how to use d with source code in an arbitrary directory, or
 maybe you or some other kind person will take a minute to describe how to set
up
 the correct environment variables, or sc.ini, or whatever.
 
 Once I get this all sorted out, with the help of other users, I'll write it up
and
 ask Walter to put it on his web site.
Ok, you're trying to use the Tango library. It's not the default library that comes with DMD, and it is in fact a completely separate, incompatible runtime for D. It replaces low-level things like the built-in garbage collector. Because of that, installation of Tango is a bit more involved. If you want to use Tango, then starting from your current install, follow the instructions here: http://www.dsource.org/projects/tango/wiki/WindowsInstall --bb
Feb 20 2008
prev sibling parent reply "Kris" <foo bar.com> writes:
Hi Glen,

Just tried this myself and had no difficulties, so I'll list the steps I 
went through:

1) download from the web-site. I used this link: 
http://dsource.org/projects/tango/wiki/DmdDownloads  and clicked on where it 
says "repository snapshot as a zip (including DMD 1.025)"

2) made a fresh folder called '\d' and expanded the zip files over there 
(create a folder wherever you need it). This added a series of folders to 
'\d', one if which is '\d\bin'

3) opened a console window in \d

4) I set my exe path to this \d\bin directory, using "set path=\d\bin"

5) did a "cd \d\example\console"

6) did a "jake hello.d"

And all was fine.

I think you perhaps got into a situation where the sc.ini being picked up 
did not match the installation? This might happen if you have multiple 
compilers in your 'path' settings, for example.

Hope this helps ...




"glen worstell" <glen worstell.com> wrote in message 
news:fphluh$21g7$1 digitalmars.com...
 I've spent hours trying to install d and related stuff on windows xp so I 
 can
 run the "hello world" example. The docs on the internet that I have found 
 are
 incomplete or incorrect. Walter Bright kindly replied to my emails, but he
 seems not to know how to do it either. The nice book "Learning to Tango 
 with
 d" has a section on installing, but it is incorrect also. I got as far as 
 this
 error message when trying to compile:

jake hello.d
object.d: module object cannot read file 'object.d' same result with >dmd hello.d I am not a newbie (except to d) and I know about paths, environment variables, .ini files, etc. For my first test I don't care which library I use. Could someone post a one-paragraph description of what to download, where to put it (what directory structure, etc), what mods to make to path or sc,ini, etc? It should not be that difficult to describe. I've installed (without help beyond the installation instructions) and written significant programs in c, Thanks in advance to some kind person... g.
Feb 21 2008
next sibling parent reply glen worstell <glen worstell.com> writes:
Thanks, Kris. I did figure this out and it worked fine.

I expect other new users may be not understanding the library situation at
first, as I did not. If any new users get to here, this may help:

The following is not meant to flame anyone, it is meant to help people new to d
to get started with it on the Windows XP platform. I am not an expert but this
information has been tested and I am pretty sure it is correct.

There is not a single implementation of d for windows, because unlike for other
languages the library is not separate but is part of the compiler.

You must choose between the phobos compiler/library and the tango
compiler/library. This is a very unfortunate and unnecessary situation, but it
is what it is.

The difference in the compilers is that the tango compiler/library has an older
version of the compiler (and probably always will), and the latest version of
the phobos d compiler is quite a bit different. Therefore you must base your
choice on not only which library you like better, but also which implementation
of the compiler you like better.

Currently I consider the phobos compiler to be better than the tango one. I
don't have a firm opinion about the libraries, but I think I like tango better.
I have to decide between having a compiler that I prefer or having a library
that I prefer. You can't have both at this time. :(

I purchased the book "Learn to Tango with D" and found it helpful. However, it
does not describe either version of D except superficially, and it does not
completely describe the tango library, and it does not have an index. :(
I do recommend the book to people getting started, no matter which version of
the compiler/library you think you might end up with, because it is helpful to
a new d programmer.

I decided to work with both versions for a while before deciding on one.
Because the compiler is different (for example, the phobos compiler/library I
use is version 2.011, and the tango one is 1.026, the difference is significant.

 I created two directories -  c:\tango, and c:\phobos.

To install the tango compiler/library, I downloaded and installed according to
the directions Kris posted, repeated below, except I got version 1.026 and
unzipped to c:\tango). There will be a bunch of directories, including bin.

Set your path to include c:\tango\bin, and then you can create a source file
anywhere on your system (I'd  not put my source code in c:\tango as I like to
keep things better organized than that). The source file should be named
hello.d (or whatever file name you choose, with a .d extension).

fire up cmd and cd to your source directory and do "jake hello.d" and it should
all work. If there are no errors you can run the resulting .exe file.

To install the phobos compiler/library, go to the Digital Mars site and see if
you can find downloads for dmc and dmd. You will probably want the latest
version of dmd, which today is 2.011. It is not in the obvious places so try
looking for news or announcements. I forgot exactly where I found it.

First, unzip dmc (I was unable to find a version number for this) into your
c:\phobos. Then unzip dmd into the same directory. You will get errors about
duplicate file names; you should choose to overwrite all files.

Now fix your path, after getting rid of the path for tango. You need two
additions to the path: c:\phobos\dm\bin and c:\phobos\dmc\bin (in that order).

Now you can cd to wherever your source code is, and do (for example) dmd hello.d

You won't get to use jake, which is too bad because that tool is very nice. 
Search the tango web site to learn more about jake and other tools.

If it compiles and links without errors you'll get a hello.exe (or whatever
source file name you used) which can then be run.

I've not yet decided which I want, so I installed both. It is necessary to
change the path when switching from one to the other.

Changing the path got to be a pain, so I removed the d stuff from the path and
now I rely on my text editor (TextPad) to set the path for me according to
which system I am using. You could easily use batch files for the same thing.
In your directory for phobos source files you could have a batch file called
something like "setPhobosPath" that would append the right thing to your path,
like this:
set path=%path%;c:\phobos\dm\bin;c:\phobos\dmd\bin

In the directory for your tango source files you would create a similar batch
file. BTW, my source directories are not even on the c drive; they can be
anywhere.

Note to implementers: the idea of requiring a compiler to use a particular


I'd prefer to use d because I like the language better and because it generates


away with objects. In d, it is easy to use objects when they are useful and
easy to ignore object-oriented programming when it is not particularly useful.

So, a plea from a potential user: fix the compiler so it can be used with
either library. It seems that this has almost been done already, but almost
means not quite. If you do this, then anyone can get the latest compiler and
use it with either or both libraries.

Hope this helps ...

Glen.

Kris Wrote:

 Hi Glen,
 
 Just tried this myself and had no difficulties, so I'll list the steps I 
 went through:
 
 1) download from the web-site. I used this link: 
 http://dsource.org/projects/tango/wiki/DmdDownloads  and clicked on where it 
 says "repository snapshot as a zip (including DMD 1.025)"
 
 2) made a fresh folder called '\d' and expanded the zip files over there 
 (create a folder wherever you need it). This added a series of folders to 
 '\d', one if which is '\d\bin'
 
 3) opened a console window in \d
 
 4) I set my exe path to this \d\bin directory, using "set path=\d\bin"
 
 5) did a "cd \d\example\console"
 
 6) did a "jake hello.d"
 
 And all was fine.
 
 I think you perhaps got into a situation where the sc.ini being picked up 
 did not match the installation? This might happen if you have multiple 
 compilers in your 'path' settings, for example.
 
 Hope this helps ...
 
Feb 21 2008
parent reply Chris Miller <lordSaurontheGreat gmail.com> writes:
glen worstell Wrote:

 Note to implementers: the idea of requiring a compiler to use a particular


I'd prefer to use d because I like the language better and because it generates

Hold the phone, I know this is OT but... could make executables! That's why I haven't flamed it using my Java Programmer hat.
Feb 22 2008
next sibling parent Ary Borenszweig <ary esperanto.org.ar> writes:
Chris Miller escribió:
 glen worstell Wrote:
 
 Note to implementers: the idea of requiring a compiler to use a particular


I'd prefer to use d because I like the language better and because it generates

Hold the phone, I know this is OT but... could make executables! That's why I haven't flamed it using my Java Programmer hat.
library to execute them...
Feb 22 2008
prev sibling parent glen worstell <glen worstell.com> writes:
Chris Miller Wrote:

 glen worstell Wrote:
 

Hold the phone, I know this is OT but... could make executables! That's why I haven't flamed it using my Java Programmer hat.
Don't be too hasty. The definition of "executable" could get us tangled in might be called "executables" given that the user has .NET installed. If not, one must require the user to install it. My desire for what I called an "executable" was to ship a .exe file that worked without requiring the user to install anything else. I can do this with d/phobos or d/tango. are future questions I'll answer them offline.
Feb 22 2008
prev sibling parent glen worstell <glen worstell.com> writes:
Thanks, Kris. I did figure this out and it worked fine.

I expect other new users may be not understanding the library situation at
first, as I did not. If any new users get to here, this may help:

The following is not meant to flame anyone, it is meant to help people new to d
to get started with it on the Windows XP platform. I am not an expert but this
information has been tested and I am pretty sure it is correct.

There is not a single implementation of d for windows, because unlike for other
languages the library is not separate but is part of the compiler.

You must choose between the phobos compiler/library and the tango
compiler/library. This is a very unfortunate and unnecessary situation, but it
is what it is.

The difference in the compilers is that the tango compiler/library has an older
version of the compiler (and probably always will), and the latest version of
the phobos d compiler is quite a bit different. Therefore you must base your
choice on not only which library you like better, but also which implementation
of the compiler you like better.

Currently I consider the phobos compiler to be better than the tango one. I
don't have a firm opinion about the libraries, but I think I like tango better.
I have to decide between having a compiler that I prefer or having a library
that I prefer. You can't have both at this time. :(

I purchased the book "Learn to Tango with D" and found it helpful. However, it
does not describe either version of D except superficially, and it does not
completely describe the tango library, and it does not have an index. :(
I do recommend the book to people getting started, no matter which version of
the compiler/library you think you might end up with, because it is helpful to
a new d programmer.

I decided to work with both versions for a while before deciding on one.
Because the compiler is different (for example, the phobos compiler/library I
use is version 2.011, and the tango one is 1.026, the difference is significant.

 I created two directories -  c:\tango, and c:\phobos.

To install the tango compiler/library, I downloaded and installed according to
the directions Kris posted, repeated below, except I got version 1.026 and
unzipped to c:\tango). There will be a bunch of directories, including bin.

Set your path to include c:\tango\bin, and then you can create a source file
anywhere on your system (I'd  not put my source code in c:\tango as I like to
keep things better organized than that). The source file should be named
hello.d (or whatever file name you choose, with a .d extension).

fire up cmd and cd to your source directory and do "jake hello.d" and it should
all work. If there are no errors you can run the resulting .exe file.

To install the phobos compiler/library, go to the Digital Mars site and see if
you can find downloads for dmc and dmd. You will probably want the latest
version of dmd, which today is 2.011. It is not in the obvious places so try
looking for news or announcements. I forgot exactly where I found it.

First, unzip dmc (I was unable to find a version number for this) into your
c:\phobos. Then unzip dmd into the same directory. You will get errors about
duplicate file names; you should choose to overwrite all files.

Now fix your path, after getting rid of the path for tango. You need two
additions to the path: c:\phobos\dm\bin and c:\phobos\dmc\bin (in that order).

Now you can cd to wherever your source code is, and do (for example) dmd hello.d

You won't get to use jake, which is too bad because that tool is very nice. 
Search the tango web site to learn more about jake and other tools.

If it compiles and links without errors you'll get a hello.exe (or whatever
source file name you used) which can then be run.

I've not yet decided which I want, so I installed both. It is necessary to
change the path when switching from one to the other.

Changing the path got to be a pain, so I removed the d stuff from the path and
now I rely on my text editor (TextPad) to set the path for me according to
which system I am using. You could easily use batch files for the same thing.
In your directory for phobos source files you could have a batch file called
something like "setPhobosPath" that would append the right thing to your path,
like this:
set path=%path%;c:\phobos\dm\bin;c:\phobos\dmd\bin

In the directory for your tango source files you would create a similar batch
file. BTW, my source directories are not even on the c drive; they can be
anywhere.

Note to implementers: the idea of requiring a compiler to use a particular


I'd prefer to use d because I like the language better and because it generates


away with objects. In d, it is easy to use objects when they are useful and
easy to ignore object-oriented programming when it is not particularly useful.

So, a plea from a potential user: fix the compiler so it can be used with
either library. It seems that this has almost been done already, but almost
means not quite. If you do this, then anyone can get the latest compiler and
use it with either or both libraries.

Hope this helps ...

Glen.

Kris Wrote:

 Hi Glen,
 
 Just tried this myself and had no difficulties, so I'll list the steps I 
 went through:
 
 1) download from the web-site. I used this link: 
 http://dsource.org/projects/tango/wiki/DmdDownloads  and clicked on where it 
 says "repository snapshot as a zip (including DMD 1.025)"
 
 2) made a fresh folder called '\d' and expanded the zip files over there 
 (create a folder wherever you need it). This added a series of folders to 
 '\d', one if which is '\d\bin'
 
 3) opened a console window in \d
 
 4) I set my exe path to this \d\bin directory, using "set path=\d\bin"
 
 5) did a "cd \d\example\console"
 
 6) did a "jake hello.d"
 
 And all was fine.
 
 I think you perhaps got into a situation where the sc.ini being picked up 
 did not match the installation? This might happen if you have multiple 
 compilers in your 'path' settings, for example.
 
 Hope this helps ...
 
Feb 21 2008