A little of coordination for Rosettacode
bearophile
bearophileHUGS at lycos.com
Wed Jan 15 16:18:22 PST 2014
qznc:
> I just made some scripts [0] to download and compile all D
> examples from Rosettacode. From 186 of 716 examples fail to
> compile [1]. Some for trivial reasons like not wrapped into a
> main function or a missing import. Some require SDL or Tango or
> other third-party libraries.
>
> My ultimate goal was to use this for regression testing dmd.
> Anyways if people try code examples they should compile out of
> the box for good PR.
>
> If you are looking for a low-barrier way to support D a little,
> feel free to check out the fail list [1] and fix some. :)
>
> [0]
> https://bitbucket.org/qznc/rosetta/src/da12e3673b0d/compile_all/?at=master
> [1] https://gist.github.com/qznc/9ba4b0e78abfc35d4694
I am using similar scripts written in Python since years.
Currently there are around 760-770 D programs in Rosettacode.
What version of the D compiler are you using? I am assuming
Rosettacode to be compilable with the latest "bleeding edge"
compiler. So if you use the latest released compiler some of the
entries will not compile. Such entries should not be "fixed" at
all.
Your list of failing to compile just say "fail", but there are
several reasons for a program to fail.
Some programs need a "modulename_main" version to be compiled,
because D lacks a built-in way to tell apart the main module of a
program from the other modules. (In Python you use the "if
__name__ == '__main__':" for this purpose).
Some programs don't compile because require Tango. I have not
removed them all because some Tango programmer has written them
and I guess such person doesn't like to see their work removed
from the pages.
Some entries don't compile because they are not yet updated, or
dmd has had some regressions. Thankfully Kenji usually fixes such
regressions in just few days when I find them.
Bye,
bearophile
More information about the Digitalmars-d-learn
mailing list