www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - "Learn to Tango with D" - The way to go?

reply AEon <aeon2001 lycos.de> writes:
I just now got "Learn to Tango with D" and was wondering what the 
thoughts of the more seasoned programmers are on the subject of Tango.


As far as I could find out Tango will only run with dmd v1.030, so I 
would not actually compare, Tango and Phobos under v1.030 but:

    Tango with dmd v1.030 - and - Phobos with dmd v2.014 alpha

I'd be very much interested in comments, what things were very useful or 
elegant in everyday use.


Is it actually possible to mix Phobos and Tango lib access? Because if 
Tango uses differently names function names, it would basically mean 
"rewriting" and Phobos centric code?


I have to admit I "have mixed feelings" about Tango, because my about 5K 
lines of code used Phobos, and Phobos is the original standard lib that 
came with D. So I feel like a traitor using or thinking  about using 
Tango. Strange that Kris Bell should "turn his back on Phobos" by 
promoting Tango in a book.

I am still trying to learn about the everyday use of Classes, and hope 
to learn it with D. So any library that has useful - mostly string 
operations, regular expressions (log parsing stuff) - is fine with me, 
since I don't really go for the "deep stuff", yet.

AEon
Sep 19 2008
next sibling parent reply "Jarrett Billingsley" <jarrett.billingsley gmail.com> writes:
On Fri, Sep 19, 2008 at 10:32 AM, AEon <aeon2001 lycos.de> wrote:
 I just now got "Learn to Tango with D" and was wondering what the thoughts
 of the more seasoned programmers are on the subject of Tango.


 As far as I could find out Tango will only run with dmd v1.030, so I would
 not actually compare, Tango and Phobos under v1.030 but:

   Tango with dmd v1.030 - and - Phobos with dmd v2.014 alpha

Probably a more fair comparison than Tango vs. Phobos 1, since Phobos 1 is really, really lacking in a lot of areas.
 I'd be very much interested in comments, what things were very useful or
 elegant in everyday use.


 Is it actually possible to mix Phobos and Tango lib access? Because if Tango
 uses differently names function names, it would basically mean "rewriting"
 and Phobos centric code?

No, not really. You can use Tangobos, but there's really no point in mixing Phobos code with Tango code, unless you just want to be irritating.
 I have to admit I "have mixed feelings" about Tango, because my about 5K
 lines of code used Phobos, and Phobos is the original standard lib that came
 with D. So I feel like a traitor using or thinking  about using Tango.
 Strange that Kris Bell should "turn his back on Phobos" by promoting Tango
 in a book.

If no one was ever dissatisfied with the way something was, nothing would ever improve. D only exists because W was dissatisfied with the systems languages available to him at the time. Tango exists because a large number of people were dissatisfied with the architecture and development model of Phobos. Besides -- what allegiance do you have to Phobos or to Walter? What have they done for you that you feel you must pay back? Isn't better to pick and choose what you feel to be the best than to stick with one "brand" due to loyalty?
 I am still trying to learn about the everyday use of Classes, and hope to
 learn it with D. So any library that has useful - mostly string operations,
 regular expressions (log parsing stuff) - is fine with me, since I don't
 really go for the "deep stuff", yet.

Then you might not notice too much difference between the libraries yet. Once you start wanting to do more complex things -- mounting archives as virtual filesystems, adding logging capabilities, piping process inputs/outputs, *not* allocating everything on the heap -- you'll come to appreciate Tango a bit more.
Sep 19 2008
next sibling parent Frank Benoit <keinfarbton googlemail.com> writes:
Jarrett Billingsley schrieb:
 No, not really.  You can use Tangobos, but there's really no point in
 mixing Phobos code with Tango code, unless you just want to be
 irritating.

I see tangobos as a tool for migration. So this mix can be very helpful. E.g. you can compile Poseidon with phobos or with tango+tangobos. That allows migration from old DWT to new DWT.
Sep 19 2008
prev sibling next sibling parent reply AEon <aeon2001 lycos.de> writes:
Jarrett Billingsley wrote:

 I have to admit I "have mixed feelings" about Tango, because my about 5K
 lines of code used Phobos, and Phobos is the original standard lib that came
 with D. So I feel like a traitor using or thinking  about using Tango.
 Strange that Kris Bell should "turn his back on Phobos" by promoting Tango
 in a book.

