monkey-dart icon indicating copy to clipboard operation
monkey-dart copied to clipboard

Make `monkey` program support stdin/stdout/stderr properly

Open mreichelt opened this issue 8 years ago • 0 comments

# Wouldn't it be beautiful if we could run monkey programs like this?
echo 'let a = 42; a;' | monkey

# or how about this?
monkey < helloworld.monkey

# or maybe even accept a program file as argument?
monkey helloworld.monkey

# and maybe even pipe the stdout to another file/process!
monkey helloworld.monkey | grep 'hello world'

Everything is possible! This version of the program should not simply start a REPL, but simply interpret the code and quit - without any extra strings polluting stdout or stderr.

Maybe we can add a command-line parameter -i for starting an interactive mode (which would be the REPL for now).

mreichelt avatar Jan 25 '17 23:01 mreichelt