Hacker News new | ask | show | jobs
by fleitz 4343 days ago
I don't think you've seen truly great async support, it's virtually indistinguishable from sync code.

Sync:

  let file = File.Open("foo.txt")
  let data = file.Read(8192)
  // Do some compute stuff with data
ASync:

  let! file = File.OpenAsync("foo.txt")
  let! data = file.ReadAsync(8192)  
  // Do some compute stuff with data
1 comments

while the syntax can be as simple as that, there is still a difference, and the programmer still needs to be very careful. what if you accidentally forget the `"!"`?
Umm... it doesn't compile because it's the wrong type...

But yeah multithreading is easy.