Re: Utah Valley University teaches D (using TDPL)

2010-11-21 Thread Sean Kelly
Fawzi Mohamed fa...@gmx.ch wrote:
 On 18-nov-10, at 09:11, Don wrote:
 
 Jonathan M Davis wrote:
 On Tuesday, November 16, 2010 13:33:54 bearophile wrote:
 Jonathan M Davis:
 Most of the rest (if not all of it) could indeed be done in a 
  library.
 I am not sure it could be done nicely too :-)
 That would depend on what you're trying to do. Printing test  
   success or failure is as simple as adding the approprate scope  
   statement to the beginning of each unittest block. A bit tedious 
perhaps, but not hard.
 Right now
 unit tests follow the unix convention of saying nothing on
 success,
 That's an usability failure. Humans expect feedback, because you 
 can't tell
 apart unittests run and succeed from unittests not even run. 
 That Unix
 convention is bad here. And Unix commands sometimes have a -v  
(verbose)
 command that gives feedback, while D unittests don't have this  
option.
 I'm afraid that I have to disagree there. Having all of the  
   successes print out would, in many cases, just be useless output 
flooding the console. I have no problem with making it possible
 for   unit tests to report success, but I wouldn't want that
 to be the   default. It's quite clear when a test fails, and
 that's what is   necessary in order to fix test failures.
 I can see why a beginner might want the positive feedback that a  
   test has succeeded, but personally, I would just find it annoying.
 The only real advantage would be that it would indicate where
   in   the unit tests the program was, and that's only
   particularly   important if you have a _lot_ of them and they
   take a long time to   run.
 
 I think:   %d unit tests passed in %d modules
 would be enough.
 
 This was already discussed, I think that optimal solution would be to 
 have a testing function a bit like tangos, the testing functions knows
  how the module is called. Tango one always prints the module, but
 that  is easy to change.
 
 What I use is my own testing framework, in it i have defined as 
 default main function that checks commandline arguments, so that one 
 can for example pass --print-level=error and see only the errors...
 See http://dsource.org/projects/blip/wiki/BlipOverview for an example 
 of using it.
 This means having a special file to compile, that generates an 
 executable dedicated to testing, but this maps well to how I do tests.
 In fact I often keep the tests separated from the code, I even hide 
 them behind templates to avoid excessive template instantiation in 
 some cases because they are large and would slow down the
 compilation...
 
 The current default unittest function runs very early (before main), 
 so it is not possible to use that and use commandline arguments (which
  is correct because in the current model unittests can be activated 
 for *any* executable, and should not disturb its run).
 It should be possible to write a test function that just sets up 
 things for a later real unittest run that starts from main and can 
 parse the commandline arguments, thus solving all these discussions...

You can access the commandline args via Runtime.args. This works within
unittests.


Announcing: D support in SWIG

2010-11-21 Thread klickverbot
In a nutshell, SWIG is a »glue code« generator, allowing you to access 
C/C++ libraries from various target languages, including C#, Go, Java, 
Ruby, Python … and, since I merged my work into SWIG trunk a few days 
ago, also D, both version 1 and 2.


I have put up a short description of it at my blog 
(http://klickverbot.at/blog/2010/11/announcing-d-support-in-swig/), but 
to give it a whirl, just head over to the SWIG SVN and build it from 
there (http://swig.org/svn.html).


I would be glad if some brave souls could go ahead and test it in 
real-world use cases before it is officially released with SWIG for the 
first time (SWIG 2.0.2, date yet to be determined), so that any major 
bugs can be ironed out before.


If you have any questions or suggestions, feel free to post them here, 
drop me a line, or ask right away in #D at freenode. While I am quite 
busy at the moment, I'd be happy to help you with any issues 
(particularly happy if they concern the SWIG side of implementing 
enhancements, obviously, but also simple usage questions). Besides that, 
as always, it would be nice just to hear about what you are using this for.


Happy coding,
David


Build a D project is now easy

2010-11-21 Thread bioinfornatics
hello community,
I have start a project for generate easily a build system for D project. 
Currently in d world everyone use his own build system for build a new project 
with a new system is a bit hard for everyone, for debug  same thing. My tool 
generate
makefile system for your project in one command:
$ dmake --path src --lib src/myProject/
and for user he need ony do:
$ make
$ make install

At this time only works for build a library.
This system is usefull for support ldc, gdc and dmd compiler

You can found the project here: http://gitorious.org/dmake/dmake

Any help are welcome


Re: Announcing: D support in SWIG

2010-11-21 Thread BCS

Hello klickverbot,


In a nutshell, SWIG is a »glue code« generator, allowing you to access
C/C++ libraries from various target languages, including C#, Go, Java,
Ruby, Python . and, since I merged my work into SWIG trunk a few days
ago, also D, both version 1 and 2.



I'm so tempted to go learn Go so I can write a program that's half D, half 
Go and some SWIG to tie the two together.