Enter RPN

rejig: Translate RPN Programs
Login

rejig: Translate RPN Programs

Ever found an RPN calculator program online you wanted to run, but it was in the wrong file format for the machine in front of you?

Ever wanted to export a working, battle-tested program to another RPN machine family?

rejig raises every input you give it to an abstract version of the R47 program format, serving as a high-level lingua franca, then writes it out without changing its semantic meaning.

Its default operating mode pretty-prints each input to the terminal:

rejig program.p47

It recognizes the R47’s byte-coded format by extension, translating it into readable text, formatted and styled using the full power of Unicode.

For a more advanced example:

rejig program.15c -o /Volumes/R47/PROGRAMS/program.p47

That takes a file in the local directory containing a program in the Manz HP-15C format (.15c) and writes it out in P47 byte code format under the folder where the R47 mounts as a USB disk on my Mac. If that runs without error, it means I can then eject that disk and READP the converted program into the R47.

Features

Raison d’être

I initially created rejig to address the fact that the R47 offers two different ways to save a single program out to its USB flash storage:

The first is technically UTF-8 plaintext, but it isn’t human-readable, whereas the second is human-readable but only via a word processor. Even then, it’s functionally read-only because the R47 offers no corresponding “IMPORTP” function that will parse an edited RTF file back into byte codes.

I wanted a method to get pretty-printed plaintext R47 programs at the command line, in accord with the Unix Way. Everything else sprang from that initial goal, once achieved.

Further philosophical input came from Pandoc, especially its command line format, plus the go fmt policy of picking one reasonable programming [style] and sticking with it consistently.

Downloads

Pre-built static binaries are available for download here for Windows, macOS, and Linux, for both ARM64 and AMD64/x86-64 CPUs.

You may wish to consult the change log to see what’s new.

Alternately, you can run rejig as a container:

$ docker run quay.io/tangent/rejig --version
v0.19.0

Installation

The installation process is:

  1. Unpack the archive.
  2. Copy the binary to a PATH directory.
  3. There is no step 3. You’re done already.

On Linux and macOS, I suggest ~/.local/bin for step 2, being the modern per-user alternative to the traditional /usr/local/bin. If it is not currently in your PATH but you had to create it, logging out and back in might fix that on modern Linux distros, which tend to add that conditionally based on whether it is present on login.

None of the equivalent stock locations on Windows are suitable for installing downloaded command line programs like rejig, and I refuse to produce an MSIX installer and put a single executable into its own directory under C:\Program Files to play along with its misguided design. When it comes to small, self-contained CLI programs like rejig, I recommend bending Windows around a smidge toward the Unix Way:

  1. Create a C:\Users\%USERNAME%\bin directory.
  2. Add it to the %PATH%.
  3. Drag rejig.exe from the virtual zip file view in Explorer into that directory.

Now rejig commands will run from Windows Terminal or a Command Prompt window without an explicit path. As a bonus, you now have a reasonable place to put other such things in the future.

More?

Those interested in digging deeper may wish to return to the feature index above or visit the doc directory index.

(Alternately, return to my R47 article index.)

License

This work is © 2026 by Warren Young and is licensed under CC BY-NC-SA 4.0