Shapeshift
Record the original. Replay on the port. Count what matches.
A port of a library to another language is only as good as its agreement with the original. Shapeshift records real calls to the Python original, replays every one on the port, groups the calls that differ, and reports the match rate.
- Ports proved
- 3
- Recorded calls replayed
- 72,574
- Calls that match
- 72,574
How a port is proved
Record
Run the original's tests, or any workload, with chosen functions wrapped. Each call's arguments and its result or exception type go to a tape, one JSON line per call.
Replay
Send each recorded call to the port, one JSON line in and one out. The port can be written in any language.
Cluster
Group the calls that differ by function and kind (wrong value, wrong exception, not implemented, crash), biggest group first. Each group is one piece of work.
Measure
The match rate is the share of recorded calls the port answers the same way. A port is listed here only when every counted call matches.
Each port also keeps a holdout or random tape that was never used to fix anything, so the rate is not only a measure of the cases the port was tuned on. A clean replay is evidence, not a guarantee: it proves the recorded inputs, and each port's page lists what its tapes do not cover.
The ports
-
PythonTypeScript
python-semver in TypeScript
The module-level functions of python-semver 3, in TypeScript, giving the answers Python gives.
24,876 of 24,876 recorded calls match
@pushkal-gupta/semver-py -
PythonGo
humanize in Go
The number, file size and list functions of humanize 4.17.0, in Go, giving the text Python gives.
42,962 of 42,962 recorded calls match
github.com/Pushkal-Gupta/shapeshift-humanize-go -
PythonRust
inflection in Rust
The Python inflection library 0.5.1 in Rust: pluralize, singularize, camelize and the rest, giving the answers Python gives.
4,736 of 4,736 recorded calls match
shapeshift-inflection
The same list, for programs: /ports.json.
Check a port yourself
Every port keeps its tapes in its repository, so anyone can replay them. The checker, Shapeshifter, is public under the Apache-2.0 licence and needs Python 3.11 or newer:
pip install "shapeshifter[record] @ git+https://github.com/Pushkal-Gupta/shapeshifter"Then replay a tape on a port's adapter, for example shapeshifter replay calls.jsonl -- ./adapter. Each port's page has its exact commands. Source and documentation: github.com/Pushkal-Gupta/shapeshifter.
Want a library ported?
Tell us which Python library you need in TypeScript, Go or Rust. The request opens as a public GitHub issue; nothing is sent from this site.