freenode/#lisp - IRC Chatlog
Search
11:19:49
nij
jdz: Using uiop:run-program, I can just pass a dirty string "echo 3 | grep hi" into it.
11:21:29
nij
With sb-ext:run-program, the first argument must be a callable thing, eg "/usr/bin/echo". That restricts (afaik) one sb-ext:run-program form to one callable thing, in contrast to uiop:run-program.
11:21:41
jdz
Nilby: Yes, everything's fine and dandy until you need some magic numbers that are only available in C headers.
11:23:08
jdz
nij: You will also find that in that case uiop:run-program uses "sh -c", and then you're in the land of hurt if you fail to properly escape a string or a quote or, god forbid, use strings provided by the user.
11:25:13
jdz
nij: I'd suggest to never, ever, invoke a process with a command line constructed by concatenating stings (unless you're very VERY sure nothing bad can happen, which is pretty much never).
11:26:16
jdz
Heh, concatenating strings in the context of unix process invocations really is akin to concatenating stings.
11:39:45
pjb
ym: (setf *terminal-io* (make-two-way-stream (two-way-stream-input-stream *terminal-io*) (make-broadcast-stream)))
11:40:43
pjb
ym: but 1- setting *terminal-io* is not conforming, and 2- it doesn't seem to work in slime-repl anyway, they must circumvent *terminal-io* and use the swank/gray::slime-output-stream directly.
11:41:50
pjb
ym: note, if you want a REP, you can write your own. See for example: https://github.com/informatimago/lisp/blob/master/common-lisp/interactive/interactive.lisp#L181 and patch it to avoid printing.
11:43:09
pjb
jdz: the closest to your fiction, is in Tron, where there are leaked data and free programs.
11:43:16
jdz
swank:*globally-redirect-io* is also relevant (https://common-lisp.net/project/slime/doc/html/Other-configurables.html#index-SWANK_003a_002aGLOBALLY_002dREDIRECT_002dIO_002a).
11:45:35
pjb
The problem is "When NIL these streams are only temporarily redirected to Emacs using dynamic bindings while handling requests." This combines badly with the notion that a REPL is a continuous process. slime-repl is not. I've posted an issue about a related subject, the + ++ +++ * ** *** / // /// variables.
12:24:50
etimmons
nij: UIOP has two functions: run-program and launch-program, equivalent to :wait t and :wait nil respectively. launch-program returns a process object you can use to send signals to
12:25:15
etimmons
Plus, unrecognized keyword arguments to both are passed directly to the underlying function in the implementation
12:26:42
etimmons
You might also be interested in https://github.com/ruricolist/cmd/ I've never tried it, but IIRC it was received well on Reddit when it was announced
13:55:01
jackdaniel
there is also external-program which is good in this sense that it doesn't try to do more than provide a compatibiliy layer between different implementations