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

Initial shell redirects through lisp. #208

Merged
merged 6 commits into from
Jan 22, 2025
Merged

Initial shell redirects through lisp. #208

merged 6 commits into from
Jan 22, 2025

Conversation

sstanfield
Copy link
Member

@sstanfield sstanfield commented Oct 4, 2024

Still figuring this out currently allows things like this (syntax will probably change):

Current iteration uses :< (same as :0<) to connect a file stdin and :> (same as :1>) to connect a file to stdout. These can also be used with file descriptors (for example :2> will connect a file to stderr). They can be mixed with other shell redirects and will just become part of the redirect stack. Each lisp redirect will return a file in a list (first element will be the PID of the final process).

Examples:
(let ([pid, out] (sh "ls" :>)) (iter::for l in (iter::iter out) (pr l)))

(let ([pid, out, er] (sh "ls vm/src/ sdsdf" :> :2>))(prn "PID: " pid) (iter::for l in (iter::iter out)(pr "from out: " l))(iter::for l in (iter::iter er)(pr "from err: " l)

Set the lisp pipe then use a shell redirect to also send stderr to the same pipe:
(let ([pid, out] (sh "ls vm/src/ sdsdf" :> "2>&1"))(prn "PID: " pid) (iter::for l in (iter::iter out)(pr "from grep: " l)))

(let ([pid, in, out] (sh :< "grep XX" :>))(prn "PID: " pid) (fprn in "XXsls")(fprn in "sls")(fprn in "dfdXX")(fclose in)(iter::for l in (iter::iter out)(pr "from grep: " l)))

(same as above but include a pipe between shell commands)
(let ([pid, in, out] (sh :< "grep XX | cat -" :>)) (fprn in "XXsls")(fprn in "sls")(fprn in "dfdXX")(fclose in)(iter::for l in (iter::iter out)(pr l)))

@sstanfield sstanfield self-assigned this Oct 4, 2024
Copy link

github-actions bot commented Oct 4, 2024

🐰 Bencher Report

Branchsls-lisp-redirects
Testbedubuntu-latest

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkEstimated Cycles1e6 x estimated cyclesInstructions1e6 x instructionsL1 Hits1e6 x hitsL2 HitshitsRAM HitshitsTotal read+write1e6 x reads/writes
iai::float::float_one_hundred📈 view plot
⚠️ NO THRESHOLD
133.81📈 view plot
⚠️ NO THRESHOLD
95.92📈 view plot
⚠️ NO THRESHOLD
132.55📈 view plot
⚠️ NO THRESHOLD
152,116.00📈 view plot
⚠️ NO THRESHOLD
14,254.00📈 view plot
⚠️ NO THRESHOLD
132.72
iai::float::float_one_thousand📈 view plot
⚠️ NO THRESHOLD
425.18📈 view plot
⚠️ NO THRESHOLD
313.16📈 view plot
⚠️ NO THRESHOLD
423.92📈 view plot
⚠️ NO THRESHOLD
151,787.00📈 view plot
⚠️ NO THRESHOLD
14,248.00📈 view plot
⚠️ NO THRESHOLD
424.08
iai::float::float_ten_thousand📈 view plot
⚠️ NO THRESHOLD
3,338.96📈 view plot
⚠️ NO THRESHOLD
2,485.75📈 view plot
⚠️ NO THRESHOLD
3,337.69📈 view plot
⚠️ NO THRESHOLD
152,324.00📈 view plot
⚠️ NO THRESHOLD
14,250.00📈 view plot
⚠️ NO THRESHOLD
3,337.86
iai::float::optimized_float_fifty_thousand📈 view plot
⚠️ NO THRESHOLD
8,829.24📈 view plot
⚠️ NO THRESHOLD
6,990.42📈 view plot
⚠️ NO THRESHOLD
8,829.22📈 view plot
⚠️ NO THRESHOLD
72.00📈 view plot
⚠️ NO THRESHOLD
547.00📈 view plot
⚠️ NO THRESHOLD
8,829.22
iai::float::optimized_float_one_hundred📈 view plot
⚠️ NO THRESHOLD
17.70📈 view plot
⚠️ NO THRESHOLD
14.00📈 view plot
⚠️ NO THRESHOLD
17.68📈 view plot
⚠️ NO THRESHOLD
73.00📈 view plot
⚠️ NO THRESHOLD
548.00📈 view plot
⚠️ NO THRESHOLD
17.68
iai::float::optimized_float_one_thousand📈 view plot
⚠️ NO THRESHOLD
176.63📈 view plot
⚠️ NO THRESHOLD
139.82📈 view plot
⚠️ NO THRESHOLD
176.61📈 view plot
⚠️ NO THRESHOLD
72.00📈 view plot
⚠️ NO THRESHOLD
548.00📈 view plot
⚠️ NO THRESHOLD
176.61
iai::float::optimized_float_ten_thousand📈 view plot
⚠️ NO THRESHOLD
1,765.88📈 view plot
⚠️ NO THRESHOLD
1,398.10📈 view plot
⚠️ NO THRESHOLD
1,765.86📈 view plot
⚠️ NO THRESHOLD
71.00📈 view plot
⚠️ NO THRESHOLD
547.00📈 view plot
⚠️ NO THRESHOLD
1,765.86
iai::recursion_and_continuations::continuation_vec_search_one_hundred📈 view plot
⚠️ NO THRESHOLD
105.44📈 view plot
⚠️ NO THRESHOLD
74.40📈 view plot
⚠️ NO THRESHOLD
104.05📈 view plot
⚠️ NO THRESHOLD
162,839.00📈 view plot
⚠️ NO THRESHOLD
16,542.00📈 view plot
⚠️ NO THRESHOLD
104.23
iai::recursion_and_continuations::continuation_vec_search_one_thousand📈 view plot
⚠️ NO THRESHOLD
111.41📈 view plot
⚠️ NO THRESHOLD
78.06📈 view plot
⚠️ NO THRESHOLD
109.77📈 view plot
⚠️ NO THRESHOLD
169,829.00📈 view plot
⚠️ NO THRESHOLD
22,551.00📈 view plot
⚠️ NO THRESHOLD
109.96
iai::recursion_and_continuations::continuation_vec_search_ten_thousand📈 view plot
⚠️ NO THRESHOLD
162.57📈 view plot
⚠️ NO THRESHOLD
112.20📈 view plot
⚠️ NO THRESHOLD
159.94📈 view plot
⚠️ NO THRESHOLD
194,692.00📈 view plot
⚠️ NO THRESHOLD
47,150.00📈 view plot
⚠️ NO THRESHOLD
160.18
iai::recursion_and_continuations::recursive_vec_search_one_hundred📈 view plot
⚠️ NO THRESHOLD
105.34📈 view plot
⚠️ NO THRESHOLD
74.33📈 view plot
⚠️ NO THRESHOLD
103.95📈 view plot
⚠️ NO THRESHOLD
162,481.00📈 view plot
⚠️ NO THRESHOLD
16,434.00📈 view plot
⚠️ NO THRESHOLD
104.13
iai::recursion_and_continuations::recursive_vec_search_one_thousand📈 view plot
⚠️ NO THRESHOLD
105.35📈 view plot
⚠️ NO THRESHOLD
74.34📈 view plot
⚠️ NO THRESHOLD
103.96📈 view plot
⚠️ NO THRESHOLD
162,871.00📈 view plot
⚠️ NO THRESHOLD
16,435.00📈 view plot
⚠️ NO THRESHOLD
104.14
iai::recursion_and_continuations::recursive_vec_search_ten_thousand📈 view plot
⚠️ NO THRESHOLD
155.92📈 view plot
⚠️ NO THRESHOLD
107.50📈 view plot
⚠️ NO THRESHOLD
153.30📈 view plot
⚠️ NO THRESHOLD
194,550.00📈 view plot
⚠️ NO THRESHOLD
47,038.00📈 view plot
⚠️ NO THRESHOLD
153.55
🐰 View full continuous benchmarking report in Bencher

Copy link

github-actions bot commented Oct 4, 2024

🐰 Bencher Report

Branchsls-lisp-redirects
Testbedubuntu-latest

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
continuation_vec_search_one_hundred📈 view plot
⚠️ NO THRESHOLD
7.32
continuation_vec_search_one_thousand📈 view plot
⚠️ NO THRESHOLD
7.74
continuation_vec_search_ten_thousand📈 view plot
⚠️ NO THRESHOLD
11.34
float_one_hundred📈 view plot
⚠️ NO THRESHOLD
9.19
float_one_thousand📈 view plot
⚠️ NO THRESHOLD
29.39
float_ten_thousand📈 view plot
⚠️ NO THRESHOLD
227.77
optimized_float_fifty_thousand📈 view plot
⚠️ NO THRESHOLD
511.09
optimized_float_one_hundred📈 view plot
⚠️ NO THRESHOLD
1.03
optimized_float_one_thousand📈 view plot
⚠️ NO THRESHOLD
10.14
optimized_float_ten_thousand📈 view plot
⚠️ NO THRESHOLD
101.41
recursive_vec_search_one_hundred📈 view plot
⚠️ NO THRESHOLD
7.33
recursive_vec_search_one_thousand📈 view plot
⚠️ NO THRESHOLD
7.65
recursive_vec_search_ten_thousand📈 view plot
⚠️ NO THRESHOLD
10.71
🐰 View full continuous benchmarking report in Bencher

@sstanfield sstanfield marked this pull request as ready for review January 22, 2025 14:44
@sstanfield sstanfield changed the title WIP, initial shell redirects through lisp. Initial shell redirects through lisp. Jan 22, 2025
@gpwclark gpwclark self-requested a review January 22, 2025 15:08
@gpwclark gpwclark merged commit 36d0776 into main Jan 22, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants