To add a bit more. From the presentation I got the impression that C# 4.0 currently has facilities very similar to java Executor and Future. Except that their Future (aka Task) can be listened to. So currently it is possible to write complex asynchronous dataflows as a series of invoking asynchronous tasks and adding a listener to the result. Since C# already has closures this is probably already less painful than the equivalent program would be in java but it is still complex and error prone.
The new await keyword allows you to program the dataflow as if you were making synchronous blocking calls to get the async task results. But instead of blocking the thread, the compiler generates code to create a kind of continuation. I suppose something similar would be possible in java by using a continuation framework like javaflow. - Neil On Nov 9, 5:33 pm, Neil Swingler <[email protected]> wrote: > I just saw a presentation on this and no closures won't solve everything. > Otherwise they wouldn't be changing a language that already has closures. For > sure closures make callback programming less painful but you still have the > inversion of control that makes complex flows hard to write. > > - Neil > > On 9 Nov 2010, at 14:27, Reinier Zwitserloot l<[email protected]> wrote: > > > > > > > > > Java holds backwards compatibility as sacrosanct, and its current > > designers know this. Therefore, they don't add features unless its > > clearly the best possible answer given existing constraints. As you > > just said, you're not entirely happy with this. It therefore wouldn't > > fit well in java. > > > That link (to tomasp.net) is down so I can't review the change, but > > this sounds like an issue where closures solve everything. Closures > > are coming, why add a stopgap measure that cannot be removed? > > > On Nov 9, 1:11 am, RogerV <[email protected]> wrote: > >> Yet another language evolution area where Microsoft's C#/VB languages > >> for .NET are racing on ahead to provide a solution within the language > >> itself. While Java, in the meantime, hasn't even managed to catch up > >> with them on the closures/lambdas feature. > > >> new await and async keywords > > >> Asynchronous Programming for C# and Visual > >> Basichttp://msdn.microsoft.com/en-us/vstudio/async.aspx > > >> I still like the Go language approach to async programming better, > >> though, than this. > > > -- > > You received this message because you are subscribed to the Google Groups > > "The Java Posse" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]. > > For more options, visit this group > > athttp://groups.google.com/group/javaposse?hl=en. -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
