Skip to content

dloscutoff/pip

Repository files navigation

Pip

Pip is an interpreted, imperative code-golf language. See the GitHub wiki for an introduction to the language, or the documentation site for a language reference.

Why Pip?

Unlike most golfing languages, but like many practical languages, Pip is an imperative language with infix operators. It also uses plain ASCII instead of a custom codepage. These features make it a great introduction to golflangs for users of imperative languages like Python, JavaScript, and Perl.

In a survey of Code Golf StackExchange submissions, Pip scored slightly better than GolfScript and CJam, but not quite as good as Pyth.

Usage

You can run Pip at the following online interpreters:

  • Attempt This Online typically supports the latest release of Pip (but possibly not the latest commit). (Thanks to pxeger for adding Pip support to ATO!)
  • Do Stuff Online supports the latest commit of Pip. Note that DSO runs the interpreter client-side, so it will hang your browser if your code takes a long time to run. (Thanks to emanresu A for adding Pip support to DSO!)
  • Try It Online supports version 0.18, aka Pip Classic, which is a few years out of date. (Thanks to Dennis for adding Pip support to TIO!)
  • Replit hosts the latest commit of Pip, with the downside that it uses a command-line interface and doesn't allow permalinking. Clicking the run button will drop you into the Pip REPL. If you want to run command-line Pip, you can exit the REPL with ;quit and then run ./pip.py with whatever arguments you like. (Thanks to razetime for the idea of hosting Pip on Replit!)

You can also clone the Pip repository and run it from the command line. Pip is implemented in Python 3. The main interpreter is the pip.py file. It should run on most systems with Python 3 installed simply by invoking pip.py in the directory where you put it (for *nix systems, use ./pip.py). You may also wish to modify the PATH environment variable to include the path to Pip, so that you can invoke it from anywhere. Typical invocation patterns:

pip.py [flags] path/to/codefile.pip [args]

pip.py [flags] -e 'code' [args]

pip.py -R (REPL mode)

pip.py (interactive mode)

Execute pip.py --help for more detailed information.

What does the name refer to?

This fellow, of course.

Actually, the name "Pip" originated as a recursive acronym, though exactly what it stands for is open to debate. For some possibilities, see The Tao of Pip. The name was also chosen for its connotations of smallness.

Pip is not to be confused with pip.