HN user

max99x

35 karma
Posts1
Comments13
View on HN

Really hard to say. We started experimenting with the idea back in March, but didn't start putting fulltime nights into it until August. I'd say a little over a thousand man-hours over the span of 6 months, but I may be well off the mark.

The prompt label is an image, hence it's not copyable. We experimented a bit with various copy-friendly approaches, but couldn't find anything that was cross-browser and did not damage the look/layout we were going for. To share a session, click the save button on the top right - it'll generate a shareable link with the editor content and the whole REPL session in replayable form.

To add to this, each language has an about link and an engine link (shown at the bottom when you select a language). These will take you to a page describing the language and the interpreter we're using, respectively.

Thanks for trying it out.

* The ^W is fixable, but I'm not sure how I personally feel about hijacking fundamental browser shortcuts. We'll look into it though.

* Regarding the environment, in general, multi-threading and multi-processing (and anything that depends on them) are not supported, since Emscripten translates the code to JS rather than emulating a machine.

* The Emscripten virtual filesystem has a simple single-user permission model and the libc functions for accessing/modifying the permissions are supported. So technically you could get the permissions through os.access. Not as convenient as ls, of course, but doable.

You might be hitting the fact that QBasic actually requires keywords to be in capitals. The original IDE did the conversion for you, but repl.it doesn't. We should really be more lenient about those. For now, check the existing examples and use your trusty caps lock.

I think ideone and/or your editor converts tabs to 8 spaces. Trying a tab indent followed by an 8-space one raises an error in native IPython for me. In any case, we're using normal CPython compiled to JavaScript, so it's unlikely to change finer points of the behaviour like this.

repl.it is an online REPL that supports 15+ languages, from Python to QBasic, using language interpreters written in JavaScript or compiled to JavaScript using Emscripten (http://emscripten.org/).

This project grew from @amasad and me wanting a quick way to try out little snippets of code while learning a new language or when away from our work machines.

We opted to have all the execution client-side to provide a smooth experience where you don't have to wait for the server to respond to every command. Technically you don't even need an internet connection once it's cached. You can also save your REPL session and resume from another machine, or share it with other people. We have beta support for mobile devices, so you can REPL from your Android or iPhone, though Ruby and Python are still not supported on iOS.

The code is open sourced under the MIT license and available from GitHub (https://github.com/replit).

All feedback greatly appreciated!

Most pieces are positioned in the middle of a square. A simple way to recognize the color of the piece and its square is to do a flood fill with a bit of tolerance (say 32/256) from the center pixel. The area covered by the flood fill will only contain the pixels making up the piece, while the area outside the flood fill will have pixels the color of the square. Reflections might cause a bit of noise, but a slight gaussian blur should be enough to get over that.