Re: [RFC] Apple Blocks extension

2013-11-04 Thread Mike Stump
On Nov 3, 2013, at 8:28 PM, Maxim Kuvyrkov wrote: > Mike, as Obj-C/C++ front-end maintainers, would you be supportive of Blocks > extension implemented for Obj-C/C++ front-ends? Sure. Though, I'd really love a front-end extension to allow one to implement Blocks as a pure library. :-) [ duck

Re: [RFC] Apple Blocks extension

2013-11-04 Thread Mike Stump
On Nov 3, 2013, at 8:28 PM, Maxim Kuvyrkov wrote: > I am considering a project to add Apple's blocks [*] extension to GCC. I have a funny story about that one… I was just about ready to submit the work, the GPLv3 happened. Ah… life goes on.

Re: [RFC] Apple Blocks extension

2013-11-04 Thread Mike Stump
On Nov 3, 2013, at 8:49 PM, pins...@gmail.com wrote: > What benefits does blocks have over nested functions in C and over lambas in > C++? The ability to compile existing code. The ability to compile code that uses system header files on macosx. The ability to use third party libraries on mac

Re: [RFC] Apple Blocks extension

2013-11-04 Thread Jason Merrill
On 11/04/2013 11:34 AM, Joseph S. Myers wrote: On Mon, 4 Nov 2013, Maxim Kuvyrkov wrote: Joseph, Richard, as C front-end maintainers, would you be supportive of Blocks extension implemented for C front-end? Yes. I believe the point (or one of the points) is that at least some system headers

Re: [RFC] Apple Blocks extension

2013-11-04 Thread Torvald Riegel
On Mon, 2013-11-04 at 16:39 +, Joseph S. Myers wrote: > On Mon, 4 Nov 2013, Torvald Riegel wrote: > > > What is the status of this or similar features (eg, lambdas) in ISO C? > > IOW, what was the feedback on the blocks part of > > http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1370.pdf, and

Re: [RFC] Apple Blocks extension

2013-11-04 Thread Joseph S. Myers
On Mon, 4 Nov 2013, Torvald Riegel wrote: > What is the status of this or similar features (eg, lambdas) in ISO C? > IOW, what was the feedback on the blocks part of > http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1370.pdf, and are there > any follow-ups? IMHO, it would be preferable to suppor

Re: [RFC] Apple Blocks extension

