• Stars
    star
    242
  • Rank 160,747 (Top 4 %)
  • Language
    Go
  • License
    GNU General Publi...
  • Created over 5 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Pry open those interpreters.

Prybar

Prybar is a universal interpreter front-end. Same interface, same REPL, different languages.

Why

At Repl.it, we're in the business of running REPLs. As it happens to be, every language implements them differently. We wanted them to all behave the same: run code and drop into a REPL!

How it works

Prybar, written in Go, maintains a common command-line interface that calls into a select language backend. When possible, the language backends are implemented using cgo and the language's C-bindings. Otherwise, they make use of a small script written in the host language which starts a Prybar-compatible REPL.

Usage

Usage: ./prybar-LANG [FLAGS] [FILENAME]...
  -I	interactive (use readline repl)
  -c string
    	execute without printing result
  -e string
    	evaluate and print result
  -i	interactive (use language repl)
  -ps1 string
    	repl prompt (default "--> ")
  -ps2 string
    	repl continuation prompt (default "... ")
  -q	don't print language version

Language Support

language eval eval expression eval file repl repl like eval set prompt
Clojure ✔ ✔ ✔ ✔ ✔ -
Emacs Lisp ✔ ✔ ✔ ✔ ✗ ✔
Javascript (nodejs) ✔ ✔ ✔ ✔ ✔ ✔
Javascript (spidermonkey) ✔ ✗ ✗ ✗ ✗ -
Julia ✔ ✗ ✔ ✔ ✗ ✔
Lua 5.1 ✔ ✗ ✔ ✔ ✗ ✔
OCaml ✔ ✔ ✔ ✔ ✗ ✔
Python 2.7 ✔ ✔ ✔ ✔ ✔ ✔
Python 3.x ✔ ✔ ✔ ✔ ✔ ✔
R ✔ ✗ ✗ ✔ ✗ ✗
Ruby 2.5 ✔ ✔ ✔ ✔ ✗ ✗
SQLite ✔ ✔ ✔ ✔ ✗ ✔
Tcl ✔ ✔ ✔ ✗ ✗ -

Start to Develop with Nix

To get started developing Prybar, you can use the nix shell. Enter

nix develop

to drop into a shell that has all dependencies installed an ready to go.

If you don't have nix yet, install that: https://nixos.org/

Build and run

% make help
usage:
  make all          Build all Prybar binaries
  make prybar-LANG  Build the Prybar binary for LANG
  make docker       Run a shell with Prybar inside Docker 
                    (don't do this in the nix shell, although this is
                                            not needed if you use nix)
  make image        Build a Docker image with Prybar for distribution
  make test         Run integration tests
  make test-image   Test Docker image for distribution
  make clean        Remove build artifacts
  make help         Show this message

You can also use Docker

Prybar uses Docker to make it easy to get started with development. First, you must install Docker. Then, run:

$ make docker

to create a Docker image containing the Prybar code and all of its dependencies, and launch a shell inside of it. The Prybar source repository will be synchronized with the working directory of the container's filesystem, so you only need to re-run make docker if you change the Dockerfile or any of its scripts.

