Jump to content

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

m
rm dup section
m (rm dup section)
Line 90:
 
[[User:NevilleDNZ|NevilleDNZ]] 03:26, 13 September 2011 (UTC)
 
== more ambitious than unix ==
 
The task currently says "Pass each record on as soon possible running all filters/procedures concurrently."
 
But unix does not know anything about records and passes blocks of characters which typically do not represent complete records or complete lines (except in non-portable contexts where the programs have records which match the OS buffer block size). Meanwhile, in a non-multi-tasking language "as soon [as] possible" conflicts with the task requirement "Specifically do not cache the entire stream before the subsequent filter/procedure start".
 
Also, there's an implicit task "requirement" here, that output be characters. And a secondary implicit task "requirement" here that files be supported (since that what redirection means) which would also suggest that the task needs to support file reference by name. And, finally, in unix, the commands are (as a general rule) external programs, but it's not clear if this task allows for that kind of implementation. --[[User:Rdm|Rdm]] 13:17, 13 September 2011 (UTC)
 
== more ambitious than unix ==
Line 111 ⟶ 103:
In essence that is required is the creation of the operators "<", "|", ">", "<<" & ">>", with the basic plumbing such as "cat" & "tee".
 
Here are my thoughts, sketched in python code, note:
Here are my thoughts, sketched in python code, note the code ''does not'' require OS pipes, neither does it require OS multitasking. Note also: data is being passed as "rec", this could be a string, but the key point is that (essentially) in this sketch only a one record buffer is required, and this in actuality only the ''argument list'' itself.
* the code ''does not'' require OS pipes
* neither does it require OS multitasking
Here are my thoughts, sketched in python code, note the code ''does not'' require OS pipes, neither does it require OS multitasking. Note also:* data is being passed as "rec", this could be a string, but the key point is that (essentially) in this "python sketch" only a one record buffer is required, and this in actuality is only the ''argument list'' itself.
<lang python>#!/usr/bin/env python
 
Line 150 ⟶ 145:
 
cat("List_of_computer_scientists.lst") | grep("ALGOL") > "ALGOL_pioneers.lst"</lang>
 
So try not using "unix pipes".
 
I hope that helps.
Cookies help us deliver our services. By using our services, you agree to our use of cookies.