MetaCall Polyglot REPL
This repository implements a Polyglot REPL which shares the state of the meta-object protocol between the REPLs. Using the Polyglot REPL, you can share state between multiple languages through their individual REPL and mix code straight from your terminal.
api.js provided in the
src provide five functions:
initialize: To initialize the Polyglot REPL
execute: To execute a line, function or module after a REPL has been selected.
destroy: Destroy the REPL and exit gracefully.
available: Check all the available REPLs.
cli.js provided in the
src provides a way to develop your own REPLs and execute code straight from the command line. You can sutomize the existing REPL or define a new one.
The entry script
index.js provides an abstraction over the usage of the high-level APIs defined above through the following commands:
%repl <tag>: Switch from different REPL (available tags: node py) %inspect: Show available functions %available: Show available REPLs %eval <tag> <code>: Load inline code, useful for loading inter-language functions for the REPL %load <tag> <file_0> <file_1> ... <file_N>: Load a file, useful for loading inter-language functions for the REPL %exit: Finalizes the REPL
curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | sh
For running it: