Take the 2-minute tour ×
Theoretical Computer Science Stack Exchange is a question and answer site for theoretical computer scientists and researchers in related fields. It's 100% free, no registration required.

The name coroutine suggests that in some sense they should be dual to (sub)routines. Is there a real mathematical duality? I'm hoping for something like "in category theory subroutines are X and coroutines are Y, where X is dual to Y".

share|improve this question
    
If there is a connection, it would be via continuations. –  Dave Clarke Nov 13 '12 at 15:25
2  
Which incidentally are not dual to ntinuations. –  Dave Clarke Nov 13 '12 at 15:26
    
“Regrettably, the world of computing seems better at coining new terms for old meanings (or without any meaning at all).” © Edsger W. Dijkstra, EWD854. –  beroal Nov 16 '12 at 19:12
1  
The prefix 'co' isn't always category theoretic. A coconut isn't equivalent to a nut. –  Vijay D Nov 25 '12 at 22:43
add comment

1 Answer 1

up vote 10 down vote accepted

I think this a misanalysis of the "co" prefix in this case.

"Coroutine" is "co" in the sense of "co-worker"; something that works together with another.

The term precedes by a long way the gross overuse for programming concepts of the prefix "co" in the Category Theoretic sense of a dual of another concept.

(Yes, there is editorial content there. ;-) )

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.