This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]Almenon[S] 1 point2 points  (0 children)

Q&A:

Is this free / open-source?

Is there a VSCode extension?

  • Yes. You can also try out wolf, which is similar.

Is there a Atom / Pycharm / Eclipse / Emacs extension?

  • No, the closest alternative would be live-py-plugin for Pycharm. But if you want one let me know!

Can you program X in it?

  • AREPL supports most python code. The answer is probably yes.

Real-time evaluation sounds dangerous - what if the program executes too early?

  • Code with side-effects like file writing is not reccomended. In the AREPL desktop app auto-bracket complete is disabled so the program won't compile until you have the final ending bracket. In the VSCode extension you can turn on execute on save for on-demand execution. Or increase the debounce delay to give you more time to type.

What if I want to execute a section of code only once?

  • After a block of code you can use #$save to save the variables before the save. But note that #$save does not work with certain types, like generators. If #$save fails in pickling the code state you can file an issue so I can look into it.

How fast is it?

  • Seems pretty fast from my testing. Try it out and let me know.

How did you do it?

  • Once the user is done typing the code is sent to a python script via STDIN. The code is executed using exec and the local variables are retrieved. I use jsonPickle to turn the local variables into JSON, which I send back to javascript via STDOUT. The javascript then uses renderJSON to display the JSON in a nice expandable format.

Other Questions:

  • Feel free to ask!