lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On Sun, Jul 15, 2018 at 10:46 PM, Nagaev Boris <bnagaev@gmail.com> wrote:
I looked through your post [2] "Notes on structured concurrency, or:
Go statement considered harmful". There is sync.WaitGroup type in Go
that allows you to make sure all launched goroutines have exited:
... 
In the section "There is an escape." you proposed to pass nursery
inside any function that may spawn goroutines. Isn't it too verbose?

Hi Boris.  I'm not the author of that article.  It does acknowledge Go utilities for similar control structures [1].  But a big point of the article is that having ad-hoc spawning ability surfaced to the language will break the abstraction and make programs very difficult to reason about, because 3rd party code may be using those low level primitives.  In any case the article is not an attack on Go language, rather it's about evolving how we deal with concurrency in programming.

Regardless, the point of my own post was that there are compelling idioms emerging based on Python-like "with" or RAII, and they can't be implemented nicely in Lua.  The article on timeouts and cancellation I referenced is another example.


[1] https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/#id7