"Andrej Mitrovic" <[email protected]> wrote in message 
news:[email protected]...
> On 6/12/11, Nick Sabalausky <[email protected]> wrote:
>> "Andrei Alexandrescu" <[email protected]> wrote in message
>> news:[email protected]...
>>>
>>> I've always wondered what's the methodology of changing ddmd from diffs 
>>> in
>>>
>>> dmd. I can only imagine it as a difficult manual process.
>>>
>>
>> I've recently asked about that on the DDMD forum. No response yet, but 
>> it's
>> not really a high-traffic forum anyway:
>> http://www.dsource.org/forums/viewtopic.php?t=5946&sid=4ece5dbd7a2352d5de1f61b14452733f
>>
>> As I said there: "I would guess that right strategy would be to compare 
>> two
>> versions of DMD (ie, the one DDMD is currently based on, and the one 
>> you're
>> trying to update to), and then recreate the changes in DDMD."
>>
>
> If you take a diff of DMD's parse.c and DDMD's parser.d, you'll see
> that they're almost identical. So yeah, I think what DDMD devs
> probably do is take a diff of two DMD versions and then manually
> upgrade DDMD's frontend to match. I don't think it's way too much work
> (I'm just assuming though), simple C++ code tends to translate nicely
> into D and I think DMD's C++ sources are nice and readable.

The AST is different though. I haven't compared the contents of the files, 
but a quick comparison of the directory contents suggests that DMD has many 
different AST classes in a single .h/.c combo (with a separate .h/.c combo 
for each "category" of AST class types), wheras DDMD splits all the AST 
types into their own separate .d files.

Also, since C++ and D syntax is naturally different, a file compare between 
a .c and .d would come up with a lot of "changes" that are just syntax 
differences and not real changes at all. I'd imagine there'd be a lot of 
that to sort through.


Reply via email to