Hacker Newsnew | past | comments | ask | show | jobs | submit | max99x's commentslogin

Actually Steve Hanov's implementation which we're using does have canvas support. You can find it at http://stevehanov.ca/blog/index.php?id=92. We stripped the graphical parts since they make little sense in our UI. At some point we may add graphics support, but if we do it will be to all (or at least the majority of) the languages.


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.


It was a fruitful experience and if we want to count in the hours of reading and studying that this project has spawned, it would be much more than that.

Anyways, the real question is "how much did it cost?": $1600+ in sushi dinners! :)


Currently you can save a replayable session and get a unique link, but this is public. We do have plans to remember history locally (either just as command history or a full-blown session) in the future. The initial relevant issue is at https://github.com/replit/repl.it/issues/15.


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.


I will note that when copying the text out of the interpreter, the prompt (>) doesn't copy (I assume that you may be using a CSS :after or :before decorator, though I didn't look). Sometimes even the newline itself didn't copy. For that post I had to cleanup all of the text so that it would display properly. This may be an issue you want to look at if you want to support people copy/pasting stuff that they are working on out of the console (or you may just want to add a button that generates a Github gist or pastebin entry and displays a link to it).


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.


I've spoken a little about the reason we couldn't use GHC among other things, at https://github.com/replit/repl.it/issues/43. In short, we need an interpreter rather than a compiler or a JIT, and we need the interpreter itself to run in the browser.


Thanks for a quick reply. So having GHCi - the GHC's REPL - successfully emscripted could make adding Haskell support possible, right?


If it uses a JIT internally, it will produce x86 machine code, which is meaningless to us since we aren't emulating the whole machine. If it doesn't, then emscripting it should work.


Thanks for the report. We're handling input as raw keystrokes for flexibility, so the more advanced features are sometimes not supported. I've opened an issue for it (https://github.com/replit/jq-console/issues/19) in the appropriate repository. Feel free to watch that for updates.


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.


The actual QuickBASIC compiler allowed any case for keywords.

The lack of line numbers was a bit confusing too - my first inclination when seeing a BASIC prompt is to type

  10 PRINT "hello"
  20 GOTO 10
Aside from that, it seems to work as expected (at least in the quick tests I tried).


Numeric labels also don't work:

  10: PRINT "hello"
  GOTO 10
This works though:

  label: PRINT "hello"
  GOTO label


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.


in CPython (at least, on my mac) mixing tabs and 8 spaces works perfectly fine. try it out!


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!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: