digitalmars.D.learn - Examples using Tango
- Daren Scot Wilson (22/22) Dec 29 2010 I've been interested for a long time in learning D and using it for imag...
- Jesse Phillips (12/35) Dec 29 2010 32bit does run on a 64bit system. Work is being done for 64bit support i...
- bioinfornatics (8/8) Dec 29 2010 hi quick answer:
- Daren Scot Wilson (3/4) Dec 29 2010 Overall, it sounds like no one should be using D2 yet unless they have ...
- Jesse Phillips (2/10) Dec 29 2010 Well it shouldn't be naively used. But I and others have had little issu...
- bearophile (4/6) Dec 29 2010 I suggest to use D2 and help the improvement of Phobos :-)
- spir (11/14) Dec 30 2010 a=20
- Ellery Newcomer (3/8) Dec 30 2010 I do. I don't use DMD every day, but when I do I invariably have to
- bioinfornatics (1/1) Dec 31 2010 here i have written some example in d programming D1/tango: http://blog....
- Justin C Calvarese (23/46) Dec 29 2010 Have you tried these examples:
I've been interested for a long time in learning D and using it for image processing and physics number crunching. Now I've got a few days in a row to study. Unfortunately I'm getting stuck even with "Hello World" due to most examples of D I find seem to be using Phobos instead of Tango. Indeed, I'm not clear as to which is the best to use. For me, "best" is defined primarily as "it works on my machine" but secondarily I care about speed and ease of use. I'm using LDC (the llvm-based compiler) because it's 64-bit and maybe can handle D2. The D1/D2 doesn't matter a lot, though the statement "D version 2 which is recommended for new projects" on the home page sways me to use D2. But 64 bit is vital, since I want to work on huge arrays. The only limitation of LDC is apparently it works only with Tango. If I could rub a genie's lamp and have three wishes granted, they are: 1) Is it possible to get the source and compile Phobos for use with LVM? 2) Existing code examples should always indicate whether they use Tango or Phobos. Ideally, every example would be presented twice, once for each. This might be redundant or pointless for old-timers and D experts, but for newbies like me it would help avoid wasting time. 3) I'd like to see a translation page with two columns, Phobos and Tango, showing how to do the most common things we all need to do - printf() or whatever, basic binary file i/o, etc. There could be a third column for C or C++ to help us C++ programmers make the transition.
Dec 29 2010
Daren Scot Wilson Wrote:I've been interested for a long time in learning D and using it for image processing and physics number crunching. Now I've got a few days in a row to study. Unfortunately I'm getting stuck even with "Hello World" due to most examples of D I find seem to be using Phobos instead of Tango.http://www.dsource.org/projects/tango/wiki/ExamplesIndeed, I'm not clear as to which is the best to use. For me, "best" is defined primarily as "it works on my machine" but secondarily I care about speed and ease of use.32bit does run on a 64bit system. Work is being done for 64bit support in DMD. D2's Standard Library is still in flux. Several modules are deprecated and not properly marked. http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel#RoadmapI'm using LDC (the llvm-based compiler) because it's 64-bit and maybe can handle D2. The D1/D2 doesn't matter a lot, though the statement "D version 2 which is recommended for new projects" on the home page sways me to use D2. But 64 bit is vital, since I want to work on huge arrays. The only limitation of LDC is apparently it works only with Tango.http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial/StartingWithD/Compiler LDC is D1 Tango only. GDC has received updates to the latest versions of D1 and 2. There has been work on getting Phobos 2 to support 64bit, I don't know the issues with it or its status.If I could rub a genie's lamp and have three wishes granted, they are: 1) Is it possible to get the source and compile Phobos for use with LVM?You can find LDC source on Dsource.org though it won't be as simple as compiling it to get it working with Phobos.2) Existing code examples should always indicate whether they use Tango or Phobos. Ideally, every example would be presented twice, once for each. This might be redundant or pointless for old-timers and D experts, but for newbies like me it would help avoid wasting time.Most examples are posted to a Wiki page, please mark them as you find issues. Generally un-marked indicates D1 Phobos; marked as Tango means D1; marked as D2 means Phobos. Things are not well marked, but anyone can help. http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial/StartingWithD3) I'd like to see a translation page with two columns, Phobos and Tango, showing how to do the most common things we all need to do - printf() or whatever, basic binary file i/o, etc. There could be a third column for C or C++ to help us C++ programmers make the transition.http://www.prowiki.org/wiki4d/wiki.cgi?ComingFrom I have provided links that are close to the information you are looking for, or to guide you on finding the needed information.
Dec 29 2010
hi quick answer: 1/ for d1 prefer tango 2/ ldc could be use with phobos 3/ see tango home page on dsource they are several example 4/ tango d2 is not ready you can help source: git clone git://supraverse.net/tango.git (compile with d2 compiler and fix error if you want contribute) 5/ ldc source is not on dsource but bitbucket you will found ldc for * d1 https://bitbucket.org/lindquist/ldc * d2 https://bitbucket.org/prokhin_alexey/ldc2
Dec 29 2010
On 12/29/10 17:05, Jesse Phillips wrote:D2's Standard Library is still in flux. Several modules are deprecated and not properly marked.Overall, it sounds like no one should be using D2 yet unless they have a fetish for arrowhead wounds in their back.
Dec 29 2010
Daren Scot Wilson Wrote:On 12/29/10 17:05, Jesse Phillips wrote:Well it shouldn't be naively used. But I and others have had little issue using the languages for small projects, and some medium sized ones, without the rug disappearing for some time. But their is not handy, documentation really is limited though.D2's Standard Library is still in flux. Several modules are deprecated and not properly marked.Overall, it sounds like no one should be using D2 yet unless they have a fetish for arrowhead wounds in their back.
Dec 29 2010
Daren Scot Wilson:Overall, it sounds like no one should be using D2 yet unless they have a fetish for arrowhead wounds in their back.I suggest to use D2 and help the improvement of Phobos :-) Bye, bearophile
Dec 29 2010
On Thu, 30 Dec 2010 01:42:27 -0500 bearophile <bearophileHUGS lycos.com> wrote:a=20Overall, it sounds like no one should be using D2 yet unless they have=Well, I don't have this impression in practice. Sure, on D lists, we discus= s only the issues. But I use D2 everyday for a load of mini-apps or tools, = explorations, and a moderately big but complicated project.fetish for arrowhead wounds in their back. =20I suggest to use D2 and help the improvement of Phobos :-)Yop! Denis -- -- -- -- -- -- -- vit esse estrany =E2=98=A3 spir.wikidot.com
Dec 30 2010
On 12/30/2010 03:46 AM, spir wrote:On Thu, 30 Dec 2010 01:42:27 -0500 bearophile<bearophileHUGS lycos.com> wrote:I do. I don't use DMD every day, but when I do I invariably have to issue bug reports.Well, I don't have this impression in practice. Sure, on D lists, we discuss only the issues. But I use D2 everyday for a load of mini-apps or tools, explorations, and a moderately big but complicated project.Overall, it sounds like no one should be using D2 yet unless they have a fetish for arrowhead wounds in their back.
Dec 30 2010
here i have written some example in d programming D1/tango: http://blog.fedora-fr.org/bioinfornatics/
Dec 31 2010
== Quote from Daren Scot Wilson (darenw darenscotwilson.com)'s articleI've been interested for a long time in learning D and using it for image processing and physics number crunching. Now I've got a few days in a row to study. Unfortunately I'm getting stuck even with "Hello World" due to most examples of D I find seem to be using Phobos instead of Tango.Have you tried these examples: http://dsource.org/projects/tango/wiki/Tutorials (I'm not a Tango-user, but I'm pretty sure there are some good Tango examples on some web page.) If you'd be willing to spend some money, "Learn to Tango with D" is probably a good resource for learning Tango.Indeed, I'm not clear as to which is the best to use. For me, "best" is defined primarily as "it works on my machine" but secondarily I care about speed and ease of use. I'm using LDC (the llvm-based compiler) because it's 64-bit and maybe can handle D2. The D1/D2 doesn't matter a lot, though the statement "D version 2 which is recommended for new projects" on the home page sways me to use D2.If you want to stick with LDC/Tango, D2 isn't an option yet. I don't know if Tango will ever be ported to D2. Apparently LDC has experimental D2 support. According to its web page (http://dsource.org/projects/ldc): "D2 support is highly experimental (read: unusable)". It doesn't sound like a fun place for a new user to be IMHO.But 64 bit is vital, since I want to work on huge arrays. The only limitation of LDC is apparently it works only with Tango. If I could rub a genie's lamp and have three wishes granted, they are: 1) Is it possible to get the source and compile Phobos for use with LVM?I won't say it's impossible, but I suspect it's non-trivial since I haven't heard that anyone has done it yet.2) Existing code examples should always indicate whether they use Tango or Phobos. Ideally, every example would be presented twice, once for each. This might be redundant or pointless for old-timers and D experts, but for newbies like me it would help avoid wasting time.Since Tango and Phobos for D2 seem to be diverging rather than converging, it's going to be increasingly difficult to write examples that do the same thing using both libraries. The example writer would basically be writing the 2 different examples in many cases. Some library writers target both Phobos and Tango, and I suspect it can be very frustrating.3) I'd like to see a translation page with two columns, Phobos and Tango, showing how to do the most common things we all need to do - printf() or whatever, basic binary file i/o, etc. There could be a third column for C or C++ to help us C++ programmers make the transition.That's not a bad idea for someone to do, but it's 3 times the effort of a single D example and requires knowledge of C++. You may find this wiki page helpful: http://www.prowiki.org/wiki4d/wiki.cgi?ComingFrom/CPlusPlus If dearth of Tango examples is a big concern of yours, I'd suggest that you consider starting off with D1 with Phobos (or D2 with Phobos if you're more adventurous). I don't know how vital 64-bit support is for you in the near term, but I know that Walter is working on 64-bit support for DMD. I don't know if 64-bit will be available for DMD in a couple months or if it'll take 6 months, but I know that he's working on it. I don't know the state of 64-bit in GDC, but it may be farther along than DMD (or it may be fully supported already). Anyway, it's your decision, and I suspect some other people will post even better advice than my few comments here. Good luck! jcc7
Dec 29 2010