Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for feedback #1

Open
tomaskulich opened this issue Nov 20, 2016 · 2 comments
Open

Request for feedback #1

tomaskulich opened this issue Nov 20, 2016 · 2 comments

Comments

@tomaskulich
Copy link

Frustrated with how error handling and forced termination works with standard means for writing asynchronous code (Promises, js-csp, I'm not sure what approach does node-csp take), I created my own solution for writing asynchronous code.

https://github.com/vacuumlabs/yacol/

It's strongly CSP-influenced, the main difference however is, that I separated concepts of goroutine result and channels. In other words, goroutine return one simple value and may get to error state. Return value can be read multiple times by whoever wants to. Channels, OTOH cannot get to the error state, cannot be closed and taken value is taken out of the channel (standard CSP behavior).

If you have a few spare minutes, I'll be thankful for any feedback.

@Aclassifier
Copy link

Aclassifier commented Nov 21, 2016

I am not certain if there is a standard CSP semantics on erroneous channels, if that's what you meant. Occam is perhaps closest to CSP, where there was no error handling. JCSP channels have several flavours of fault handling. Go channels do error return. I guess it's more about layering of protocols than CSP. But then one would perhaps need at least the Go concept.

An interesting point may be that C.A.R. Hoare strongly argued against Ada's exception handling (with throw and catch) after he had designed CSP, in his Turing Award lecture in 1980 [1], perhaps one of the more readable essays of computer science. 1980 is a long time ago, but history tends to repeat itself.

Another interesting point that springs to my mind is that Texas Instruments Microprocessor Pascal (MPP Pascal, rather concurrent) with built-in scheduler for TMS-9995 and TMS-99105 in the very late seventies had exception handling with hierarchical (with respect to processes), pluggable exception handlers. I think this was designed by Per Brinch Hansen.

IEEE 1355 and SpaceWire come from the transputer (& occam) world where it was seen necessary to add exception handling on channels. This might be an interesting study.

I am trying, to the best of my ability, to draw up a taxonomy of CSP-based systems [2]. I may rename it to classification only since I find it hard to do hierarchical classification. Exception handling and channels would certainly be a point. Comments welcomed there! Good luck with node-csp and yacol!

[1] https://www.infosec.aueb.gr/Besides%20Security/TALKS/TALKS-6%20Hoare%20(The%20Emperor's%20old%20clothes).pdf

[2] http://www.teigfam.net/oyvind/home/technology/135-towards-a-taxonomy-of-csp-based-systems/ (Disclaimer: no money or gifts, no ads, just hobby)

@tomaskulich
Copy link
Author

Thank you for your feedback. Especially, the taxonomy looks really impressive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants