Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling PyPy sandbox from another language

I'll preface this by saying I am quite new to PyPy, though fairly experienced with Python.

I'm looking to run a web app where I run untrusted Python code. The PyPy sandboxing features look ideal for what I'm doing.

The PyPy docs on sandboxing indicate that you can call a PyPy sandbox from either Python or PyPy. This seems to imply that there's some separate program or executable that is the sandbox.

I'm wondering, is it possible to call a PyPy sandbox from a non-Python language? I'm looking at Haskell in particular, but it's also very possible that I could use C or C++ as an intermediate.

like image 497
jmite Avatar asked Nov 01 '22 03:11

jmite


1 Answers

Yes, that's possible. The PyPy sandbox is a separate process communicating only via stdin/stdout. If you want to rewrite the "external" part, you can; it's not using anything that should be too heavily Python-related.

like image 133
Armin Rigo Avatar answered Nov 09 '22 04:11

Armin Rigo