Summary of common programming language support for REPL

Source: Internet
Author: User
Tags codepad

Recently chatting with a friend about some of the features of the programming language, he has a comment that makes me think: "Not repl are scum." Of course this is a bit biased, but we can look at what we use in our programming languages, which support REPL, what doesn't, and Repl's profile.

In the General scripting language, it is normal to have REPL, because REPL is very convenient. Programming terminology REPL (Read-eval-print Loop) Chinese words are translated into "interactive interpreter" or "interactive programming environment". However, I do not think it is necessary to translate, direct repl, such terminology, translated into Chinese, the reader is more difficult to understand. Here's an explanation for REPL:

A Read-eval-print-loop (REPL) is available both as a standalone program and easily includable in other programs. REPL provides a-interactively run JavaScript and see the results. It can be used to debugging, testing, or just trying things out.

The interactive interpreter (REPL) can be run as a standalone program or easily included in other programs as part of a whole program. REPL provides an interactive way to run JavaScript scripts and view running results, often repl interactive ways to debug, test, and experiment with some kind of idea.

Here are some common programming languages for native support for REPL: Hefeng County Tobacco Monopoly Bureau

    • A repl language.
      • Common Lisp
      • Ruby
      • Python
      • Lua
    • Native language without REPL
      • Javascript
      • Php
      • Java
      • C#
      • C++
      • Haxe
A repl language.

1. Common Lisp

General Common Lisp implementations have REPL, such as Clozure CL, which is used on Macs, and even the version of the Mac App store.

2. Ruby

The official implementation takes REPL, but the command is IRB, meaning interactive ruby Shell, not Ruby. Exit (), the Quit () command can exit. At the same time, there is also a web version of Tryruby (also a ruby online teaching), interested to see.

3. Python

The official implementation band REPL, directly with the Python command, without parameters to enter the REPL environment, with exit () exit.

4. Lua

Official implementation with REPL, directly with the LUA command.

Native language without REPL

1. JavaScript

JavaScript-like scripting languages should be repl, but JavaScript is a common language that runs in browsers, so it's a bit special. But there are some implementations, like Mozilla's rhino, that can Google itself.

In addition, I recommend using the recently popular node. js to do Repl, although node. JS is generally considered a server-side scripting environment, but it is a good repl environment, with some common JavaScript library environment, and support NPM, More powerful than Rhnio. The simple use of the node. js method under Mac is with Brew, although the version may be somewhat old.

2. PHP

PHP, as a common scripting language on the server side, is designed to be an Apache mod language, so it doesn't take repl, although it should be with its language type, but Facebook has implemented a PHP repl PHPSH for us. The interesting thing is that the implementation was installed through Python ...

3. JAVA

Java as a traditional static type language, itself is not with the REPL environment, but there are beanshell.

After the BeanShell is downloaded, place the. jar file in the library directory that Java can find, such as the ~/library/java/extension directory under Mac, and then through the command Java BSH. Interpreter to run, use Exit (), command to exit.

Typically in. Bash_profile with alias Ijava= ' Java BSH. Interpreter ' simplifies to the Ijava command.

There are also some people who recommend using a language environment like closure, Groovy, Scala and other JVMs with REPL (generally compatible with Java) to do Repl, no trial, no rating.

4. C #

It is said that there will be an official implementation of the REPL, there are some third-party implementations, such as Mono on its own repl. After you install mono, you can enter C # REPL by executing the csharp command.

5. C + +

Cling, there is a Mac version of the direct download, but the way to run a bit strange, that is, in the extracted directory run./bin/root (not in the bin directory), you need to install Xquartz The X environment under this Mac, with exit (); exit.

It is a surprise to discover that C + + can have repl, although in essence C + + is not a suitable repl language. And cling this repl is not even easy to define a function.

6. Haxe

IHX can be installed directly through the Haxelib install IHX and then run via Haxelib run IHX. There is also a Web page running version http://try.haxe.org/, add alias ihx= ' haxelib run Ihx ' in ~/.bash_profile, execute ihx to enter Haxe repl.

Other

repl.it

This does not know how to categorize, repl.it itself support multiple languages, run on the Web page. Although it feels like some versions are older (such as Ruby or 1.8.x version), but as a Web service, and support so many languages, it is easy to try to use. The following languages are supported:

  • Classical Language (Classic)
    • Qbasic:structured Programming for beginners.
    • Forth:an Interactive stack-oriented language.
  • Practical language (practical)
    • Ruby (Beta): A natural Dynamic object-oriented language.
    • PYTHON:A Dynamic language emphasizing readability.
    • LUA:A lightweight Multi-paradigm scripting language.
    • Scheme:an elegant dynamic dialect of Lisp.
  • Bizarre language (esoteric)
    • Emoticon:programming with an extra dose of smile.
    • BRAINFUCK:A Pure Turing Machine controller.
    • Lolcode:the Basic language of lolcats.
    • Unlambda:functional Purity given form.
    • Bloop:nothing but bounded loops.
  • Page Language (web)
    • Javascript:the de facto language of the Web.
    • Javascript.next:The JavaScript of tomorrow.
    • Move:the Easy-to-program the Web.
    • kaffeine:extended JavaScript for Pros.
    • Coffeescript:unfancy JavaScript.
    • Roy:small functional language that compiles to JavaScript.
Codepad

Codepad This is not REPL, but allows you to run many languages on a Web page without installing any compilers, so it is sometimes convenient. In particular, you want to simply give some code snippets so that others can quickly reach the results. Codepad will automatically generate an address that you can share directly, such as this python fragment. Anyone who clicks submit can see the results quickly. This way of sharing snippets is a bit more advanced than SNIPPLR and GitHub gist, which simply stick to the code. The following languages are supported:

    • C
    • C++
    • D
    • Haskell
    • Lua
    • OCaml
    • Php
    • Perl
    • Plain Text
    • Python
    • Ruby
    • Scheme
    • Tcl

Summary of common programming language support for REPL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.