On Sat, Jun 29, 2019 at 9:30 PM Henrik Johansson <dahankz...@gmail.com>
wrote:

>
> I have a feeling that there is a quite large "silent majority" that pretty
> much agrees with me.
>
>
Go is a language with the following properties, among other things:

* Massive concurrency through a high amount of gorutines
* Identity of channels, but not goroutines (goroutines don't have a Pid by
construction, channels do have identity)
* Shared memory space among the goroutines

Such a language has a subtle property as an implication: cleanup of a
failure must happen in the goroutine which made it. That is, error handling
must be localized. As a result, error handling is mostly a game of treating
it as data-flow in the program, where errors are values.

There is a common case in such data flow. If an error occurs, we want to
just return that error. This is where the try-construct will definitely
improve the ergonomics of the programming. Go is a fairly small language.
Certainly smaller than e.g., Javascript or Typescript. So I don't think we
are adding that much cognitive load on people with a specialized
construction. Of course YMMV... Haskell or OCaml programmers would just
define a monad and call it a day, heh.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAGrdgiVU42ep%2BzJFUHc8FiZ_yQWrw2YOTCJEjMbLkyiFeC_C%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to