If no one was ever dissatisfied with the way something was, nothing would ever improve. D only exists because W was dissatisfied with the systems languages available to him at the time. Tango exists because a large number of people were dissatisfied with the architecture and development model of Phobos. Besides -- what allegiance do you have to Phobos or to Walter? What have they done for you that you feel you must pay back? Isn't better to pick and choose what you feel to be the best than to stick with one "brand" due to loyalty?

Call it a sense of foreboding. I just tried to install Tango and compile the first example hello1.d from the "Learn to Tango with D" book: hello1.d -------- import tango.io.Stdout; void main() { Stdout ("hello world").newline; } I cannot compile it under Windows XP Pro (SP3): --- E:\cygwin\home\Christoph\dt> dmd hello1.d OPTLINK (R) for Win32 Release 8.00.1 Copyright (C) Digital Mars 1989-2004 All rights reserved. hello1.obj(hello1) Error 42: Symbol Undefined _D5tango2io6Stdout6StdoutC5tango2io5Print12__T5PrintTaZ5Print hello1.obj(hello1) Error 42: Symbol Undefined _D5tango2io5Print12__T5PrintTaZ5Print5printMFYC5tango2io5Print12__T5PrintTaZ5Print hello1.obj(hello1) Error 42: Symbol Undefined _D5tango2io5Print12__T5PrintTaZ5Print7newlineMFZC5tango2io5Print12__T5PrintTaZ5Print --- errorlevel 3 --- I tried both the "Easy D" install (dmd-win32snaphot-0.6.2.exe; that contains Tango along with other libs), and also the manual Windows install (tango-0.99.7-bin-win32-dmd.1.033.zip) but the compiler error persists. I followed the http://dsource.org/projects/tango/wiki/WindowsInstall instructions... All to no avoid. None of this was any problem using the zip with DMD v1.030 using Phobos ;) Hopefully someone can help. AEon
Sep 19 2008
next sibling parent reply torhu <no spam.invalid> writes:
AEon wrote:
 Call it a sense of foreboding. I just tried to install Tango and compile 
 the first example hello1.d from the "Learn to Tango with D" book:
 
 hello1.d
 --------
 import tango.io.Stdout;
 void main()
 {
          Stdout ("hello world").newline;
 }
 
 
 I cannot compile it under Windows XP Pro (SP3):
 ---
 E:\cygwin\home\Christoph\dt> dmd hello1.d
 OPTLINK (R) for Win32  Release 8.00.1
 Copyright (C) Digital Mars 1989-2004  All rights reserved.
 hello1.obj(hello1)
   Error 42: Symbol Undefined 
 _D5tango2io6Stdout6StdoutC5tango2io5Print12__T5PrintTaZ5Print
 hello1.obj(hello1)
   Error 42: Symbol Undefined 
 _D5tango2io5Print12__T5PrintTaZ5Print5printMFYC5tango2io5Print12__T5PrintTaZ5Print
 hello1.obj(hello1)
   Error 42: Symbol Undefined 
 _D5tango2io5Print12__T5PrintTaZ5Print7newlineMFZC5tango2io5Print12__T5PrintTaZ5Print
 --- errorlevel 3
 ---
 
 I tried both the "Easy D" install (dmd-win32snaphot-0.6.2.exe; that 
 contains Tango along with other libs), and also the manual Windows 
 install (tango-0.99.7-bin-win32-dmd.1.033.zip) but the compiler error 
 persists.
 
 I followed the
      http://dsource.org/projects/tango/wiki/WindowsInstall
 instructions...

You're not linking with tango-user-dmd.lib. How to do that is in those instructions.
Sep 19 2008
next sibling parent AEon <aeon2001 lycos.de> writes:
torhu wrote:
 AEon wrote:
 I tried both the "Easy D" install (dmd-win32snaphot-0.6.2.exe; that 
 contains Tango along with other libs), and also the manual Windows 
 install (tango-0.99.7-bin-win32-dmd.1.033.zip) but the compiler error 
 persists.

 I followed the
      http://dsource.org/projects/tango/wiki/WindowsInstall
 instructions...

You're not linking with tango-user-dmd.lib. How to do that is in those instructions.

