February 21, 2008 Re: how to install? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris Miller | 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 |
February 21, 2008 Re: how to install? | ||||
---|---|---|---|---|
| ||||
Posted in reply to glen worstell | 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, > c#, lua, python, and, long ago, several other languages. > > Thanks in advance to some kind person... > > g. > |
February 21, 2008 Re: how to install? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris Miller | == 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. |
February 22, 2008 Re: how to install? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kris | 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 library is so annoying that I may just use c# for my 1500 line project. The argument that d is faster than c# is meaningless for most application programs. I'd prefer to use d because I like the language better and because it generates .exe files, but I consider c# to be very well done and perfectly suitable for many windows applications. My main complaint with c# is that they got carried 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 ... > > |
February 22, 2008 Re: how to install? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kris | 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 library is so annoying that I may just use c# for my 1500 line project. The argument that d is faster than c# is meaningless for most application programs. I'd prefer to use d because I like the language better and because it generates .exe files, but I consider c# to be very well done and perfectly suitable for many windows applications. My main complaint with c# is that they got carried 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 ... > > |
February 22, 2008 Re: how to install? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris Miller | 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 replace c# as my favorite applications programming language.
g.
|
February 22, 2008 Re: how to install? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris Miller | 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 replace c# as my favorite applications programming language.
g.
|
February 22, 2008 Re: how to install? | ||||
---|---|---|---|---|
| ||||
Posted in reply to glen worstell | 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 replace c# as my favorite applications programming language. > > g. > |
February 22, 2008 Re: how to install? | ||||
---|---|---|---|---|
| ||||
Posted in reply to jcc7 | 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.
|
February 22, 2008 Re: how to install? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kris | 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. :)
|
Copyright © 1999-2021 by the D Language Foundation