Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More concurrency constructs (xargs, gnu parallel, nonlinear pipelines) #843

Open
andychu opened this issue Oct 23, 2020 · 3 comments
Open

Comments

@andychu
Copy link
Contributor

andychu commented Oct 23, 2020

We have a nascent xargs here:

/~https://github.com/oilshell/oil/tree/master/tools

I mentioned xargs here:

http://www.oilshell.org/blog/2020/02/good-parts-sketch.html#the-0-dispatch-pattern-solves-three-important-problems

and it's hidden in the help as each:

https://www.oilshell.org/release/0.8.3/doc/oil-help-topics.html#builtin

@andychu andychu changed the title Enhance concurrency constructs (xargs, gnu parallel, nonlinear pipelines) More concurrency constructs (xargs, gnu parallel, nonlinear pipelines) Oct 23, 2020
@andychu
Copy link
Contributor Author

andychu commented Oct 23, 2020

Basically I want us to have something like:

find --qtsv . | each {
  echo "$name --- $size"
}

@andychu
Copy link
Contributor Author

andychu commented Oct 23, 2020

Also, with Oil blocks, I imagine instead of

diff <(sort left.txt) <(sort right.txt)

You could factor it out like:

var p1 = &(sort left.txt) 
var p2 = &(sort right.txt)

diff $stdout(p1) $stdout(p2)

@andychu andychu mentioned this issue Jan 7, 2021
@andychu
Copy link
Contributor Author

andychu commented Jan 28, 2021

Random idea here: https://news.ycombinator.com/item?id=25939152

grep FOO *.py | wc -l | sort -n

pipeline {
  pipe :p1  # variables that are pipes
  pipe :p2

  # this syntax isn't great but shows the idea
  grep FOO *.py > &p1
  < &p1 wc -l > &p2
  < &p2 sort -n
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant