uniter
uniter copied to clipboard
REPL
So for time, i really wanted to just try out functions. To do so, I did something like
nano file.php
uniter2js file.php > file.php.js
node -p "require('./file.php.js')().execute()"
but, this is rather a no-go :) It works but is hacky.
For another language-oriented project, for OJ, I wrote a little REPL: https://github.com/IngwiePhoenix/oj-node/blob/master/bin/oj
In order to write one for Uniter, it would need the ability to compile/run fragments - like: $foo = 20; echo $foo;
- without a <?php
, and in the same context as the previous statement.
You probably can base your REPL on what I did with OJ there. Its the most simple REPL you can do, really. :)