by pwm · 6y ago · 0 comments
The idea would be to encapsulate your whole program in a very specific monad, one that:
- runs all functions in parallel
- implements sync points between functions
- implements an event system with named events and attached values
This does not at all reduce to "reinventing monads".
Note: I think the idea is horrible, any moderately complex program written this way would be entirely unmaintainable in my opinion. The author touches on this towards the end, but I think they are completely minimizing the down-side.
I agree so much. I can't help but think that modifying code you don't understand by injecting more code via hooks is a recipe for disaster, and the next person maintaining the composite product has to chase down all (ab)users of these events like we once had to hunt down abusers of global variables to understand what the hell is going on.
I don't even agree with the premise that this thing is less dependent on structure. Arguably, it is more dependent. It's just that instead of structure at the syntax level, we're now dealing with structure at a higher level, structure that is opaque to syntax but nevertheless present. Those named events and synchronization mechanisms make up their own structure.
However, I’d hardly describe it as “just”, it’s a fairly interesting idea.
I'd argue that it's an absolutely amazing idea however this idea has been brought into CS 31 years ago and utilised heavily ever since, so an article like this should imho at least mention it so that people can go away and learn about these concepts.
PS: My GP comment got heavily downvoted, which means that I'm missing something here.
I'm also wondering why this is; is there some obvious innovation described in the article that I missed?
If I'm missing something, could you point to some monad that can be used to `wait until an event named "good" is generated, and abort if an event named "bad" is generated`?