www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - trouble getting started with D

reply Andrew Marlow <marlow.andrew googlemail.com> writes:
I would like to start using D but am running into some problems. I am using 64
bit ubuntu, Karmic Koala. I tried using the GNU D compiler (gdc) but even a
hello world type program core dumps in the print statement. So I tried ldc but
it complains that it can't import std.stdio. So I tried the Digital Mars
compiler and I couldn't get it to install. The deb file says it is for the
wrong architecture. Presumably it is for 32 bit and I am on 64 so no go.

Where do I go from here? I would really like to try it? If there is a 64 bit
install for ubuntu can someone post a URL please?
Mar 18 2010
next sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
Andrew Marlow Wrote:
So I tried ldc but it complains that it can't import std.stdio.<

ldc is a D1 compiler that comes with Tango standard lib, so it doesn't have the std.stdio. You have to use Tango I/O functions. Bye, bearophile
Mar 18 2010
next sibling parent reply Andrew Marlow <marlow.andrew googlemail.com> writes:
bearophile Wrote:

 Andrew Marlow Wrote:
So I tried ldc but it complains that it can't import std.stdio.<

ldc is a D1 compiler that comes with Tango standard lib, so it doesn't have the std.stdio. You have to use Tango I/O functions.

Well, thanks for that, at least I know now. But I am a bit peeved. What is the point in calling something 'std' if it is not standard. I am used to 'std' meaning 'it comes with the compiler environment'.
Mar 18 2010
next sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
Andrew Marlow:
 Well, thanks for that, at least I know now. But I am a bit peeved. What is the
point in calling something 'std' if it is not standard. I am used to 'std'
meaning 'it comes with the compiler environment'.

Please, ask questions like those ones on the learn newsgroup. Bye, bearophile
Mar 18 2010
parent reply grauzone <none example.net> writes:
bearophile wrote:
 Andrew Marlow:
 Well, thanks for that, at least I know now. But I am a bit peeved. What is the
point in calling something 'std' if it is not standard. I am used to 'std'
meaning 'it comes with the compiler environment'.

Please, ask questions like those ones on the learn newsgroup.

When will it be renamed to "D.users"? Also we can rename this newsgroup to "D.bikeshedding".
 Bye,
 bearophile

Mar 18 2010
parent reply "Nick Sabalausky" <a a.a> writes:
"grauzone" <none example.net> wrote in message 
news:hntpft$1ddq$1 digitalmars.com...
 bearophile wrote:
 Andrew Marlow:
 Well, thanks for that, at least I know now. But I am a bit peeved. What 
 is the point in calling something 'std' if it is not standard. I am used 
 to 'std' meaning 'it comes with the compiler environment'.

Please, ask questions like those ones on the learn newsgroup.

When will it be renamed to "D.users"? Also we can rename this newsgroup to "D.bikeshedding".

Of course not. "D.bikeshed" would be much better!
Mar 18 2010
parent Paul D. Anderson <paul.d.removethis.anderson comcast.andthis.net> writes:
Nick Sabalausky Wrote:

 "grauzone" <none example.net> wrote in message 
 news:hntpft$1ddq$1 digitalmars.com...
 bearophile wrote:
 Andrew Marlow:
 Well, thanks for that, at least I know now. But I am a bit peeved. What 
 is the point in calling something 'std' if it is not standard. I am used 
 to 'std' meaning 'it comes with the compiler environment'.

Please, ask questions like those ones on the learn newsgroup.

When will it be renamed to "D.users"? Also we can rename this newsgroup to "D.bikeshedding".

Of course not. "D.bikeshed" would be much better!

I don't care what you call it, as long as it is one of the following: D.shedforbikes D.greenbikeshed D.notbluebikeshed D.velocipedeshed D.dicycleshed (for those pedantic about mixing Greek and Latin terms) D.alliaskisforyoutodoitmywaywhatcouldbesimpler Paul
Mar 18 2010
prev sibling parent reply "Lars T. Kyllingstad" <public kyllingen.NOSPAMnet> writes:
Andrew Marlow wrote:
 bearophile Wrote:
 
 Andrew Marlow Wrote:
 So I tried ldc but it complains that it can't import std.stdio.<


Well, thanks for that, at least I know now. But I am a bit peeved. What is the point in calling something 'std' if it is not standard. I am used to 'std' meaning 'it comes with the compiler environment'.

Back in the days, some people found D1's standard library, Phobos (aka. the std namespace), a bit too simplistic, and so they went and created an alternative "standard library", Tango: http://www.dsource.org/projects/tango Some see this as a problem, but personally I don't agree. If you prefer a simple, C-like standard library, use Phobos. If you prefer a more comprehensive Java-like standard library, use Tango. (Before, you could even use both together, with the 'tangobos' package, which I believe is outdated now.) Or just switch to D2, for which the "problem" doesn't exist. There is only Phobos2, and it has become a lot more extensive than Phobos1. And you can expect major improvements to Phobos over the next few months since the language itself now has been frozen. -Lars
Mar 18 2010
parent qwerty <qw er.ty> writes:
Lars T. Kyllingstad Wrote:

 Back in the days, some people found D1's standard library, Phobos (aka. 
 the std namespace), a bit too simplistic, and so they went and created 
 an alternative "standard library", Tango:
 
    http://www.dsource.org/projects/tango
 
 Some see this as a problem, but personally I don't agree.  If you prefer 
 a simple, C-like standard library, use Phobos.  If you prefer a more 
 comprehensive Java-like standard library, use Tango.  (Before, you could 
 even use both together, with the 'tangobos' package, which I believe is 
 outdated now.)

