Talk:User defined pipe and redirection operators: Difference between revisions

→‎more ambitious than unix: Only Operators on generators.
(→‎more ambitious than unix: Only Operators on generators.)
Line 159:
 
:It now sounds like you are describing co-routines as an alternative. Though other models are also possible. Meanwhile there are a lot of loose ends. Consider, for example an implementation where it's desirable for grep to pass along empty records when they do not match (a GPU implementation might favor this kind of thing). But since this is implementation by analogy with a few "don't do this the easy way" constraints, it's kind of hard to predict what is going to be acceptable and what is not. --[[User:Rdm|Rdm]] 01:23, 14 September 2011 (UTC)
ThanX for that, the name "co-routines" sounds very close. But when I read the wikipedia [[wp:Coroutine#Coroutines_and_generators|Coroutines and generators]] section it seems that "coroutines" require multi-threading. This task does not (necessarily) require multi-threading. A single threaded "generator" operator is enough.
 
You idea of a stream of different data types (esp. including empty records) is intriguing. I will take your lead and provide a simple solution in my ''pet language'' where the record is the usual '''string'''. And a more complex solution where the record type is '''union'''('''void''', '''string'''), this ''[[wp:Tagged_union#1960s|tagged-union]]'' allows the yeilding of empty records.
Further the redirection targets can be a regular '''file''', but it also can be a '''array''' or '''linked-list'''. This nicely demonstrates a benefit of user-defined ''pipe and redirection operators''.
 
Having said the above. I don't think the ability to pipe a ''generalised'' record should be a necessary part of the actual task solution for any specific language. Piping variable length strings is enough to satisfy the task requirements.
 
BTW: I have been wondering how to ''naturally'' take advantage of a [[wp:Graphics Processing Unit|GPU]] and you have given me some ideas. ThanX.
 
[[User:NevilleDNZ|NevilleDNZ]] 02:15, 14 September 2011 (UTC)