Page 1 of 1

In praise of pipes

Posted: Fri May 23, 2014 12:43 am
by eekee
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. :mrgreen: Anyway, I'd like to give Visopsys some attention, but it won't be for some time yet.

Re: In praise of pipes

Posted: Fri May 23, 2014 1:07 am
by andymc
Welcome, eekee 8-)

I don't think that implementing pipes would be too tricky in Visopsys. Until now, there hasn't been too much focus on the command line stuff. I've focused more on the graphical, 'visual' side of things. I haven't made much effort to match the flexibility of Linux/UNIX, only to approximate some familiar commands. Those commands don't typically process 'stdin' data, but they could be made to do so. The shell would have to break down command lines into separate pipe-separated commands, and connect the 'text output stream' of one process to the 'text input stream' of the next. We could wrap that in whatever POSIX semantics apply.

If someone wanted to port some of those programs like grep, sed, awk, etc., then I'd be more than happy to work on the pipe part, or else support anyone that wanted to have a go at it.

Re: In praise of pipes

Posted: Tue Jul 08, 2014 10:04 am
by yereverluvinuncleber
This is appropriate given the subject, forgive me.

https://www.youtube.com/watch?v=vP5H0HoGkv0&feature=kp

Re: In praise of pipes

Posted: Tue Jul 08, 2014 3:10 pm
by ap0r
Bizarre :P

Re: In praise of pipes

Posted: Tue Jul 08, 2014 3:19 pm
by andymc
:lol:

Re: In praise of pipes

Posted: Sun Jul 13, 2014 7:11 am
by ivan
WTF :doh: