Spaces:
Running on Zero
Running on Zero
|
Download README.md from YugJ/python-to-rust-cpp: direct link, hf CLI and curl.
- Browser
- Download file 1.58 kB
-
https://huggingface.co/spaces/YugJ/python-to-rust-cpp/resolve/97a0ef4ef161cdfe3c01d01f61c07c19507aded0/README.md
- Command line
-
hf download hf://spaces/YugJ/python-to-rust-cpp@97a0ef4ef161cdfe3c01d01f61c07c19507aded0/README.md
-
curl -L -o README.md https://huggingface.co/spaces/YugJ/python-to-rust-cpp/resolve/97a0ef4ef161cdfe3c01d01f61c07c19507aded0/README.md
1.58 kB
| title: Python → Rust & C++ | |
| emoji: ⚡ | |
| colorFrom: purple | |
| colorTo: pink | |
| sdk: gradio | |
| sdk_version: 6.23.1 | |
| app_file: app.py | |
| pinned: false | |
| short_description: LLM ports Python to Rust or C++, measured and verified | |
| # Python → Rust & C++ | |
| Give it a Python program. An LLM rewrites it in **Rust or C++**. Both are then | |
| compiled and executed under the same sandbox, so the speedup is **measured, not | |
| estimated** — and the two outputs are compared, because a translation that is | |
| fast but wrong is not a translation. | |
| ## Measured results | |
| Max subarray sum, O(n²), n=10 000 × 20 seeds, measured on a laptop: | |
| | Target | Model | Python | Compiled | Speedup | Output | | |
| |---|---|---:|---:|---:|:--:| | |
| | C++ | GPT-5 Nano | 24.739 s | 0.337 s | **73×** | identical ✓ | | |
| | Rust | GPT-5 | 24.518 s | 0.391 s | **63×** | identical ✓ | | |
| | Rust | GPT-5 Nano | 24.590 s | 0.405 s | **61×** | identical ✓ | | |
| Timings on this Space will be slower — it runs on shared CPU. The *ratio* is the | |
| point and stays representative. | |
| ## Notes | |
| - **Free to use.** The demo runs on a free-tier model. Frontier models (GPT-5, | |
| Claude, Grok) require your own API key — pasted keys are used for a single | |
| request and never logged, stored, or written to disk. | |
| - **Submitted code is sandboxed.** It runs in a separate process with an | |
| allowlisted environment containing no API keys, a wall-clock timeout, and | |
| CPU, memory, and process-count limits. | |
| - **First load may take ~30 seconds** if the Space has been idle. | |
| Source and full write-up: <https://github.com/Yugjohri/python-to-rust-cpp> | |