3 ms·
Is this approach (sending the commands to a backend) preferable to a javascript-based repl (using something like emscripten)?
by veyron 15y ago
Is this approach (sending the commands to a backend) preferable to a javascript-based repl (using something like emscripten)?
- ronreiter 15y agoyes, but it's jailed pretty good and it's not a lot of CPU power to execute, so it's OK.
- RyanMcGreal 15y agoIt allows `eval()` to run. Please see this: http://diveintopython3.ep.io/advanced-iterators.html#eval http://diveintopython3.ep.io/advanced-iterators.html#eval
- nanotone 15y agoIt looks like you're using GAE. Not having much experience with it, I'm wondering if GAE provides the CPU jailing, or did you have to write some voodoo yourself? I ask because it's trivially easy to send a statement containing a single bytecode that takes a really long time to execute, at least in CPython: >>> print 999 * 0 # => 0, so not a bandwidth issue If I send this to your backend in a bunch of tabs (I didn't) could that be a DoS? Also, are you thinking of putting the backend code on github? EDIT: HN swallowed my exponentiation. That should read "print nine to the nine to the nine, times zero". Without the times zero, that's a huge number.
- d0mine 15y ago>>> print 9**9**9*0 # => 0 Text after a blank line that is indented by two or more spaces is reproduced verbatim. http://news.ycombinator.com/formatdoc http://news.ycombinator.com/formatdoc (the help link is in the bottom-right corner)
- MostAwesomeDude 15y ago"There should be one -- and preferably only one -- obvious way to do it. If the implementation is easy to explain, it may be a good idea." AFAIK there is not a JavaScript version of Python which is fully compliant with the Python 2.6 specification.
- ronreiter 15y agoI think he meant that it would be better if the Python interpreter would be implemented in Javascript. right?
- MostAwesomeDude 15y agoYes, and I meant that it would not be better to do this in JavaScript: It's far eaiser and simpler to have a real Python interpreter be doing the heavy lifting.
- ronreiter 15y agoI think he meant that it would be better if the Python interpreter would be implemented in Javascript. right?