YugJ commited on
Commit
149a666
·
verified ·
1 Parent(s): 079c9a4

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +37 -7
README.md CHANGED
@@ -1,13 +1,43 @@
1
  ---
2
- title: Python To Rust Cpp
3
- emoji: 🦀
4
- colorFrom: red
5
- colorTo: red
6
  sdk: gradio
7
- sdk_version: 6.24.0
8
- python_version: '3.12'
9
  app_file: app.py
10
  pinned: false
 
11
  ---
12
 
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: Python → Rust & C++
3
+ emoji: ⚡
4
+ colorFrom: purple
5
+ colorTo: pink
6
  sdk: gradio
7
+ sdk_version: 6.23.1
 
8
  app_file: app.py
9
  pinned: false
10
+ short_description: LLM ports Python to Rust or C++, measured and verified
11
  ---
12
 
13
+ # Python → Rust & C++
14
+
15
+ Give it a Python program. An LLM rewrites it in **Rust or C++**. Both are then
16
+ compiled and executed under the same sandbox, so the speedup is **measured, not
17
+ estimated** — and the two outputs are compared, because a translation that is
18
+ fast but wrong is not a translation.
19
+
20
+ ## Measured results
21
+
22
+ Max subarray sum, O(n²), n=10 000 × 20 seeds, measured on a laptop:
23
+
24
+ | Target | Model | Python | Compiled | Speedup | Output |
25
+ |---|---|---:|---:|---:|:--:|
26
+ | C++ | GPT-5 Nano | 24.739 s | 0.337 s | **73×** | identical ✓ |
27
+ | Rust | GPT-5 | 24.518 s | 0.391 s | **63×** | identical ✓ |
28
+ | Rust | GPT-5 Nano | 24.590 s | 0.405 s | **61×** | identical ✓ |
29
+
30
+ Timings on this Space will be slower — it runs on shared CPU. The *ratio* is the
31
+ point and stays representative.
32
+
33
+ ## Notes
34
+
35
+ - **Free to use.** The demo runs on a free-tier model. Frontier models (GPT-5,
36
+ Claude, Grok) require your own API key — pasted keys are used for a single
37
+ request and never logged, stored, or written to disk.
38
+ - **Submitted code is sandboxed.** It runs in a separate process with an
39
+ allowlisted environment containing no API keys, a wall-clock timeout, and
40
+ CPU, memory, and process-count limits.
41
+ - **First load may take ~30 seconds** if the Space has been idle.
42
+
43
+ Source and full write-up: <https://github.com/Yugjohri/python-to-rust-cpp>