Live data from Hacker News

Callbacks as our Generation's Goto Statement

tirania.org

211–220 of 287 posts

Re: Callbacks as our Generation's Goto Statement

#211
post #161

It's right that callback model sucks, and the task model is a way to go. Sadly, many developers when they hear the word "C# async" ... All of these statements are made by people that have yet to study C# async or to grasp what it does. But it's unpleasant to see the author is talking concept of task - lightweight threading, coroutine, or whatever - is like a patent of C# (or F#). And furthermore, treating many develo…

Have you read the article? It's not about tasks per se, it's about a code rewriter.

This article is about structural paradigm shift which foresaw for a long time from Actor model, Erlang, and recently to Go and Rust.

How is this just only an introduction to a new syntactic sugar?

Re: Callbacks as our Generation's Goto Statement

#212

Earlier quoted context omitted.

The issue I see is that with some libraries you either go 100% async or 100% sync with no middle ground.

This is simply not true. You can use any C# library without using async (code rewriter). You'd still be using Tasks but there is nothing special about them (no compiler magic). They're just futures on which you can schedule continuations.

I'm not talking about C#, but about libraries in other languages that support async behaviour

Re: Callbacks as our Generation's Goto Statement

#213

Earlier quoted context omitted.

Aren't you still American? ;) As an Indian I am confused why only people of the US are called Amerians while two entire continents are called America. And also, why we Indians are not considered Asians by the said Americans.

Because "America" is part of the nation's actual name, and the only part that isn't a modifier. What else could you call Americans? Unionized Statists?

I actually use the term "USian" quite frequently, but then I'm weird that way.

Re: Callbacks as our Generation's Goto Statement

#214
The only thing I’ve encountered in modern day programming which is really as evil as goto is aspect oriented programming (AOP). Maybe there are different implementations of AOP but in the one I’ve used you were basically able to hook into every method from everywhere and it was impossible to have any grasp on the flow of the program. That is besides using a debugger.

Re: Callbacks as our Generation's Goto Statement

#216
post #30

Earlier quoted context omitted.

The C# designers outdid themselves this time. I'm surprised they managed to made this feature so simple and succinct, especially for an "enterprise" language. Those two little words (async/await) seem like something I would expect from a language like Python or Ruby. Had it been Java, it would be called AsynchronousBureaucraticProccessDispatcherFactoryFactoryFactory.

F# implemented this many years before (6 years ago), and as a library , just by providing the proper language feature, workflows, and a default async implementation. In comparison, C# adds special compiler keywords for one specific example, just like they did with LINQ. That seems rather ugly IMO. Providing building blocks and letting libraries fill things in is a lot nicer. This is more of a "C#'s finally catching u…

On the other hand the state machine C# compiler generates is a lot more efficient than the IL an F# async workflow compiles to.

Re: Callbacks as our Generation's Goto Statement

#217
post #175

Earlier quoted context omitted.

C# 2 added generics (courtesy of the same people that did F#) and closures (albeit with syntax as verbose as JS). C# 3 added LINQ, which is a major breakthrough for end-users, although I'm not fond of the query language. So really, C# 3 just added in some basic features you expect from proper languages. I do understand this required a huge amount of work, esp. with the tooling required. C# 4 added dynamic (F# provide…

There are lots of work to do still on the CLR. - Improve the GC algorithms, most JVMs have better GC algorithms - Improve the code quality of the JIT and NGEN compilers, specially the set of applied optimizations - Expose auto-vectorization and vector instructions (similar to Mono.SIMD) - Expose something like C++ AMP on .NET. Some of this was slightly improved on 4.5, but they could do more.

Actually the CLR GC vastly outperforms the Oracle JVM GC in many scenarios, like a native Win app.

Re: Callbacks as our Generation's Goto Statement

#218

There is some creative use of C# async/await in this blogpost: http://praeclarum.org/post/45277337108/await-in-the-land-of-... Basically, the author implements a “first time walkthrough” kind of interface a-la iWork very declaratively by using async: async Task ShowTheUserHowToSearch () { await Tutorial.EnterText (searchField, minLength: 3); await Tutorial.Tap (searchButton); await Tutorial.Congratulate ("Now you kno…

What if you have two buttons, search and 'be lucky'? I guess you will have to await for a controller object that wakes up that if either one of the buttons is triggered, and then test what button was pressed. Now what if you have add a search option dialog that can be invoked at any moment? I guess when the 'apply' button of the option dialog got pressed then this is still going to be a callback that sets global vari…

Surely async isn't meant to replace events—it's just in some cases, when you expect events to happen in particular order, such as in help tutorial, async gives an advantage.

Re: Callbacks as our Generation's Goto Statement

#219
post #116

Earlier quoted context omitted.

Why do you as an American feel the need to invoke some dead german left-wing militants in a pseudo-religious phrase that's meaningless except maybe for shock value? This seems highly inapproriate for any website and even more so on HN.

It's not clear if you know or not, but it's the common name of http://en.wikipedia.org/wiki/List_of_cognitive_biases#Freque...

Thanks, no, I wasn't aware of that oddity.

Re: Callbacks as our Generation's Goto Statement

#220
post #175

Earlier quoted context omitted.

There are lots of work to do still on the CLR. - Improve the GC algorithms, most JVMs have better GC algorithms - Improve the code quality of the JIT and NGEN compilers, specially the set of applied optimizations - Expose auto-vectorization and vector instructions (similar to Mono.SIMD) - Expose something like C++ AMP on .NET. Some of this was slightly improved on 4.5, but they could do more.

Actually the CLR GC vastly outperforms the Oracle JVM GC in many scenarios, like a native Win app.

Which GC, from the multiple configurable ones?

Not to mention that you are forgetting all the other JVMs that are also available out there.

Also it the set of tuning options is pretty thin compared with what most JVMs, Haskell and other GC environments offer for tuning.

Note that this is not a Java vs .NET rant, I work on both environments. Each has plus and minus.

Post reply on HN