4 ms·
It doesn't always steal, AFAIK is was the first language to introduce "async" and the compiler magic that goes with it, i.e. so you don't have to use callbacks
by matthewwarren 10y ago
It doesn't always steal, AFAIK is was the first language to introduce "async" and the compiler magic that goes with it, i.e. so you don't have to use callbacks everywhere.
- yareally 10y agoAsync/await started with F# and was added to C# later.
- soulbadguy 10y agoWhile booth F# and C# have the same aim, they have totaly unrelated implementation and are quite different beats. IMO the C# design wasnt derived from F#.
- edgyswingset 10y agoThey are similar in that F# was the first .NET language to say, "what could language constructs for asynchrony look like?" and implement it. They are fundamentally different models, though. F# uses a "cold task" model where invoking an async function returns a specification of work, which you must then start. You can start this work in different ways so that you have control over the semantics of how it executes. C# uses a "hot task" models, where invoking the async method returns a handle to background work that has already been "kicked off". This is actually an oversimplification, because the semantics of what is actually the asynchronous thing you're awaiting can differ. But the overall concept follows this pattern.
- algorithmsRcool 10y agoI think F# had similar syntax prior to C# with Async Workflows. But C#'s refinement of this syntax seems to have caught a lot more attention. I can't wait to have Async + ValueTask in C# 7 to help reduce the penalty of Async a bit more.
- PeCaN 10y agoAlice ML¹ had that in 2000², and the idea of promises/futures dates back to the 70s. async/await to flatten promise hierarchies is decidedly _not_ a new idea. ¹ http://www.ps.uni-saarland.de/alice/manual/futures.html http://www.ps.uni-saarland.de/alice/manual/futures.html ² Well, it used "spawn" instead of "await". The semantics are very similar though.
- soulbadguy 10y agothe semantic and working implementation of spawn/away are quite different from async/await. While they might be related, i think it's kinda of stretch to call them prior arts...
- PeCaN 10y agoThey're really not all that different. Both are implementations of concurrency based on data-flow synchronization. Alice ML is explicit about running concurrent promises (it has other types of promises as well) in “threads”, but they're lightweight userspace threads. C# AFAIK doesn't specify any particular execution model for await.
- Const-me 10y agoThe innovation was to combine async/await to flatten promise hierarchies with asynchronous callback-based IO under the hood to implement those promises without using background threads. That was the new idea that suddenly made those decades-old promises useful for the software industry, as it allowed both blocking-style code simplicity and callbacks-style IO scalability. The ML link says “evaluates the expression exp in a new thread and returns immediately with a future of its result” which translates to “not scalable”.
- PeCaN 10y agoAlice ML “threads” are more like Erlang threads than C# threads. They're lightweight userspace threads and you can have thousands of them. That's quite scalable. Also, that's not a new idea. Blocking-style code with async I/O scaling was pioneered by Oz in 1991. (It did it a little bit differently from Alice ML.)
- deleted 10y ago[deleted]
- ahartman00 10y agoAFAIK, linq didnt exist anywhere else