2013-11-04 Thread Joseph S. Myers
On Mon, 4 Nov 2013, Maxim Kuvyrkov wrote: > Joseph, Richard, as C front-end maintainers, would you be supportive of > Blocks extension implemented for C front-end? Yes. I believe the point (or one of the points) is that at least some system headers in current Darwin require this extension (mor

Re: [RFC] Apple Blocks extension

2013-11-04 Thread Torvald Riegel
On Mon, 2013-11-04 at 17:28 +1300, Maxim Kuvyrkov wrote: > I am considering a project to add Apple's blocks [*] extension to GCC. I am > looking at adding blocks support to C, C++ and Obj-C/C++ front-ends. > > There are many challenges (both technical and copyright) that require work > before a

Re: [RFC] Apple Blocks extension

2013-11-04 Thread David Brown
On 04/11/13 06:18, pins...@gmail.com wrote: > > >> On Nov 3, 2013, at 9:10 PM, Ian Lance Taylor >> wrote: >> >>> On Sun, Nov 3, 2013 at 8:49 PM, wrote: >>> >>> On Nov 3, 2013, at 8:28 PM, Maxim Kuvyrkov wrote: Hi, I am considering a project to add Apple's bl

Re: [RFC] Apple Blocks extension

2013-11-04 Thread Florian Weimer
On 11/04/2013 06:10 AM, Ian Lance Taylor wrote: Clang's blocks are more powerful than GCC's nested functions, because blocks may be placed on the heap, and therefore returned from a function. And they don't need code generation at run time. -- Florian Weimer / Red Hat Product Security Team

Re: [RFC] Apple Blocks extension

2013-11-03 Thread pinskia
> On Nov 3, 2013, at 9:10 PM, Ian Lance Taylor wrote: > >> On Sun, Nov 3, 2013 at 8:49 PM, wrote: >> >> >>> On Nov 3, 2013, at 8:28 PM, Maxim Kuvyrkov wrote: >>> >>> Hi, >>> >>> I am considering a project to add Apple's blocks [*] extension to GCC. I >>> am looking at adding blocks sup

Re: [RFC] Apple Blocks extension

2013-11-03 Thread Ian Lance Taylor
On Sun, Nov 3, 2013 at 8:49 PM, wrote: > > >> On Nov 3, 2013, at 8:28 PM, Maxim Kuvyrkov wrote: >> >> Hi, >> >> I am considering a project to add Apple's blocks [*] extension to GCC. I am >> looking at adding blocks support to C, C++ and Obj-C/C++ front-ends. > > What benefits does blocks have

Re: [RFC] Apple Blocks extension

2013-11-03 Thread pinskia
> On Nov 3, 2013, at 8:28 PM, Maxim Kuvyrkov wrote: > > Hi, > > I am considering a project to add Apple's blocks [*] extension to GCC. I am > looking at adding blocks support to C, C++ and Obj-C/C++ front-ends. What benefits does blocks have over nested functions in C and over lambas in C+

[RFC] Apple Blocks extension

2013-11-03 Thread Maxim Kuvyrkov
Hi, I am considering a project to add Apple's blocks [*] extension to GCC. I am looking at adding blocks support to C, C++ and Obj-C/C++ front-ends. There are many challenges (both technical and copyright) that require work before any patches are ready for review, and I would appreciate indica

Re: apple blocks extension

2009-09-25 Thread Vincent R.
On Thu, 24 Sep 2009 12:53:04 -0400, Jason Merrill wrote: > On 09/24/2009 11:22 AM, Chris Lattner wrote: >> Can the lambda (containing X) be copied and put onto a queue? What is >> its type? > > As you said, the lambda has a unique anonymous type. If you want to put > multiple lambdas into a con

Re: apple blocks extension

2009-09-24 Thread Jason Merrill
On 09/24/2009 11:22 AM, Chris Lattner wrote: Can the lambda (containing X) be copied and put onto a queue? What is its type? As you said, the lambda has a unique anonymous type. If you want to put multiple lambdas into a container, you can use std::function as the element type. Jason

Re: apple blocks extension

2009-09-24 Thread Chris Lattner
On Sep 24, 2009, at 7:57 AM, Jason Merrill wrote: On 09/15/2009 12:35 PM, Chris Lattner wrote: The second major feature of Blocks vs c++ lambdas is that they can be "copied onto the heap". This allows things like "Grand Central Dispatch" to work: you can write code that executes blocks asyn

Re: apple blocks extension

2009-09-24 Thread Jason Merrill
On 09/15/2009 12:35 PM, Chris Lattner wrote: The second major feature of Blocks vs c++ lambdas is that they can be "copied onto the heap". This allows things like "Grand Central Dispatch" to work: you can write code that executes blocks asynchronously or on other threads/work queues (after the fu

Re: apple blocks extension

2009-09-16 Thread Linda A. Walsh
Chris Lattner wrote: > The first difference is that every instance of a lambda gives you a > value of a new (anonymous) type, which makes them mostly only useful > with templates. --- Ahh..didn't know that. That certainly would make them less useful in a general sense. I've only been expos

Re: apple blocks extension

2009-09-16 Thread Linda A. Walsh
Ian Lance Taylor wrote: > Mark Mitchell writes "I'd certainly check with the FSF > > before betting on that. " > True, though Apple's entry in the copyright file says "assigns past and > future changes" (I checked before the above e-mail). Certainly checking > with the FSF is a good idea. ---

Re: apple blocks extension

2009-09-16 Thread Dave Korn
Chris Lattner wrote: > On Sep 16, 2009, at 11:12 AM, Vincent R. wrote: >> While we are discussing apple extension, is there a list of apple >> specific extension about C and objective compiler ? > > There isn't anything good, but some information is available here: > http://clang.llvm.org/docs/L

Re: apple blocks extension

2009-09-16 Thread Chris Lattner
On Sep 16, 2009, at 11:12 AM, Vincent R. wrote: True, though Apple's entry in the copyright file says "assigns past and future changes" (I checked before the above e-mail). Certainly checking with the FSF is a good idea. Ian While we are discussing apple extension, is there a list of appl

Re: apple blocks extension

2009-09-16 Thread Vincent R.
On Wed, 16 Sep 2009 09:20:58 -0700, Ian Lance Taylor wrote: > Mark Mitchell writes: > >> Ian Lance Taylor wrote: >> >>> programs. So it seems to me that any changes that Apple makes to gcc >>> (or gdb, emacs, etc.) can simply be brought over by any interested >>> party. >> >> I'd certainly chec

Re: apple blocks extension

2009-09-16 Thread Ian Lance Taylor
Mark Mitchell writes: > Ian Lance Taylor wrote: > >> programs. So it seems to me that any changes that Apple makes to gcc >> (or gdb, emacs, etc.) can simply be brought over by any interested >> party. > > I'd certainly check with the FSF before betting on that. ISTR that some > copyright assig

Re: apple blocks extension

2009-09-16 Thread Mark Mitchell
Ian Lance Taylor wrote: > programs. So it seems to me that any changes that Apple makes to gcc > (or gdb, emacs, etc.) can simply be brought over by any interested > party. I'd certainly check with the FSF before betting on that. ISTR that some copyright assignments have a "contribution" step;

Re: apple blocks extension

2009-09-15 Thread Michael Meissner
On Tue, Sep 15, 2009 at 04:03:35PM +0200, Tristan Gingold wrote: > > On Sep 15, 2009, at 3:46 PM, Steven Bosscher wrote: > > > >Hi, > > > >The status is that there is no status, unfortunately (it's an > >interesting extension...). > > > >This extension is not presently implemented in the FSF GCC.

Re: apple blocks extension

2009-09-15 Thread Ian Lance Taylor
Ed Smith-Rowland <3dw...@verizon.net> writes: > In general, and this has come up before, there are other things in > Objective-C 2.0 that we don't have. IIRC the Apple trees left behind > are a little old and not in good shape. What are the licensing issues > for borrowing from LLVM leaving asid

Re: apple blocks extension

2009-09-15 Thread Chris Lattner
On Sep 15, 2009, at 9:04 AM, Richard Henderson wrote: On 09/15/2009 08:28 AM, Vincent R. wrote: I just was curious to know if closures in apple gcc(called blocks from what I read) is also in mainline. What is the status about this extension ? It is unlikely that this will ever be brought i

Re: apple blocks extension

2009-09-15 Thread Ed Smith-Rowland
Richard Henderson wrote: On 09/15/2009 08:28 AM, Vincent R. wrote: I just was curious to know if closures in apple gcc(called blocks from what I read) is also in mainline. What is the status about this extension ? It is unlikely that this will ever be brought into GCC, since it appears to be l

Re: apple blocks extension

2009-09-15 Thread Richard Henderson
On 09/15/2009 08:28 AM, Vincent R. wrote: I just was curious to know if closures in apple gcc(called blocks from what I read) is also in mainline. What is the status about this extension ? It is unlikely that this will ever be brought into GCC, since it appears to be largely identical to the C+

Re: apple blocks extension

2009-09-15 Thread Vincent R.
On Tue, 15 Sep 2009 16:03:35 +0200, Tristan Gingold wrote: > On Sep 15, 2009, at 3:46 PM, Steven Bosscher wrote: >> >> Hi, >> >> The status is that there is no status, unfortunately (it's an >> interesting extension...). >> >> This extension is not presently implemented in the FSF GCC. >> AFAIU th

Re: apple blocks extension

2009-09-15 Thread Tristan Gingold
On Sep 15, 2009, at 3:46 PM, Steven Bosscher wrote: Hi, The status is that there is no status, unfortunately (it's an interesting extension...). This extension is not presently implemented in the FSF GCC. AFAIU there is no reason to believe Apple will contribute patches to implement it. I t

Re: apple blocks extension

2009-09-15 Thread Dave Korn
Steven Bosscher wrote: > Is there even a formal spec for the language extension? I think it's http://clang.llvm.org/docs/BlockLanguageSpec.txt as that's the one they've referred to in their white paper (wg14/n1370). It's not written in your typical standardese as yet, though, from what I could

Re: apple blocks extension

2009-09-15 Thread Steven Bosscher
On Tue, Sep 15, 2009 at 3:28 PM, Vincent R. wrote: > Hi, > > I just was curious to know if closures in apple gcc(called blocks from > what I read) is > also in mainline. > What is the status about this extension ? Hi, The status is that there is no status, unfortunately (it's an interesting exte

apple blocks extension

2009-09-15 Thread Vincent R.
Hi, I just was curious to know if closures in apple gcc(called blocks from what I read) is also in mainline. What is the status about this extension ? Thanks