Objective-D, reflective programming, dynamic typing
Michel Fortin
michel.fortin at michelf.com
Sat Apr 4 20:39:05 PDT 2009
On 2009-04-03 08:43:48 -0400, Eljay <eljay at adobe.com> said:
> Hi Michel,
>
> Thanks for the tip on D-style variadic. I'll give those a spin.
>
> And you are spot on with what I want to be able to do. Objective-C,
> with C replaced by D. (Hmmm, I think #1 slipped in from my Borland
> CScript days.)
I'm not exactly sure of what you're trying to do, but perhaps, if
you're on a Mac, you'd be interested in trying the D/Objective-C bridge
I've made. By binding D member functions to Objective-C methods, it
becomes possible to call the function by knowing its Objective-C name
and argument types using objc.msg.send. Type safety is minimal at the
moment, but that could be changed by using Objective-C's reflection's
mecanism.
<http://michelf.com/projects/d-objc-bridge/>
. . .
And if compatibility with existing Objective-C code is not desired, it
should be possible to reuse some parts of the bridge binding system,
replicate the Objective-C runtime method dispatch and get a pretty
decent speed out of it (2x the time of a standard virtual call would be
a realistic goal according to my Objective-C benchmarks).
--
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/
More information about the Digitalmars-d
mailing list