12

Now that we have snippets (which are awesome), I would like to suggest we use repl.it to add support for more languages that are not just web-related.

I know snippets just started, so implementing a new engine might be a problem at this point. Still, I think it would be a good idea (even if it gets added in a year or two), for all the reasons explained in the original thread.

Adding repl.it will offer support for a whole lot of scripting languages, including Python, Ruby, CoffeeScript and Lua. The best part is that repl.it uses jsREPL, which is a sandbox - meaning over time, we can add new languages to it..

So what do you think?

--- edit 6.11 ---

I posted this a year ago. REPL.it has gone a long way since then - it loads quickly, it has expanded to include a lot more languages, has sharing functionalities, and now introduces a set of tools for teaching purposes. So I'm bumping the discussion. Anyone wants to rethink this?

5
  • 1
    I like repl.it but it can be pretty slow.... Not a good thing for SE.
    – Ben
    Commented Oct 26, 2014 at 8:52
  • @Ben I think it's solvable. The engine can take sometime to load but after that it's (usually) pretty smooth. We can overcome that by pre-loading the engine after the entire page is loaded (only on pages with snippets) so when the user gets to actually clicking to run the snippet he has to wait a lot less.
    – yuvi
    Commented Oct 26, 2014 at 9:01
  • 1
    My main concern is that the code is quite large, which is definitely a factor in implementing new features. For example, one of the reasons why a request to enable MathJax on Stack Overflow was that it slowed down loading times quite a bit, amongst other reasons. Commented Oct 26, 2014 at 9:32
  • @Qantas94Heavy repl.it loads very fast for me. maybe I just have a good connection, but I think it's pretty decent
    – yuvi
    Commented Oct 26, 2014 at 20:25
  • I almost made a duplicate of this but I'm glad I found this old treasure. It would be awesome to have an repl.it inside an iframe or something. 👍 Commented Dec 20, 2019 at 0:03

2 Answers 2

-3

Lua can already be supported by using Fengari, no repl.it necessary. See my other answer here: https://meta.stackoverflow.com/a/394310/234175

9
  • 1
    Okay, that's one extra library everyone needs to load for one additional language... That doesn't scale very well...
    – Cerbrus
    Commented Mar 2, 2020 at 13:50
  • @Cerbrus Why would they need to load it if it's not used in a particular question? This is no different than just importing jquery or angular js. You can use the same argument against those libraries.
    – greatwolf
    Commented Mar 2, 2020 at 22:31
  • You could dynamically add the library to pages when a new answer pops up that requires it, but that'd be even more of a hassle... jQuery is actually used by SE, and people usually have that cached any way.
    – Cerbrus
    Commented Mar 2, 2020 at 22:33
  • So if a question that say has nothing to do with Lua, let say it's about Python or Node.js, does the viewer of that page have to load Fengari? I'm thinking no since there's no <script> tag in there to pull that in. Assuming that's true, then why is this not scalable? You're not loading what isn't used.
    – greatwolf
    Commented Mar 2, 2020 at 22:39
  • Because that'll be dozens of checks for dozens of different libraries that should or shouldn't be loaded, on each page load.
    – Cerbrus
    Commented Mar 2, 2020 at 22:41
  • Why would it need to check for some library that isn't even mentioned at all? How would it even know about it to check it? That doesn't make any sense.
    – greatwolf
    Commented Mar 2, 2020 at 22:42
  • You're suggesting SE builds in support for a certain library, and you're suggesting not loading said library if it's not needed. How does the server know it's not needed? By checking if an answer or the question requires it. Multiply that by the amount of languages you're supporting those libraries for... If it were as simple as just loading the library in a snippet, people would've been doing it already. SE explicitly needs to build it into the snippets.
    – Cerbrus
    Commented Mar 2, 2020 at 22:45
  • No, I'm not suggesting SE build in support for that. I'm saying if a user wants to have runnable Lua code in snippets, they can just pull that in using <script> tags. No involvement from SE support need beyond what's currently available.
    – greatwolf
    Commented Mar 2, 2020 at 22:47
  • This is a feature request for SE-side support...
    – Cerbrus
    Commented Mar 2, 2020 at 22:49
-6

It might be worthwhile now to check if the speed of repl.it has improved. It would be nice, more generally, to easily link to outside snippets and maybe have StackOverflow pull in the code into the answer or to another place so that it's backed up in case the site goes down for whatever reason.

Repl.it is invaluable for Python answers for example.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .