Are you worried that your Objective-C code is too fast? Too readable? Too maintainable? Well now you can fix that, by adding Python!
Attached is a diff against PyObjC that allows it to build with GNUstep[1]. This allows Python to use Objective-C objects, to subclass them, and to pass Python objects to Objective-C. There are still some bugs, but please try it, play with it, and see what breaks!
With PyObjC, it's trivial to export a Python interface for scripting your Objective-C code, so you can allow Python programmers to write plugins and so forth without needing to modify your Objective-C code.
This port was funded by Inverse: http://www.inverse.ca/.
David
[1] Tested with libobjc2 1.5, GNUstep-base and corebase from trunk on Linux/PowerPC and FreeBSD/x86.
Fred
I am not interested in Python, but looked over your changes to see what functionality is missing or different in GNUstep. One thing that I noticed was that this code expects that result of a copy operation on an NSMutableArray is a mutable array, and that on GNUstep you had to use mutableCopy. If this is true we should change the GNustep behaviour and add a test case for this.
Any other interesting stuff you found while working on this?
On 20.07.2011 19:15, David Chisnall wrote:
Hi Everyone,
Are you worried that your Objective-C code is too fast? Too readable? Too maintainable? Well now you can fix that, by adding Python!
Attached is a diff against PyObjC that allows it to build with GNUstep[1]. This allows Python to use Objective-C objects, to subclass them, and to pass Python objects to Objective-C. There are still some bugs, but please try it, play with it, and see what breaks!
With PyObjC, it's trivial to export a Python interface for scripting your Objective-C code, so you can allow Python programmers to write plugins and so forth without needing to modify your Objective-C code.
This port was funded by Inverse: http://www.inverse.ca/.
David
[1] Tested with libobjc2 1.5, GNUstep-base and corebase from trunk on Linux/PowerPC and FreeBSD/x86.
_______________________________________________
Discuss-gnustep mailing list
Discuss...@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
> On Thu, Jul 21, 2011 at 2:10 AM, Fred Kiefer <fredk...@gmx.de> wrote:
>> I am not interested in Python, but looked over your changes to see what functionality is missing or different in GNUstep. One thing that I noticed was that this code expects that result of a copy operation on an NSMutableArray is a mutable array, and that on GNUstep you had to use mutableCopy. If this is true we should change the GNustep behaviour and add a test case for this.
>> Any other interesting stuff you found while working on this?
>
> That's probably because NS(Mutable)Array objects in Cocoa are actually NSCFArray objects (due to the toll-free bridging mechanism), which can be either mutable or immutable.
I just tested it, and the GNUstep behaviour is correct. [NSMutableArray -copy] does return an immutable array:
NSMutableArray *a = [NSMutableArray new];
id b = [a copy];
[b addObject: @"foo"];
This terminates with an exception:
2011-07-21 13:17:19.940 a.out[15566:903] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '*** -[NSCFArray insertObject:atIndex:]: mutating method sent to immutable object'
So, it's probably one of the many bits in the PyObjC code that didn't work on GNUstep because it was Just Plain Wrong™ and shouldn't work on OS X either.
David
Hi Everyone,
Are you worried that your Objective-C code is too fast? Too readable? Too maintainable? Well now you can fix that, by adding Python!
Attached is a diff against PyObjC that allows it to build with GNUstep[1]. This allows Python to use Objective-C objects, to subclass them, and to pass Python objects to Objective-C. There are still some bugs, but please try it, play with it, and see what breaks!
With PyObjC, it's trivial to export a Python interface for scripting your Objective-C code, so you can allow Python programmers to write plugins and so forth without needing to modify your Objective-C code.
This port was funded by Inverse: http://www.inverse.ca/.
David
[1] Tested with libobjc2 1.5, GNUstep-base and corebase from trunk on Linux/PowerPC and FreeBSD/x86.
_______________________________________________
Discuss-gnustep mailing list
Discuss...@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
> Hi David,
>
> that's great! Will this be submitted upstream?
Ask Ludovic. I'm not sure if the plan is to merge it or for Inverse to maintain a GNUstep branch of PyObjC. I'd imagine the latter in the short term and the former in the longer term.
David
Ludo
Thanks for your contribution to GNUstep. It has been a long time since I
have seen you on the list.
Is there any chance of seeing GNUMail being updated to the latest
GNUstep?
Thanks,
Gerold
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss...@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep
--
Gerold Rupprecht <ger...@bluewin.ch>
10, rue Louis-Curval
CH-1206 Genève, Suisse
Mobile: +41 (0) 79 914 29 52
On 21/07/11 09:07, David Chisnall wrote:That patch should indeed be submitted upstream.
On 21 Jul 2011, at 14:04, Ivan Vučica wrote:
Hi David,Ask Ludovic. I'm not sure if the plan is to merge it or for Inverse to maintain a GNUstep branch of PyObjC. I'd imagine the latter in the short term and the former in the longer term.
that's great! Will this be submitted upstream?
Ludo
_______________________________________________
Discuss-gnustep mailing list
Discuss...@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
On Thursday, July 21, 2011 17:48 CEST, Gerold Rupprecht <ger...@bluewin.ch> wrote:
> Hi Ludovic,
>
> Thanks for your contribution to GNUstep. It has been a long time since I
> have seen you on the list.
>
> Is there any chance of seeing GNUMail being updated to the latest
> GNUstep?
In case of GNUmail, and Pantomime, I have a couple of patches in the OpenBSD ports tree, that make GNUmail work fairly well. You can find the patches here:
http://www.openbsd.org/cgi-bin/cvsweb/ports/x11/gnustep/pantomime/patches/
http://www.openbsd.org/cgi-bin/cvsweb/ports/x11/gnustep/gnumail/patches/
I'd also love to see new releases of both, to get rid of all the patches from the ports tree. Since the last release was looong time ago, I did not bothered you regarding a new release. But now, I take the opportunity ;)
cheers,
Sebastian
>
> Thanks,
>
> Gerold
>
> On Thu, 2011-07-21 at 10:02 -0400, Ludovic Marcotte wrote:
> > On 21/07/11 09:07, David Chisnall wrote:
> > > On 21 Jul 2011, at 14:04, Ivan Vučica wrote:
> > >
> > >> Hi David,
> > >>
> > >> that's great! Will this be submitted upstream?
> > > Ask Ludovic. I'm not sure if the plan is to merge it or for Inverse to maintain a GNUstep branch of PyObjC. I'd imagine the latter in the short term and the former in the longer term.
> > That patch should indeed be submitted upstream.
> >
> > Ludo
> >
> > _______________________________________________
> > Discuss-gnustep mailing list
> > Discuss...@gnu.org
> > https://lists.gnu.org/mailman/listinfo/discuss-gnustep
>
>
> --
I don't know of any such link, but I haven't looked hard. In any case, RubyCocoa is effectively abandoned in favour of the more sophisticated MacRuby; the RubyCocoa project hasn't seen any activity for a couple of years, and it's no longer supported in Xcode. Given that MacRuby has syntax enhancements for better integration and is being actively developed, it would be a better target.
--
Jens Ayton
We eventually want to use Pantomime in SOGo too - when that will happen,
I will probably personally start working again on GNUMail.
Thanks,
Regards,
There's a bug with the gcc 4.6 runtime since objc_getSuperClass() on a
newly allocated - but not registered - class returns nil. Some tests
will fail due to this.
There's also some bugs with the gcc runtimes, prior to 4.6 - probably
due to missing features.
In any case, here's the updated patch.
Regards,
Thanks, is there a msg_send_compat.h which was supposed to be included
with this patch?
I also have a complete example that I could send which shows SOGo
(www.sogo.nu) instantiating and class and invoking a method which is
provided by a Python script (class definition and the implementation of
that method).
Regards,
Thanks, unfortunately required some modifications,
apparently my constructor call order here is the opposite
of yours,
sure would be nice if +load would accept the constructor attribute
priority, or a gcc option to set the default priority at compile time.
# Load order is important here. Linking -corebase after -base causes a
# crash trying to register for a notification with a string that is not yet
# initialized.
OBJC_LDFLAGS = str(subprocess.Popen(["gnustep-config",
"--base-libs"], stdout=subprocess.PIPE).communicate()[0]).split()
OBJC_LDFLAGS.extend(["-lgnustep-corebase"])
Shouldn't this line:
#define objc_impMsgSendPtr ((IMP(*)(id,SEL,SEL))objc_msgSendSuper)
read something like this:
#define objc_impMsgSendSuperPtr ((IMP(*)(id,SEL,SEL))objc_msgSendSuper)