3 ms·
Interesting, but I wonder whether Go-style "go routines" and channels would be a better choice to implement. First, it seems like they would be easier to write
by ggchappell 17y ago
Interesting, but I wonder whether Go-style "go routines" and channels would be a better choice to implement.
First, it seems like they would be easier to write in C++. You're mostly creating a new kind of pseudo-container (channel), instead of trying to fake adding new syntax to the language. (Although you do still need to have some mechanism for executing a go routine, somehow ....)
Second, its a more powerful abstraction. With go routines it's not hard to implement something with the functionality of Python-esque generators, but you can also do fancier things that you would have a difficult time doing using only generators.