Live data from Hacker News

Try Python, Ruby, Lua, Scheme, QBasic, Forth ...

repl.it

11–20 of 81 posts

Re: Try Python, Ruby, Lua, Scheme, QBasic, Forth ...

#13
post #10

Would it be possible to implement user input via the REPL instead of the current javascript prompts? Would be much less clunky. Also, at the moment something like this doesn't work at all (Python): while True: user_input = raw_input() if user_input is 'q': break else: print user_input

This problem happens with Python/Lua/Ruby because they're compiled from their original lower-level implementations using Emscripten. Which means everything have to work synchronously and there is no way to stop execution in order to get the user's input, unless we transform the code into CPS, which will probably make it much slower.

Re: Try Python, Ruby, Lua, Scheme, QBasic, Forth ...

#15
post #11

I'm unsure about the Scheme that is included. It claims to be R6RS which requires support for exact numerical operations including big integers and rationals. Currently it seems to use only double precision floating point instead of exact integer values!

Thanks, will look into this.

Re: Try Python, Ruby, Lua, Scheme, QBasic, Forth ...

#17
This is awesome! I see this replacing my normal pastebin/ideone workflows ...

One comment: in python, technically tabs are equivalent to 8 spaces, but in your REPL it is equivalent to 4 spaces. Is that a modification to the version of python you are using, or did you make a decision to match 4 spaces (BTW: I really like this, but it breaks some older code)

Re: Try Python, Ruby, Lua, Scheme, QBasic, Forth ...

#19
post #17

This is awesome! I see this replacing my normal pastebin/ideone workflows ... One comment: in python, technically tabs are equivalent to 8 spaces, but in your REPL it is equivalent to 4 spaces. Is that a modification to the version of python you are using, or did you make a decision to match 4 spaces (BTW: I really like this, but it breaks some older code)

In python you can use tabs or spaces (however many) as long as it is consistent. Don't mix tabs and spaces. 4 spaces recommended.

Style Guide: http://www.python.org/dev/peps/pep-0008/ Indentation Myths: http://www.secnetix.de/olli/Python/block_indentation.hawk

Re: Try Python, Ruby, Lua, Scheme, QBasic, Forth ...

#20

I am amazed, more so by the fact that you made the source code available (and also since it's made with node.js). I will have a lot of fun either with the app itself or the source code. Thanks!

Everything happens on client-side the server is just for saving sessions and file serving. So technically its not written in node.js. Node is only a dependency for the development tools we use (coffee-script, mini-server for development). However the server running repl.it is written in Node, its nothing fancy but it makes us run cheap and it will be open-sourced soon.
Post reply on HN