Jump to page: 1 2
Thread overview
DMD/Objective-C Alpha 1
Jun 02, 2011
Michel Fortin
Jun 02, 2011
Walter Bright
Jun 02, 2011
bearophile
Jun 02, 2011
Michel Fortin
Jun 02, 2011
bearophile
Jun 02, 2011
Michel Fortin
Jun 02, 2011
KennyTM~
Jun 02, 2011
Robert Clipsham
Jun 02, 2011
Robert Clipsham
Jun 02, 2011
Michel Fortin
Jun 02, 2011
Robert Clipsham
Jun 02, 2011
Michel Fortin
Jun 02, 2011
Robert Clipsham
Jun 02, 2011
Jacob Carlborg
Jun 02, 2011
Robert Clipsham
Jun 02, 2011
Daniel Gibson
Jun 02, 2011
Jacob Carlborg
Jun 02, 2011
Jacob Carlborg
Jun 02, 2011
Jacob Carlborg
June 02, 2011
It's been some time since I announced I'd be attempting to hack the official D compiler to implement support for the Objective-C object model, with the ultimate goal to write Cocoa apps entirely in D. I spent about 160 hours on this project since the announcement last September, and now I'm pleased to have a first version to release.

You can get it there:
<http://michelf.com/projects/d-objc/>

It's just the beginning. As the documentation says there is still a lot of things to implement, and there will be more bugs to fix after that. But it's nevertheless always good to make a first release of a project.

It's also good to know you're not working alone. Jacob Carlborg has an automated binding generator in the works. Hopefully this will allow us to provide declarations for most of Cocoa soon.

If you want to help in some way, let me know.


-- 
Michel Fortin
michel.fortin@michelf.com
http://michelf.com/

June 02, 2011
On 6/1/2011 6:54 PM, Michel Fortin wrote:
> It's just the beginning. As the documentation says there is still a lot of
> things to implement, and there will be more bugs to fix after that. But it's
> nevertheless always good to make a first release of a project.

It's awesome that you're working on this.
June 02, 2011
On 6/1/11 8:54 PM, Michel Fortin wrote:
> It's been some time since I announced I'd be attempting to hack the
> official D compiler to implement support for the Objective-C object
> model, with the ultimate goal to write Cocoa apps entirely in D. I spent
> about 160 hours on this project since the announcement last September,
> and now I'm pleased to have a first version to release.
>
> You can get it there:
> <http://michelf.com/projects/d-objc/>
>
> It's just the beginning. As the documentation says there is still a lot
> of things to implement, and there will be more bugs to fix after that.
> But it's nevertheless always good to make a first release of a project.
>
> It's also good to know you're not working alone. Jacob Carlborg has an
> automated binding generator in the works. Hopefully this will allow us
> to provide declarations for most of Cocoa soon.
>
> If you want to help in some way, let me know.

Grats!

https://twitter.com/#!/incomputable/status/76142361226387456

http://www.reddit.com/r/programming/comments/hpo10/dobjective_c_compiler_alpha_1/


Andrei

June 02, 2011
From the page:
>The ultimate goal is to merge the capabilities back into mainline DMD",

Do you want to add a syntax like this to D/DMD?

void insertItem(ObjcObject object, NSInteger value) [insertItemWithObjectValue:atIndex:];

Bye,
bearophile
June 02, 2011
On 2011-06-02 05:30:10 -0400, bearophile <bearophileHUGS@lycos.com> said:

> From the page:
>> The ultimate goal is to merge the capabilities back into mainline DMD",
> 
> Do you want to add a syntax like this to D/DMD?
> 
> void insertItem(ObjcObject object, NSInteger value) [insertItemWithObjectValue:atIndex:];

Well, that's what I'd like. Given that you can't hide completely selectors as an implementation detail and that programmers might need to specify them from time to time -- which is all the time when declaring extern Objective-C classes! -- I thought it'd be very much appreciated if the syntax for that wasn't too unreadable.

That said, if Walter doesn't like it I could change it to a more "standard" pragma syntax:

	pragma(objc_selector, "insertIdemWithObjectValue:atIndex:")
	void insertItem(ObjcObject object, NSInteger value);

It's more verbose and less readable, but it'd work too.

-- 
Michel Fortin
michel.fortin@michelf.com
http://michelf.com/

June 02, 2011
On 02/06/2011 02:54, Michel Fortin wrote:
> It's been some time since I announced I'd be attempting to hack the
> official D compiler to implement support for the Objective-C object
> model, with the ultimate goal to write Cocoa apps entirely in D. I spent
> about 160 hours on this project since the announcement last September,
> and now I'm pleased to have a first version to release.
>
> You can get it there:
> <http://michelf.com/projects/d-objc/>
>
> It's just the beginning. As the documentation says there is still a lot
> of things to implement, and there will be more bugs to fix after that.
> But it's nevertheless always good to make a first release of a project.
>
> It's also good to know you're not working alone. Jacob Carlborg has an
> automated binding generator in the works. Hopefully this will allow us
> to provide declarations for most of Cocoa soon.
>
> If you want to help in some way, let me know.

