Web-based REPL’s for many languages

I only just recently learned the term “REPL”. It essentially means “command line”. You type code in, it runs, you see output.

Read, Eval, Print, Loop.

JavaScript

We’re web folks ’round here, so JavaScript makes for an easy example. The “console” in your browser’s DevTools is a REPL for JavaScript.

javascript-repl.gif

There is a console on CodePen as well, which can be useful because you can create examples that link to REPL output:

codepen-repl-output.png

You could also think of CodePen as a REPL for HTML, CSS, and JavaScript, alongside a variety of preprocessor languages like Sass, Less, Stylus, CoffeeScript, etc.

Future JavaScript

Babel is a compiler that turns future-syntax JavaScript into current-generation JavaScript. You can play with Babel right on their website, and they straight up call it a REPL:

babel-repl.png

CoffeeScript offers their own as well:

coffeescript.png

Ruby

repl.it is a a web-based REPL for a bunch of languages, including Ruby.

ruby-repl.png

You can save your examples for later reference as well.

Python

Skulpt lets you run Python entirely in the browser.

python.gif

PythonAnywhere also has IPython, an online interpreter.

ipython.png

PHP

repl.it seems to be a good choice here again:

php.png

For the record, repl.it supports an impressive number of languages, so if you’re looking for a specific one, you might try there first.

many-languages.png

Java

Java REPL has a console that is as simple as it gets:

java.png

Swift

IBM makes a REPL for Swift. They call it a sandbox, which is a common name for these kinds of things.

swift.png

Clojure

Clojure is weird. I enjoyed TryClojure because it not only allows you to write/execute Clojure, but also walks you through learning it interactively:

closure.png


Happy coding!

Comments

  • tjedison

    Off course, there’s Sassmeister for Sass.

  • Raymi Saldomando

    Off course, there’s CodePicnic https://codepicnic.com/ for trying any REPL of any language

  • Alex R. Coto

    Take a look at Jupyter too, it’s awesome! http://jupyter.org

  • Great stuff, recommending on Disqus.

  • Most of the languages compiled in javascript can be debugged directly in source with chrome, as the compilation generate a line to line correspondance.

Related Articles