From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <5d375e920909070240x6b4dabe3x6c47ad11b303525f@mail.gmail.com> References: <5d375e920909030815n74e481f4yad9814f478db5a78@mail.gmail.com> <25CF9336-C071-44A5-AB04-6BB042BC5755@kix.in> <5d375e920909070240x6b4dabe3x6c47ad11b303525f@mail.gmail.com> Date: Tue, 8 Sep 2009 08:31:28 -0700 Message-ID: <3e1162e60909080831g728ced86wcd143865e37da2f9@mail.gmail.com> From: David Leimbach To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=000e0cd2c042010704047312a92e Subject: Re: [9fans] "Blocks" in C Topicbox-Message-UUID: 6a223858-ead5-11e9-9d60-3106f5b1d025 --000e0cd2c042010704047312a92e Content-Type: text/plain; charset=ISO-8859-1 On Mon, Sep 7, 2009 at 2:40 AM, Uriel wrote: > On Mon, Sep 7, 2009 at 11:05 AM, Greg Comeau wrote: > > In article <25CF9336-C071-44A5-AB04-6BB042BC5755@kix.in>, > > Anant Narayanan wrote: > >>I understand the argument that blocks don't "feel" C-like, but the > >>argument that you can do everything with just using function pointers > >>is BS. > > > > Even one step further, even if we all agree blocks are BS, > > As I was reading this thread I kept hearing inside my head boyd's > voice screaming this at frequent intervals: > > "Blocks are bollocks!" > > uriel > > > In case anyone is interested, I've got my concurrent prime sieve working just fine now (with help from Kevin Van Vechten at apple) using libdispatch, simulating the "actor model" by hooking up blocks to pipe fds. http://paste.lisp.org/display/86549#3 It turns out I don't need the semaphore and the counter either, because I can dynamically add stuff to groups, and then wait on that stuff to leave the group for synchronizing the program. Again this advice came from my buddy Kevin at apple. Having wrestled with this stuff a little bit, and written "something". I can immediately see how one can get away from needing to "select" in code so much, and fire off blocks to handle client server interactions etc. It's kind of neat. My understanding is that Apple is going through the process to open up the source to all of this stuff soon, and another friend of mine has already done his own version of blocks that works for the iPhone and Leopard, and another person is looking to make an API compatible with libdispatch readily available. I guess we'll see what happens. Dave --000e0cd2c042010704047312a92e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Mon, Sep 7, 2009 at 2:40 AM, Uriel <uriel99@gmail.com<= /a>> wrote:
On Mon, Sep 7, 2009 at 11:05 AM, Greg Comeau<comeau@panix.com> wrote:
> In article <25CF9336-C071-44A5-AB04-6BB042BC5755@kix.in>,
> Anant Narayanan <anant@kix.in&g= t; wrote:
>>I understand the argument that blocks don't "feel" C-= like, but the
>>argument that you can do everything with just using function pointe= rs
>>is BS.
>
> Even one step further, even if we all agree blocks are BS,

As I was reading this thread I kept hearing inside my head boyd's=
voice screaming this at frequent intervals:

"Blocks are bollocks!"

uriel


<= div>
In case anyone is interested, I've got my concurrent= prime sieve working just fine now (with help from Kevin Van Vechten at app= le) using libdispatch, simulating the "actor model" by hooking up= blocks to pipe fds. =A0


It turns out = I don't need the semaphore and the counter either, because I can dynami= cally add stuff to groups, and then wait on that stuff to leave the group f= or synchronizing the program. =A0Again this advice came from my buddy Kevin= at apple.

Having wrestled with this stuff a little bit, and writt= en "something". =A0I can immediately see how one can get away fro= m needing to "select" in code so much, and fire off blocks to han= dle client server interactions etc. =A0It's kind of neat.

My understanding is that Apple is going through the pro= cess to open up the source to all of this stuff soon, and another friend of= mine has already done his own version of blocks that works for the iPhone = and Leopard, and another person is looking to make an API compatible with l= ibdispatch readily available.

I guess we'll see what happens.

Dave


--000e0cd2c042010704047312a92e--