This is pretty cool! I'd test it, but D for XCode doesn't seem to play well with XCode 4, and my XCode 3 installation appears to have disappeared since I installed 4. Will the complete OS X toolchain work with this eventually? (Interface builder, instruments etc)

-- 
Robert
http://octarineparrot.com/
June 02, 2011
On 02/06/2011 12:49, Robert Clipsham wrote:
> This is pretty cool! I'd test it, but D for XCode doesn't seem to play
> well with XCode 4, and my XCode 3 installation appears to have
> disappeared since I installed 4. Will the complete OS X toolchain work
> with this eventually? (Interface builder, instruments etc)

Does this mean in the not too distant future we'll be able to write iPhone apps in D? :o

-- 
Robert
http://octarineparrot.com/
June 02, 2011
On 2011-06-02 07:49:25 -0400, Robert Clipsham <robert@octarineparrot.com> said:

> This is pretty cool! I'd test it, but D for XCode doesn't seem to play well with XCode 4, and my XCode 3 installation appears to have disappeared since I installed 4. Will the complete OS X toolchain work with this eventually? (Interface builder, instruments etc)

Current state the OSX toolchain:

- Problems getting gdb recognize debug symbols. Perhaps this can be alleviated by replacing gdb with a fresh GNU version instead of Apple's... I haven't tested. Ideally, DMD would generate symbols that Apple's gdb understands.

- Half-baked Xcode 4 support in D for Xcode. You can rely on Xcode 3 in the meanwhile. Given the Xcode plugin API is private and undocumented, it's not as trivial as it should be.

- It might be nice to add a D parser to Interface Builder so it automatically recognize outlets and actions in D files that have Objective-C objects (thanks to D/Objective-C). I'd guess this is a private API too, but I haven't verified. Not having that is just an inconvenience however, since you can always add them manually in the IB file too.

- I don't think you need to do anything for Instruments (and the underlying dtrace) to work with D code... except perhaps make debug symbols work so stack traces include line numbers. Perhaps one would want to create a custom instrument to observe the GC in druntime.

I don't have much time to work on D for Xcode at the moment, mostly because I'm putting my spare time into developing D/Objective-C these days. But I'd be glad to accept pull requests for D for Xcode.
<https://github.com/michelf/d-for-xcode>


-- 
Michel Fortin
michel.fortin@michelf.com
http://michelf.com/

June 02, 2011
On 2011-06-02 07:50:20 -0400, Robert Clipsham <robert@octarineparrot.com> said:

> On 02/06/2011 12:49, Robert Clipsham wrote:
>> This is pretty cool! I'd test it, but D for XCode doesn't seem to play
>> well with XCode 4, and my XCode 3 installation appears to have
>> disappeared since I installed 4. Will the complete OS X toolchain work
>> with this eventually? (Interface builder, instruments etc)
> 
> Does this mean in the not too distant future we'll be able to write iPhone apps in D? :o

Define "not too distant". :-)

DMD doesn't have an ARM backend, so you'll need to port it to LDC or GDC. It might not be that easy however since a couple of parts are in the glue code that links to the DMD backend. But if you want to start working on LDC/Objective-C or GDC/Objective-C, I'll try to help.

The other issue is that it currently only support Apple's Legacy Objective-C runtime (used on 32-bit Mac OS X). iOS and 64-bit Mac OS X uses the Modern runtime which changed most of the ABI. I'll add support the Modern runtime eventually, but certainly not before DMD can emit 64-bit code on Mac OS X.

-- 
Michel Fortin
michel.fortin@michelf.com
http://michelf.com/

June 02, 2011
On 02/06/2011 13:55, Michel Fortin wrote:
> Define "not too distant". :-)
>
> DMD doesn't have an ARM backend, so you'll need to port it to LDC or
> GDC. It might not be that easy however since a couple of parts are in
> the glue code that links to the DMD backend. But if you want to start
> working on LDC/Objective-C or GDC/Objective-C, I'll try to help.

I thought this might be the case. Unfortunately I have a million things of my own to be working on, so I probably wouldn't have time to work on porting it.

> The other issue is that it currently only support Apple's Legacy
> Objective-C runtime (used on 32-bit Mac OS X). iOS and 64-bit Mac OS X
> uses the Modern runtime which changed most of the ABI. I'll add support
> the Modern runtime eventually, but certainly not before DMD can emit
> 64-bit code on Mac OS X.

That sounds like it's gonna be a big task! Good luck!


-- 
Robert
http://octarineparrot.com/
« First   ‹ Prev
1 2