Personally I never had any real problems with there being two standard libraries, if only all projects on dsource would have chosen the lib I am familiar with ;)
Mar 18 2010
prev sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Thu, 18 Mar 2010 08:43:40 -0400, Andrew Marlow  
<marlow.andrew googlemail.com> wrote:

 bearophile Wrote:

 Andrew Marlow Wrote:
So I tried ldc but it complains that it can't import std.stdio.<

ldc is a D1 compiler that comes with Tango standard lib, so it doesn't have the std.stdio. You have to use Tango I/O functions.

Well, thanks for that, at least I know now. But I am a bit peeved. What is the point in calling something 'std' if it is not standard. I am used to 'std' meaning 'it comes with the compiler environment'.

It does. Tango is an alternative standard library, and in order to avoid naming conflicts with D's standard library Phobos, the root package is named tango instead of std. LDC is an alternative compiler to the D reference compiler, their choice of Tango as a standard library cannot be controlled by D or the spec. It is a constant source of confusion and contention that there are "two" standard libraries. -Steve
Mar 18 2010
prev sibling parent reply "Lars T. Kyllingstad" <public kyllingen.NOSPAMnet> writes:
Andrew Marlow wrote:
 I would like to start using D but am running into some problems. I am using 64
bit ubuntu, Karmic Koala. I tried using the GNU D compiler (gdc) but even a
hello world type program core dumps in the print statement. So I tried ldc but
it complains that it can't import std.stdio. So I tried the Digital Mars
compiler and I couldn't get it to install. The deb file says it is for the
wrong architecture. Presumably it is for 32 bit and I am on 64 so no go.
 
 Where do I go from here? I would really like to try it? If there is a 64 bit
install for ubuntu can someone post a URL please?

Hi! The 32-bit DMD compiler works fine on 64-bit Ubuntu, even though the .deb file is marked as i386. Try this: dpkg -i --force-architecture dmd_2.041-0_i386.deb Note that since the compiler is 32-bit, it only works with 32-bit libraries. You must therefore install the following packages: sudo apt-get install gcc-multilib g++-multilib libc6-i386 libc6-dev-i386 In addition, you might like to install the ia32-libs package, as it contains 32-bit versions of a bunch of libraries. -Lars
Mar 18 2010
next sibling parent Andrew Marlow <marlow.andrew googlemail.com> writes:
Lars T. Kyllingstad Wrote:

 Where do I go from here? I would really like to try it? If there is a 64 bit
install for ubuntu can someone post a URL please?


 The 32-bit DMD compiler works fine on 64-bit Ubuntu, even though the 
 .deb file is marked as i386.  Try this:
 
    dpkg -i --force-architecture dmd_2.041-0_i386.deb
 
 Note that since the compiler is 32-bit, it only works with 32-bit 
 libraries.  You must therefore install the following packages:
 
 sudo apt-get install gcc-multilib g++-multilib libc6-i386 libc6-dev-i386

Wow, I tried this and it works. Many thanks!
Mar 18 2010
prev sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Lars T. Kyllingstad wrote:
 The 32-bit DMD compiler works fine on 64-bit Ubuntu, even though the 
 .deb file is marked as i386.  Try this:
 
   dpkg -i --force-architecture dmd_2.041-0_i386.deb
 
 Note that since the compiler is 32-bit, it only works with 32-bit 
 libraries.  You must therefore install the following packages:
 
 sudo apt-get install gcc-multilib g++-multilib libc6-i386 libc6-dev-i386
 
 In addition, you might like to install the ia32-libs package, as it 
 contains 32-bit versions of a bunch of libraries.

Thanks, I added this information to the install page: http://www.digitalmars.com/d/2.0/dmd-linux.html#installation
Mar 18 2010
parent reply "Lars T. Kyllingstad" <public kyllingen.NOSPAMnet> writes:
Walter Bright wrote:
 Lars T. Kyllingstad wrote:
 The 32-bit DMD compiler works fine on 64-bit Ubuntu, even though the 
 .deb file is marked as i386.  Try this:

   dpkg -i --force-architecture dmd_2.041-0_i386.deb

 Note that since the compiler is 32-bit, it only works with 32-bit 
 libraries.  You must therefore install the following packages:

 sudo apt-get install gcc-multilib g++-multilib libc6-i386 libc6-dev-i386

 In addition, you might like to install the ia32-libs package, as it 
 contains 32-bit versions of a bunch of libraries.

Thanks, I added this information to the install page: http://www.digitalmars.com/d/2.0/dmd-linux.html#installation

For completeness' sake you should probably also add a 'sudo' in front of 'dpkg'. I forgot that in my post. -Lars
Mar 19 2010
parent Walter Bright <newshound1 digitalmars.com> writes:
Lars T. Kyllingstad wrote:
 For completeness' sake you should probably also add a 'sudo' in front of 
 'dpkg'.  I forgot that in my post.

Ok.
Mar 19 2010