Proposal
Running a child process with a timeout isn't safely implementable in pure Lean today. You can arm a cancelable timer, but Child.wait has a blocking call to waitpid.
Additionally, IO.FS.Handle.read is a blocking, uninterruptible fread. So a task in read canot be canceled in Lean. Note that if the child process exits, stdout/stderr will not be closed if either was passed to a still running grandchild process. Closing the Lean read end doesn't help.
Here's what I'd like:
- Cancelable stream reads -- promise/Selector-based read via
uv_pipe_open analogous to TCP reads.
- Async child stdio -- child stdout/stderr as cancelable UV pipes (uses 1).
- Event-based spawn/wait — uv_spawn with uv_exit callback;
uv_process_kill and uv_kill for process-group kill.
This would build upon existing LibUV code.
Community Feedback
Ideas should be discussed on the Lean Zulip prior to submitting a proposal. Summarize all prior discussions and link them here.
Impact
Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.
Proposal
Running a child process with a timeout isn't safely implementable in pure Lean today. You can arm a cancelable timer, but
Child.waithas a blocking call towaitpid.Additionally, IO.FS.Handle.read is a blocking, uninterruptible
fread. So a task inreadcanot be canceled in Lean. Note that if the child process exits, stdout/stderr will not be closed if either was passed to a still running grandchild process. Closing the Lean read end doesn't help.Here's what I'd like:
uv_pipe_openanalogous to TCP reads.uv_process_killanduv_killfor process-group kill.This would build upon existing LibUV code.
Community Feedback
Ideas should be discussed on the Lean Zulip prior to submitting a proposal. Summarize all prior discussions and link them here.
Impact
Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.