gcc 4.8.1 made it to Debian Sid

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Wed Jul 10 01:03:40 PDT 2013


On 07/10/2013 02:07 AM, H. S. Teoh wrote:
> I forked GDMD on github and took a first stab at D-ifying it:
> 
> 	https://github.com/quickfur/GDMD/tree/dport

Nice -- I'll try and have a play with that later :-)

First thing that strikes me -- and I know you're taking this from the original
script -- what's with the references to dmd.conf?  GDC has no dmd.conf that I
can recall (don't know whether it used to once upon a time), so this part of the
script may even be dangerous if it winds up trying to find a config file that
exists for dmd but not gdc/gdmd.

I'd have thought this could be deleted without problem.  If there _is_ a conf
script that needs using, it should be renamed to avoid potential clashes with
DMD proper.

> The new code is in gdmd.d -- I haven't updated the Makefile to build it
> yet, so you'll have to compile it by hand.  It can do very simple
> compiles now (list of .d files -> executable), including compile itself.
> :) It can read dmd.conf and setup environment variables accordingly,
> though I haven't actually tested whether it's really doing what I think
> it's doing.  (Anybody up for writing unittests? ;-))

I think that unittests can focus first on checking that gdmd input translates
into correct gdc output (as in, what you get right now running gdmd
--someoptions -vdmd).  That is, we can check each of the gdmd options singly and
ensure they translate to correct gdc call strings.

I'm not sure to what extent we'd need to test combinations of gdmd flags as
opposed to single flags.  There's also the whole bogeyman of contradictory flags
(e.g. one turns on the optimizations, one turns them off...).

> However, NO command-line options are parsed right now, so it can't
> handle anything beyond just a list of .d files.  I also haven't tested
> anything on Windows in spite of the version(Windows) blocks; so I've no
> idea if that code actually works.  But it's a start. :)

Start with an "unrecognized switch" error that applies to everything? :-)

If I recall right, Phobos has some flag-parsing stuff in there, so we should be
able to get that up and running fairly soon.

> I decided to write idiomatic D instead of a 1-to-1 translation of the
> Perl version, so I took some liberties in the program structure.  But I
> do use the Perl version as the go-to reference at each point, so it
> *should* in theory be identical in functionality at the end.

I think writing idiomatically from the get-go is a good idea.

> Comments / flames / pull requests welcome. ;-)

I'll be back with my big flaming torch and pitchfork after I've tested later
today ... ;-)

Thanks for getting this under way!

Best wishes,

    -- Joe


More information about the D.gnu mailing list