Earlier quoted context omitted.
Whats the difference between taking a nursery and returning a promise? Both put the context in the signature, but the later is actually composable.
When I call a function, I have no way of knowing if there are any unhandled promises within it. The difference is the restriction: with nurseries, background tasks can only outlive function calls if the calling function allows them to.
Notes on structured concurrency, or: Go statement considered harmful
71–80 of 234 posts
Re: Notes on structured concurrency, or: Go statement considered harmful
#72Earlier quoted context omitted.
The article makes a strong case. Even if rust allows formal verification, not all programmers use it, and if you use their library, you don't know if it's been verified. Take it back to the goto analogy: can you formally verify goto? Yes. Does that mean it's good to include as a language primitive? No. You are basically taking an entire argument, ignoring its merits, and saying "but you can do it another way". You ar…
It's not only that Rust allows formal verification, it's that it does it by default, writing unsafe Rust code for no serious reason is fundamentally frowned upon, and even then there is a serious effort to bring some tooling to bring more confidence even on "unsafe" Rust code. > But I suspect the truth is that "njs was right", and I hope the it's sooner rather than later. I'm not sure. The problem can and has been so…
I agree that Rust has a great model that seems to lead to very solid code, but “formal verification” is a high bar to clear.
Re: Notes on structured concurrency, or: Go statement considered harmful
#73The author appears to have reinvented Communicating Sequential Processes (CSP). http://www.usingcsp.com/cspbook.pdf The (simplified, and as I understand it) gist of concurrency in CSP is that the program is expressed as a series of parallel (PAR) and sequential (SEQ) operations. Everything in a PAR block will run in parallel and all their outputs will be collected and fed as the input to the next SEQ. Everything in a…
Re: Notes on structured concurrency, or: Go statement considered harmful
#74Want a web app that sets up some long-running thing to run in the background while the request returns quickly? Well then you're going to need a nursery above the level of the request which is still available to every request. I don't see what that gives you above conventional threading. Oh, and you'd also need to implement your own runner in a thread to have a task failure not bring down the whole application.
Re: Notes on structured concurrency, or: Go statement considered harmful
#75Earlier quoted context omitted.
When I call a function, I have no way of knowing if there are any unhandled promises within it. The difference is the restriction: with nurseries, background tasks can only outlive function calls if the calling function allows them to.
I get compile-time warnings or runtime errors when I create unhandled promises. What more is needed?
Re: Notes on structured concurrency, or: Go statement considered harmful
#76Author is a PhD student, which bodes well for not reinventing wheels dumbly. Therefore, I look forward to the lit review of other concurrency & parallelism work through the last 40 years, which this writeup notably lacks (author mentions his stack of papers to review).
Your ideas are intriguing to me and I wish to subscribe to your newsletter.
ed: author has phd, not is a student.
Re: Notes on structured concurrency, or: Go statement considered harmful
#77Well they lost me at the callbacks... if go statements are harmful and callbacks are not then I rather prefer the harmful way.
Re: Notes on structured concurrency, or: Go statement considered harmful
#78The author appears to have reinvented Communicating Sequential Processes (CSP). http://www.usingcsp.com/cspbook.pdf The (simplified, and as I understand it) gist of concurrency in CSP is that the program is expressed as a series of parallel (PAR) and sequential (SEQ) operations. Everything in a PAR block will run in parallel and all their outputs will be collected and fed as the input to the next SEQ. Everything in a…
This misses the point of the article. It's short-sighted to say that he's reinvented CSP given that the entire concurrency model in Go is based around CSP, and the author is already aware of it. The article is more related to RAII, scope, lifetimes, etc. than any model of concurrency.
Re: Notes on structured concurrency, or: Go statement considered harmful
#79Earlier quoted context omitted.
This misses the point of the article. It's short-sighted to say that he's reinvented CSP given that the entire concurrency model in Go is based around CSP, and the author is already aware of it. The article is more related to RAII, scope, lifetimes, etc. than any model of concurrency.
Channels are lifted from CSP, but PAR is obviously missing.