In praise of pipes
Posted: Fri May 23, 2014 12:43 am
Hi! I've tried out Visopsys a few times. It looks good, and I have no trouble using the GUI. The last time I tried I had a bit more of a look into the shell, seeing what programs were where. I have trouble filtering information; picking elements from a list, so I tried to pipe ls into grep. As you probably know, it didn't work; no pipes. I have to praise pipes as allowing the simplest tools to become useful in conjunction with other tools. I wrote a cgi-capable web server in Plan 9 shell script. Each of the little shell tools in Plan 9 is far simpler than the corresponding program in any modern unix, but by combining them they become very powerful.
Even Visopsys simple find program could be very useful if piped into a filter. If it output a few extra columns of data it could be piped into awk which could pick out lines based on certain columns containing certain data, giving much of the power of gnu find with none of the cost of implementing it, only that porting awk which would also be useful for other tasks. What I often do is use awk to pick out lines and transform them into commands which are then piped into a shell.
That said, I've recently started going off awk specifically. I'm getting interested in the "structural regexps" of sam. They're more powerful, able to pick out multi-line records for one, and to match based on multiple regexps rather than counting columns. Details in the sam paper, if anyone's interested, mirrored at:
http://ethan.uk.to/static/doc/sam.pdf
I have no idea how feasible or otherwise it might be to implement pipes in Visopsys, nor to port awk or sam. I'd look into it, but, well... I tried Visopsys last month, formed the above conclusions about pipes, started writing a stupidly long email, realized it was stupidly long and binned it. This month I started hacking on my Kindle and got talked into porting 9front to it. I've never done anything with hardware since the 8-bit era, so it's taking all the attention I can spare and then some, and will do for a few months, I think. (Multiple buses, some of which are dma capable, some are not, and one which is is accessed via a bus which is not... what?) When I'm done with that, I have a feeling my attention will be claimed by ideas I'm having for a multitasking OS on the 6502... I think it can be done. Anyway, I'd like to give Visopsys some attention, but it won't be for some time yet.
Even Visopsys simple find program could be very useful if piped into a filter. If it output a few extra columns of data it could be piped into awk which could pick out lines based on certain columns containing certain data, giving much of the power of gnu find with none of the cost of implementing it, only that porting awk which would also be useful for other tasks. What I often do is use awk to pick out lines and transform them into commands which are then piped into a shell.
That said, I've recently started going off awk specifically. I'm getting interested in the "structural regexps" of sam. They're more powerful, able to pick out multi-line records for one, and to match based on multiple regexps rather than counting columns. Details in the sam paper, if anyone's interested, mirrored at:
http://ethan.uk.to/static/doc/sam.pdf
I have no idea how feasible or otherwise it might be to implement pipes in Visopsys, nor to port awk or sam. I'd look into it, but, well... I tried Visopsys last month, formed the above conclusions about pipes, started writing a stupidly long email, realized it was stupidly long and binned it. This month I started hacking on my Kindle and got talked into porting 9front to it. I've never done anything with hardware since the 8-bit era, so it's taking all the attention I can spare and then some, and will do for a few months, I think. (Multiple buses, some of which are dma capable, some are not, and one which is is accessed via a bus which is not... what?) When I'm done with that, I have a feeling my attention will be claimed by ideas I'm having for a multitasking OS on the 6502... I think it can be done. Anyway, I'd like to give Visopsys some attention, but it won't be for some time yet.