To build Prybar (this should be done inside make docker unless you have installed all of Prybar's dependencies on your system), run make or make all. Then the prybar-LANG binaries will be available in the working directory and on $PATH, one for each supported language LANG (see the languages subdirectory of this repository):

$ prybar-python3 -h

Distribution

Run make image to create a Docker image containing not only Prybar's dependencies and source code but also its compiled binaries, which can be embedded inside other Docker images by means of COPY --from=basicer/prybar.

This image is automatically built and deployed to Docker Hub every time a commit is merged to master.

License

Copyright (C) 2004-2018 Neoreason, Inc. et al.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.

See the COPYING file for more information regarding the GNU General Public License.

More Repositories

1

kaboom

💥 JavaScript game library
TypeScript
2,376
star
2

clui

CLUI is a collection of JavaScript libraries for building command-driven interfaces with context-aware autocomplete.
TypeScript
1,233
star
3

upm

â • Universal Package Manager - Python, Node.js, Ruby, Emacs Lisp.
Go
1,021
star
4

ReplitLM

Inference code and configs for the ReplitLM model family
Python
900
star
5

polygott

Base Docker image for the Repl.it evaluation server
Shell
386
star
6

codemirror-vim

Vim keybindings for CM6
JavaScript
244
star
7

play

The easiest way to start coding games and graphics projects in Python
Python
182
star
8

replit-py

A helpful Python package that helps you build excellent things inside Repls! 💻
Python
151
star
9

crosis

A JavaScript client that speaks Replit's container protocol
TypeScript
109
star
10

codemirror-interact

TypeScript
92
star
11

ReplitClient.js

A JavaScript client library used to connect to the server-side code execution service
67
star
12

replit-vscode

Replit in vscode
TypeScript
54
star
13

evalbot

A bot that speaks code
JavaScript
48
star
14

codemirror-indentation-markers

A CodeMirror extension that renders indentation markers
TypeScript
44
star
15

repl.sh

Sometimes you need a shell (alpha release)
JavaScript
37
star
16

extensions

A client library for the Replit Extensions API
TypeScript
33
star
17

Codemirror-CSS-color-picker

A codemirror extension that adds a color picker input next to CSS color values. Development happens on Replit, just fork and hit run! https://replit.com/@util/Codemirror-CSS-color-picker
TypeScript
30
star
18

codemirror-vscode-keymap

VSCode keyboard shortcuts for CodeMirror 6
TypeScript
29
star
19

nixmodules

Nix
27
star
20

codemirror-lang-svelte

Svelte language support for CodeMirror 6
TypeScript
26
star
21

codemirror-minimap

Minimap extension for Codemirror 6
TypeScript
25
star
22

river

Long-lived Streaming Remote Procedure Calls
TypeScript
24
star
23

database-go

Go client for Repl.it Database
Go
22
star
24

pyright-extended

pyright with yapf and ruff
Python
20
star
25

nixpkgs-replit

Nix
19
star
26

rfbproxy

An RFB proxy that enables WebSockets and audio.
Nix
19
star
27

blog

the code behind https://blog.replit.com/
EJS
19
star
28

replit-code-exec

A library that allows interacting with Replit's code-exec API
Python
18
star
29

protocol

The Protocol definition file and language bindings
JavaScript
17
star
30

codemirror-emacs

Emacs keybindings for CM6
TypeScript
14
star
31

express-router-async

Creates an express router augmented with promise handling routes
JavaScript
13
star
32

replbox

JavaScript
12
star
33

codemirror-lang-nix

A Nix language mode for CodeMirror 6
TypeScript
11
star
34

kaboomware

TypeScript
9
star
35

go-replidentity

Go implementation of Repl Identity
Go
9
star
36

extensions-react

Replit Extensions React Client
TypeScript
9
star
37

nix-editor

an automatic editor for replit.nix files
Rust
8
star
38

replit-ai-python

The library for Replit AI
Python
7
star
39

repl-auth

Allow your users to sign in with Replit!
JavaScript
7
star
40

audio-libs

Audio bindings for javascript
Python
6
star
41

toml-editor

Rust
6
star
42

codemirror-lang-csharp

TypeScript
6
star
43

homebrew-tap

Homebrew tap for Repl.it open-source.
Ruby
5
star
44

replit-node

A node.js library that helps you build excellent things inside Repls!
TypeScript
5
star
45

replit-ai-modelfarm-typescript

TypeScript
4
star
46

nixsysdeps

A mapping from language packages to nixpkgs system dependencies
Shell
4
star
47

codemirror-lang-solidity

CodeMirror 6 extension for Solidity language support and syntax highlighting
TypeScript
4
star
48

ztoc-rs

SOCI ztoc index builder
Rust
4
star
49

alcor

Serialize and hydrate complex javascript objects
TypeScript
4
star
50

replkit

TypeScript
3
star
51

kaboomsite

Website for Kaboom.js
JavaScript
2
star
52

example-repltweet

An example of using replit-py for exploring the world of web applications! 🗺
JavaScript
2
star
53

abcd-amasad

abcd-amasad created by GitHub Classroom
HTML
2
star
54

scoop-bucket

Scoop bucket for Repl.it open-source.
2
star
55

heroku-bot

A bot that responds to a slack slash command with a diff of commits going out to heroku
JavaScript
1
star
56

ruspty

PTY for Bun (and Node) through Rust FFI
JavaScript
1
star
57

repl-auth-node

Nodejs client for Repl Auth functions!
JavaScript
1
star
58

protocol-go

Mirror for Go package for repl.it protocol. Actual package here https://github.com/replit/protocol/
1
star