Skip to main content

"replay-based" REPL for compiled languages

Project description

reple

Interactive REPL for executable-based software toolchains.

Ever wished you could have an interpreter for your executable-based compiled language toolchains? reple simulates an interpreter to create a REPL for you. Each time you enter a command, reple compiles and runs your program, printing out any new input.

The advantage to this approach is that reple only requires a simple config file to create a REPL for a new language or executable-based runtime system. If your language or runtime system is not available, adding it will likely only take a few minutes!

Installation

Just install the reple pip package.

[xiii@reple ~]$ pip3 install reple
[xiii@reple ~]$ reple.py -env cxx
> printf("Hello, World!\n");
Hello, World!

If you install the package locally, you might need to add ~/.local/bin to your path.

Running

To start an interactive REPL session, call reple.py with the title of a configuration file defined in the /configs directory.

[xiii@reple xiii]$ reple.py -env cxx
> printf("Hello, world!\n");
Hello, world!
> int x = 12;
> int y = x + 2;
> std::cout << y << std::endl;
14
>

Some more complicated runtimes, like MPI, may have optional runtime flags.

[xiii@reple home]$ reple.py -env mpicxx --rargs "-n 8"
> int rank, nprocs;
> MPI_Comm_rank(MPI_COMM_WORLD, &rank);
> MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
> printf("Hello, world! I'm %d/%d\n", rank, nprocs);
Hello, world! I'm 0/8
Hello, world! I'm 1/8
Hello, world! I'm 2/8
Hello, world! I'm 4/8
Hello, world! I'm 6/8
Hello, world! I'm 3/8
Hello, world! I'm 5/8
Hello, world! I'm 7/8
> 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reple-0.1.0.2-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file reple-0.1.0.2-py3-none-any.whl.

File metadata

  • Download URL: reple-0.1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for reple-0.1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 99f50207de376091877d6915e4ee098ae8370087e54a4f9c8af699e31b3db0a0
MD5 5c5476bba711f613fda8f8f70f5b9817
BLAKE2b-256 07fc579c3853db5ce2676ed198328d417cac18a2cd70dec2ef8accca37d88778

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page