I thought I had added "-L+tango-user-dmd.lib" to the dmd\bin\sc.ini's DFLAGS line. Obviously not. Compile works now. Thank you.
Sep 19 2008
prev sibling parent Sean Kelly <sean invisibleduck.org> writes:
torhu wrote:
 AEon wrote:
 Call it a sense of foreboding. I just tried to install Tango and 
 compile the first example hello1.d from the "Learn to Tango with D" book:

 hello1.d
 --------
 import tango.io.Stdout;
 void main()
 {
          Stdout ("hello world").newline;
 }


 I cannot compile it under Windows XP Pro (SP3):
 ---
 E:\cygwin\home\Christoph\dt> dmd hello1.d
 OPTLINK (R) for Win32  Release 8.00.1
 Copyright (C) Digital Mars 1989-2004  All rights reserved.
 hello1.obj(hello1)
   Error 42: Symbol Undefined 
 _D5tango2io6Stdout6StdoutC5tango2io5Print12__T5PrintTaZ5Print
 hello1.obj(hello1)
   Error 42: Symbol Undefined 
 _D5tango2io5Print12__T5PrintTaZ5Print5printMFYC5tango2io5Print
2__T5PrintTaZ5Print 

 hello1.obj(hello1)
   Error 42: Symbol Undefined 
 _D5tango2io5Print12__T5PrintTaZ5Print7newlineMFZC5tango2io5Print
2__T5PrintTaZ5Print 

 --- errorlevel 3
 ---

 I tried both the "Easy D" install (dmd-win32snaphot-0.6.2.exe; that 
 contains Tango along with other libs), and also the manual Windows 
 install (tango-0.99.7-bin-win32-dmd.1.033.zip) but the compiler error 
 persists.

 I followed the
      http://dsource.org/projects/tango/wiki/WindowsInstall
 instructions...

You're not linking with tango-user-dmd.lib. How to do that is in those instructions.

That lib is linked automatically with the official binary release. Unless you have a separate version of DMD installed somewhere else as well, I have no idea why the .zip distro would have given you link errors. Sean
Sep 19 2008
prev sibling next sibling parent AEon <aeon2001 lycos.de> writes:
Jarrett Billingsley wrote:

 I think you probably have to use a build tool, like DSSS/rebuild or bud.

Yes that was probably the way the DFLAGS options in the "Easy D" install where meant to be used. Will try those. I seem to be too old-fashioned, i.e. using either the console directly or a makefile later on. For now "-L+tango-user-dmd.lib" to the dmd\bin\sc.ini's DFLAGS line does the job. The fast feedback in this community is beyond words. Thanks. AEon
Sep 19 2008
prev sibling parent "Chris R. Miller" <lordsauronthegreat gmail.com> writes:
AEon wrote:
 Jarrett Billingsley wrote:
 
 I have to admit I "have mixed feelings" about Tango, because my about 5K
 lines of code used Phobos, and Phobos is the original standard lib 
 that came
 with D. So I feel like a traitor using or thinking  about using Tango.
 Strange that Kris Bell should "turn his back on Phobos" by promoting 
 Tango
 in a book.

If no one was ever dissatisfied with the way something was, nothing would ever improve. D only exists because W was dissatisfied with the systems languages available to him at the time. Tango exists because a large number of people were dissatisfied with the architecture and development model of Phobos. Besides -- what allegiance do you have to Phobos or to Walter? What have they done for you that you feel you must pay back? Isn't better to pick and choose what you feel to be the best than to stick with one "brand" due to loyalty?

Call it a sense of foreboding. I just tried to install Tango and compile the first example hello1.d from the "Learn to Tango with D" book: hello1.d -------- import tango.io.Stdout; void main() { Stdout ("hello world").newline; } I cannot compile it under Windows XP Pro (SP3): --- E:\cygwin\home\Christoph\dt> dmd hello1.d OPTLINK (R) for Win32 Release 8.00.1 Copyright (C) Digital Mars 1989-2004 All rights reserved. hello1.obj(hello1) Error 42: Symbol Undefined _D5tango2io6Stdout6StdoutC5tango2io5Print12__T5PrintTaZ5Print hello1.obj(hello1) Error 42: Symbol Undefined _D5tango2io5Print12__T5PrintTaZ5Print5printMFYC5tango2io5Print 2__T5PrintTaZ5Print hello1.obj(hello1) Error 42: Symbol Undefined _D5tango2io5Print12__T5PrintTaZ5Print7newlineMFZC5tango2io5Print 2__T5PrintTaZ5Print --- errorlevel 3 --- I tried both the "Easy D" install (dmd-win32snaphot-0.6.2.exe; that contains Tango along with other libs), and also the manual Windows install (tango-0.99.7-bin-win32-dmd.1.033.zip) but the compiler error persists.

