News for hackers. Stuff that matters.
Re:From TypeScript to ReScript by kevingadd on Wednesday January 12, 2022 @07:30AM (#29905448)
C# 5.0 introduced async/await in mid-2013 (late 2012 depending on how you count it), and F# had it before that in its version 2.0 (~2007). It's a pretty old "trend".
Re:From TypeScript to ReScript by nsonha on Wednesday January 12, 2022 @07:35AM (#29905486)
anything else other than those 2? An idea that .Net started, could be good could be bad, but the .Net association isn't added credibility.

async/await aren't keywords in F# and kotlin

Re:From TypeScript to ReScript by afavour on Wednesday January 12, 2022 @08:17AM (#29905939)
> anything other than those two?

Rust?

Re:From TypeScript to ReScript by nsonha on Wednesday January 12, 2022 @08:20AM (#29905981)
I was arguing that languages are following the "add async/await" trend recently, including rust. That other comment brought up that it exists in C# for a long time, hence not a recent trend.
Re:From TypeScript to ReScript by dharmaturtle on Wednesday January 12, 2022 @09:47AM (#29906950)
https://en.wikipedia.org/wiki/Async/await#History

F# in 2007

C# in 2012

Python in 2015

Typescript in 2015

Javascript in 2017

Rust in 2019

C++ in 2020

Swift in 2021

Re:From TypeScript to ReScript by sideeffffect on Wednesday January 12, 2022 @01:34PM (#29910997)
I'm almost sure that Haskell has had its "do notation" even before 2007.

And maybe even Scala its "for comprehension".

Re:From TypeScript to ReScript by dharmaturtle on Wednesday January 12, 2022 @02:02PM (#29911354)
Yeah - I was limiting my post to explicit async/await.

Don Syme, creator of F#, had a nice thread on the roots of async/await, though it doesn't mention do-notation: https://mobile.twitter.com/dsymetweets/status/14074008179179...

I'm still annoyed that most other languages stole async/await... but not the more general monadic/do notation. Instead we get elvis operators, chaining functions, etc.

Re:From TypeScript to ReScript by sideeffffect on Thursday January 13, 2022 @08:41PM (#29929581)
F#'s "Computation expressions" are the same sort of thing as the mentioned Haskell's "do notation" and Scala's "for comprehension". They're just thin syntactic sugar for "callbacks" -- chaining maps/binds/flatmaps/etc. Even though F#'s "Computation expressions" are very cleverly thought out and more general.

https://docs.microsoft.com/en-us/dotnet/fsharp/language-refe...

Async/await for example in C# or Rust is different. This translates the program into transition automata/coroutines.

Re:From TypeScript to ReScript by nsonha on Wednesday January 12, 2022 @04:24PM (#29912864)
in F# it's an instance of computational expression, not keywords. So it's really only C# that added the keywords, and other languages followed suit since 2015. None of the functional languages have async/await as keywords