jaredly / jaredly.github.io

node.js python data science golang philosophy faith. in no particular order
jaredly.github.io
10 stars 13 forks source link

Async example #10

Open fikriauliya opened 7 years ago

fikriauliya commented 7 years ago

Quote from https://jaredforsyth.com/2017/06/23/when-will-reasonml-be-ready/:

The OCaml community has some pretty fundamental fragmentations (there are three incompatible versions of the standard library, two incompatible ways to handle async), and documentation is generally pretty sparse. We’re hoping to establish good “batteries included” standard library (that will work for both js and native), but it will take some time.

To JS programmers, async pattern is very common nowadays, we are get used to it. Hence, been said that "there is no standard for async pattern in OCaml" made me worried how to convert my async codes into Reason counterpart.

It would be nice if there is a tutorial about how to do so in OCaml. (e.g. extend the Todo app to send the new item to a simple backend server)

jaredly commented 7 years ago

hmmm maybe I should amend that statement. You can do "async via passing a callback function" without any problem, but we don't yet have a canonical async/await solution (it's in the works though). I agree we should have some documentation about how to do async, though