Depending on which options and file arguments you give, rejig acts as…
…a pretty-printer for all “source code” type
--toflag formats; programs become more readable not only through sensible style choices, but also by having idiosyncrasies canonicalized. You may wish to make this atomic and in-place à lago fmt.…a verifier when given the same
--fromformat as the--to; for byte code formats, if the program passes without complaint, the destination calculator should accept it; for source formats, a successful verification pass means the program is well-formed, conforming to the known instruction processing rules; this pairing is useful for verifying thatrejigis functionally lossless.1…an assembler when given a source code type
--fromflag and a byte code format as--to, transforming symbolic op codes into the byte code the calculator can run.…a disassembler when given a byte code format as
--fromand a source code format as--to.…a transpiler when given different source code formats for
--fromand--to, either lowering a program written in a high-level format to a lesser target, or the reverse; raising is more reliable than lowering, but both directions can be lossy due to incompletely overlapping feature sets.
This all extends to implied formats, of course.
(You may now wish to return to the rejig home page.)
License
This work is © 2026 by Warren Young and is licensed under CC BY-NC-SA 4.0
- ^
Indeed, developers can run “
task test” to run the unit tests and then verify its round-tripping ability with several programs, including a variant of the R47’s “AllOps” demo. Running “task intcov” produces an integration test report showing how much of the Go code the all-ops tests “touch,” ideally approaching 100% except for the known-error cases.