<antilisp-dev>
Is there a way to make the subprocess library compile in RPython ? I need a way to run shell commands from my interpreter, but i can't make it compile even after modifying the source code of the library
<antilisp-dev>
(i could write a C module for my interpreter, but I didn't find how to do it in the RPython docs)
lritter has quit [Quit: Leaving]
<korvo>
antilisp-dev: Directly, no. However, I think that there is something in rlib for this.
<korvo>
antilisp-dev: Okay, looking at rlib.rposix, I think that you can use os.execve, os.spawnve, or friends. Those os builtins will be automatically translated into the versions from rlib.rposix on POSIX, or equivalents on Windows.
<korvo>
In general, Python stdlib stuff that is written in pure Python will not work in RPython; most of the stdlib isn't designed to be translated. For important stuff, rlib usually has something. We can browse the modules online: https://github.com/pypy/pypy/tree/main/rpython/rlib
<antilisp-dev>
thanks, i will go check rlib.rposix
<antilisp-dev>
i tried using os.popen before, but the problem i had was that RPython would infer the type of parameters, and the python stdlib uses dynamic parameter types (int constants for pipes and None in the same variable)
jcea has joined #pypy
<korvo>
I don't think os.popen is set up. IIRC that's a fairly recent innovation in Python 3 that wasn't in Python 2, so wouldn't be in RPython; but I'm usually wrong about this sort of thing.
jcea has quit [Ping timeout: 252 seconds]
BarrensZeppelin has joined #pypy
BarrensZeppelin has quit [Quit: BarrensZeppelin]
<antilisp-dev>
iirc, os.popen is the old way of running subprocesses. I used the python2 docs to get everything right, and the calls would compile with rpython, but with a single type signature so i couldn't use os.popen with and without stdin pipes in different places
<korvo>
Ah, interesting. Well, with RPython, whatever works.