EH??? I've personally run Tango code from that installation image. Are you using the open_shell.bat file? 'Cause that's how it looks up the compiler. I seriously doubt that you are correctly using the snapshot if it didn't work. I suppose it's my fault for not getting off my butt and recording a screencast to show you how it's really done... Sometimes a video is worth a thousand tutorial documents.
Sep 19 2008
prev sibling parent "Chris R. Miller" <lordsauronthegreat gmail.com> writes:
Jarrett Billingsley wrote:
 If no one was ever dissatisfied with the way something was, nothing
 would ever improve.  D only exists because W was dissatisfied with the
 systems languages available to him at the time.  Tango exists because
 a large number of people were dissatisfied with the architecture and
 development model of Phobos.  Besides -- what allegiance do you have
 to Phobos or to Walter?  What have they done for you that you feel you
 must pay back?  Isn't better to pick and choose what you feel to be
 the best than to stick with one "brand" due to loyalty?

Personally I view continuing work with Tango as perpetuating the spirit of D. I also have come to the viewpoint that Phobos is more or less the experimental library and that Tango is used for the more stable releases. So Phobos is used to develop the language, and Tango is used to develop programs. My $0.02, at least. I haven't been here long (coming up on nine months), so my perception of the status quo is ever changing.
Sep 19 2008
prev sibling parent "Jarrett Billingsley" <jarrett.billingsley gmail.com> writes:
On Fri, Sep 19, 2008 at 4:27 PM, AEon <aeon2001 lycos.de> wrote:
 Jarrett Billingsley wrote:

 I have to admit I "have mixed feelings" about Tango, because my about 5K
 lines of code used Phobos, and Phobos is the original standard lib that
 came
 with D. So I feel like a traitor using or thinking  about using Tango.
 Strange that Kris Bell should "turn his back on Phobos" by promoting
 Tango
 in a book.

If no one was ever dissatisfied with the way something was, nothing would ever improve. D only exists because W was dissatisfied with the systems languages available to him at the time. Tango exists because a large number of people were dissatisfied with the architecture and development model of Phobos. Besides -- what allegiance do you have to Phobos or to Walter? What have they done for you that you feel you must pay back? Isn't better to pick and choose what you feel to be the best than to stick with one "brand" due to loyalty?

Call it a sense of foreboding. I just tried to install Tango and compile the first example hello1.d from the "Learn to Tango with D" book: hello1.d -------- import tango.io.Stdout; void main() { Stdout ("hello world").newline; } I cannot compile it under Windows XP Pro (SP3): --- E:\cygwin\home\Christoph\dt> dmd hello1.d OPTLINK (R) for Win32 Release 8.00.1 Copyright (C) Digital Mars 1989-2004 All rights reserved. hello1.obj(hello1) Error 42: Symbol Undefined _D5tango2io6Stdout6StdoutC5tango2io5Print12__T5PrintTaZ5Print hello1.obj(hello1) Error 42: Symbol Undefined _D5tango2io5Print12__T5PrintTaZ5Print5printMFYC5tango2io5Print12__T5PrintTaZ5Print hello1.obj(hello1) Error 42: Symbol Undefined _D5tango2io5Print12__T5PrintTaZ5Print7newlineMFZC5tango2io5Print12__T5PrintTaZ5Print --- errorlevel 3 --- I tried both the "Easy D" install (dmd-win32snaphot-0.6.2.exe; that contains Tango along with other libs), and also the manual Windows install (tango-0.99.7-bin-win32-dmd.1.033.zip) but the compiler error persists. I followed the http://dsource.org/projects/tango/wiki/WindowsInstall instructions... All to no avoid. None of this was any problem using the zip with DMD v1.030 using Phobos ;) Hopefully someone can help. AEon

I think you probably have to use a build tool, like DSSS/rebuild or bud.
Sep 19 2008