Migrating dmd to D?
Daniel Murphy
yebblies at nospamgmail.com
Tue Apr 2 07:16:47 PDT 2013
"Andrei Alexandrescu" <SeeWebsiteForEmail at erdani.org> wrote in message
news:kjenl8$1h4h$1 at digitalmars.com...
> On 4/2/13 9:34 AM, Daniel Murphy wrote:
>> Right now I'm up to 'get glue layer working' which needs 'allow C++
>> static
>> variables, member variables, static functions etc' which (for me) needs
>> 'move win32 C++ mangling into the frontend' which needs 'more free time'.
>> If anyone wants to have a go the plan is to just copy what the linux
>> version
>> does. (cppmangle.c)
>
> How did you solve the problem that virtual functions for a given class are
> spread out in several implementation files?
>
> Andrei
I'm not currently preserving file layout, so they are all merged into the
class definitions. It could also be done by generating forwarder functions
or changing the language to allow out-of-class function bodies, if keeping
the current organization is required. I'm not a fan of out-of-class bodies
but whatever is easiest.
Note that C++ code can still define the function bodies for extern(C++)
classes, so there is no problem for the various glue layers.
In the future I would prefer to introduce real visitor objects. The current
approach of virtual functions + state structs leads to a lot of duplication
for each pass that needs to walk the ast. (semantic, toObj, cppMangle,
toJson, apply, toChars, toCBuffer, interpret, toMangleBuffer, nothrow,
@safe, toDelegate etc)
More information about the Digitalmars-d
mailing list