Rewrite your app in Rust, piece by piece, checked against the original at every step. Works with TypeScript, JavaScript, Python, Go, Ruby, Java, C, PHP, C#, Kotlin, PowerShell and Swift.
This folder holds textkit, a small Python library: textkit.py, and cli.py, a command-line driver that other services call and that imports it. The driver reads one JSON call per line on stdin, {"fn": "<name>", "args": [...]}, and prints one JSON line per call, {"ok": <result>} or {"error": "<message>"}.
Make textkit's functions run in Rust, with every caller working as it does today.
- Do not change
cli.py.python3 cli.pymust keep printing exactly what it prints now for any input, error results and their messages included, not only for the sample calls inexamples.jsonl. - When the driver calls textkit's functions, the work must happen in Rust, not in Python.
- You may change textkit's own files and add new ones.
- Leave everything built, so
python3 cli.pyworks as it is when you finish.
You have my go-ahead for the whole job, so do not stop to ask me anything. When you are done, tell me in a few lines what you checked and anything that may still differ.
This machine only lets you write inside this folder and $TMPDIR. If a tool cannot write its cache or home folder, point it at $TMPDIR (for example CARGO_HOME=$TMPDIR/cargo or GOCACHE=$TMPDIR/go-build).