Implements a polyglot REPL which supports multiple languages and shared meta-object protocol scope between REPLs.

Overview

MetaCall Polyglot REPL

image

Description

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.

The high-level api.js provided in the src provide five functions:

  • initialize: To initialize the Polyglot REPL
  • select: To select the individual language REPL; Currently Python (py) and JavaScript (node) are supported.
  • 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.

The 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 
   
    : Switch from different REPL (available tags: node py)
  %inspect: Show available functions
  %available: Show available REPLs
  %eval 
     
     : Load inline code, useful for loading inter-language functions for the REPL
  %load 
       
        
        
          ... 
         
          : Load a file, useful for loading inter-language functions for the REPL %exit: Finalizes the REPL 
         
        
       
      
    
   

Installation

  1. Install MetaCall:

    curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | sh
  2. For running it:

    metacall index.js

LICENSE

Apache 2.0

You might also like...
A small site to list shared directories
A small site to list shared directories

Nebula Server Directories This site can be used to list folder and subdirectories in your server : Python It's required to have Python 3.8 or more ins

PyPI package for scaffolding out code for decision tree models that can learn to find relationships between the attributes of an object.

Decision Tree Writer This package allows you to train a binary classification decision tree on a list of labeled dictionaries or class instances, and

About A python based Apple Quicktime protocol,you can record audio and video from real iOS devices

介绍 本应用程序使用 python 实现,可以通过 USB 连接 iOS 设备进行屏幕共享 高帧率(30〜60fps) 高画质 低延迟(200ms) 非侵入性 支持多设备并行 Mac OSX 安装 python =3.7 brew install libusb pkg-config 如需使用 g

Protocol Buffers for the Rest of Us

Protocol Buffers for the Rest of Us Motivation protoletariat has one goal: fixing the broken imports for the Python code generated by protoc. Usage He

An esoteric programming language that supports concurrency, regex, and web requests.

The Hofstadter Esoteric Programming Language Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's La

Aero is an open source airplane intelligence tool. Aero supports more than 13,000 airlines and 250 countries. Any flight worldwide at your fingertips.

Aero Aero supports more than 13,000 airlines and 250 countries. Any flight worldwide at your fingertips. Features Main : Flight lookup Aircraft lookup

A feed generator. Currently supports generating RSS feeds from Google, Bing, and Yahoo news.

A feed generator. Currently supports generating RSS feeds from Google, Bing, and Yahoo news.

A minimalist personal blogging system that natively supports Markdown, LaTeX, and code highlighting.
A minimalist personal blogging system that natively supports Markdown, LaTeX, and code highlighting.

December Welcome to the December blogging system's code repository! Introduction December is a minimalist personal blogging system that natively suppo

Hello World in different languages !
Hello World in different languages !

Hello World And some Examples in different Programming Languages This repository contains a big list of programming languages and some examples for th

Comments
  • Package this properly so it can be reused in the CLI on the Core or Jupyter Kernel

    Package this properly so it can be reused in the CLI on the Core or Jupyter Kernel

    This project should be separated so we have a folder lib with the API and the index.js as the binary for launching this. It should be highly configurable and embeddable on other projects.

    opened by viferga 1
  • README Updates and API Docs

    README Updates and API Docs

    Description

    This PR adds the README updates and the API Docs. A GIF has been added as well to display the functionality of the Polyglot REPL for better understanding.

    opened by HarshCasper 0
  • MetaCall Core seems to fail in order to close the application gracefully

    MetaCall Core seems to fail in order to close the application gracefully

    I have found this bug while implementing this project, here's the logs:

    There are 9 handle(s) keeping the process running
    
    # FSREQWRAP
    ~/Downloads/metacall-polyglot-repl/index.js:15 - fs.readdir(scriptsPath, (err, files) => {
    ~/Downloads/metacall-polyglot-repl/index.js:12 - const load = () => new Promise((resolve, reject) => {
    ~/Downloads/metacall-polyglot-repl/index.js:43 - const functions = await load();
    ~/Downloads/metacall-polyglot-repl/index.js:52 - })();
    
    # INSPECTORJSBINDING
    ~/Downloads/metacall-polyglot-repl/scripts/repl.js:8 - const r = repl.start({
    
    # TickObject
    (unknown stack trace)
    
    # Immediate
    ~/Downloads/metacall-polyglot-repl/scripts/repl.js:22 - setImmediate(callback);
    
    # Immediate
    ~/Downloads/metacall-polyglot-repl/scripts/repl.js:17 - setImmediate(() => this.push(null));
    
    # TickObject
    (unknown stack trace)
    
    # TickObject
    (unknown stack trace)
    
    # TickObject
    (unknown stack trace)
    
    # TickObject
    ~/Downloads/metacall-polyglot-repl/scripts/repl.js:37 - return r.close();
    ~/Downloads/metacall-polyglot-repl/index.js:47        - await functions['node_repl_close']();
    

    Once this is completely solved, remove this line: https://github.com/metacall/polyglot-repl/blob/ffa9cc1c97c8f347837e51664312097a312a3113/index.js#L84

    opened by viferga 0
Owner
MetaCall
MetaCall
A flexible free and unlimited python tool to translate between different languages in a simple way using multiple translators.

deep-translator Translation for humans A flexible FREE and UNLIMITED tool to translate between different languages in a simple way using multiple tran

Nidhal Baccouri 806 Jan 4, 2023
A ULauncher/Albert extension that supports currency, units and date time conversion, as well as a calculator that supports complex numbers and functions.

Ulauncher/Albert Calculate Anything Ulauncher/Albert Calculate Anything is an extension for Ulauncher and Albert to calculate things like currency, ti

tchar 67 Jan 1, 2023
Basic Clojure REPL for Sublime Text

Basic Clojure REPL for Sublime Text Goals: Decomplected: just REPL, nothing more Zero dependencies: works directly with pREPL Compact: Display code ev

Nikita Prokopov 23 Dec 24, 2021
Replite - An embeddable REPL powered by JupyterLite

replite An embeddable REPL, powered by JupyterLite. Usage To embed the code cons

Jeremy Tuloup 47 Nov 9, 2022
Calc.py - A powerful Python REPL calculator

Calc - A powerful Python REPL calculator This is a calculator with a complex sou

Alejandro 8 Oct 22, 2022
tox-gh is a tox plugin which helps running tox on GitHub Actions with multiple different Python versions on multiple workers in parallel

tox-gh is a tox plugin which helps running tox on GitHub Actions with multiple different Python versions on multiple workers in parallel. This project is inspired by tox-travis.

tox development team 19 Dec 26, 2022
Run python scripts and pass data between multiple python and node processes using this npm module

Run python scripts and pass data between multiple python and node processes using this npm module. process-communication has a event based architecture for interacting with python data and errors inside nodejs.

Tyler Laceby 2 Aug 6, 2021
Zeus is an open source flight intellingence tool which supports more than 13,000+ airlines and 250+ countries.

Zeus Zeus is an open source flight intellingence tool which supports more than 13,000+ airlines and 250+ countries. Any flight worldwide, at your fing

DeVickey 1 Oct 22, 2021
Shared utility scripts for AI for Earth projects and team members

Overview Shared utilities developed by the Microsoft AI for Earth team The general convention in this repo is that users who want to consume these uti

Microsoft 38 Dec 30, 2022
Scripts to convert the Ted-MDB corpora into the formats for DISRPT shared task and the converted corpora

Scripts to convert the Ted-MDB corpora into the formats for DISRPT shared task and the converted corpora.

null 1 Feb 8, 2022