pixie-lang/pixie — pull request #108 by gigasquid (2014-12-07 01:28:27+00:00)
Title: Naive Shell using ffi

I would like to use pixie to do some scripting.

Here is a crack at trying to implement a _shell_ function. It returns the exit code.

```
-> ./pixie-vm
Pixie 0.1 - Interactive REPL
(darwin_x86_64, clang)
:exit-repl or Ctrl-D to quit
----------------------------
user => (shell "ls")
COPYING	README.md	foo	pixie-vm	target.pyc
COPYING.LESSER	benchmarks	make-no-jit	run-interpreted	tests
Dockerfile	checkout-externals	make-with-jit	run-tests.pxi
Makefile	examples	pixie	target.py
0
user =>
```
```
user => (shell "mkdir 'foobar'")
0
```

I am definitely don't know my way around python, ffi, or libuv very well, so if there is a better way to implement this, please let me know.