[dmd-internals] open dmd pull requests, oldest Feb 6, 2011

Benjamin Shropshire benjamin at precisionsoftware.us
Mon Mar 7 07:14:25 PST 2011


On Mar 6, 2011 3:37 PM, "Michel Fortin" <michel.fortin at michelf.com> wrote:
>
> Le 2011-03-06 à 17:51, Benjamin Shropshire a écrit :
>
> > On 03/06/2011 01:14 PM, Michel Fortin wrote:
> >> Le 2011-03-06 à 14:10, Don Clugston a écrit :
> >>
> >>> OTOH I don't know what to about the const(Object) ref pull request.
> >>> That will definitely take a long time to evaluate.
> >> Indeed, and I don't expect it to be integrated as fast as a normal pull
request. It's fine for a more complicated patch to take longer to review.
Don't hesitate to merge smaller ones first even if mine is older. Still, I
hope someone looks at it eventually.
> >>
> >> Also, this pull request is small relatively to what I'm preparing
regarding integration of the Objective-C object model as
extern(Objective-C). In a way you could say I'm testing the process with
this smaller one first.
> >
> > Given that we now have three(?) extern(Foo)'s in play (if not in the
official version), should the API of what an extern looks like be
formalised? Might it even be done so that unofficial support for other
languages could be implemented as SO/DLL's without needing to rebuild dmd
>
> Great idea. Unfortunately, it can't be done with DMD as we have now. For
one thing, DMD would need to represent different linkage with different
classes which could be registered dynamically at runtime, currently it uses
a simple enum for that.
>
> But to give you an idea of what I'm doing inside DMD: I had to change the
backend a little so it can emit special Objective-C-reserved segments with
custom alignment, I had to change the parser to add a new keyword
(__selector) and a syntax for specifying selectors and even to parse the
"extern(Objective-C)" construct, I had to make strings literals implicitly
convertible to Objective-C's NSString literals and made some other type
implicitly convert to equivalents, I had to make 'static' functions virtual
functions belonging to the Objective-C metaclass (whether I should have
invented a new keyword for that is debatable), I had to create an implicit
nested class named "Class" in each class representing the metaclass and to
add the built-in property "this.class" to access the metaclass, I had to
implement dynamic casts of Objective-C objects, and a few other ticks like
that.
>

Aside from the parser changes, how much of that could be done with keyhole
overrides (e.g. the name mangleing function and variable/member layout) and
an extra set of augmentation passes (e.g. adding the nested Class and
accessor)?

> The result of my work is starting to take shape. I'm currently a little
stuck with memory management and finding a way to declare categories, but
overall it's already starting to become usable. I made my first Cocoa test
application last week.
>
> --
> Michel Fortin
> michel.fortin at michelf.com
> http://michelf.com/
>
>
>
> _______________________________________________
> dmd-internals mailing list
> dmd-internals at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-internals
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dmd-internals/attachments/20110307/7e343c5c/attachment.html>


More information about the dmd-internals mailing list