r/coolgithubprojects • u/erkamyaman • 12d ago
Meet rust-anything, I rewrote apps in Rust, got 20x faster, and didn't break a single thing.
Big rewrites die because nobody can prove the new version behaves like the old one. So I built a tool that proves it at every step.
rust-anything takes a TypeScript, Python, C, Go, Ruby or Java app to pure Rust, one piece at a time:
- Record what the original actually does, including the nasty edge cases (emoji, negative modulo, overflow, float extremes).
- Put a Rust binary in front. Anything not ported yet falls back to the original, so the app works from day one.
- Port a unit, replay everything. 100% or it doesn't ship. Every unit has a kill switch.
- Lift. When nothing falls back anymore, the old code is gone and it's pure Rust.
Your AI agent (or you) writes the Rust. rust-anything makes sure it's right.
Just want speed? It finds the hot loop and moves only that: 20x faster search in Node, 17x in Python, same results.
https://github.com/erkamyaman/rust-anything · npm i -g rust-anything · MIT
768
Upvotes
91
u/hxseven 12d ago •
It's a bit ironic that the recommended way to install a project called rust-anything is via npm 😂 Otherwise interesting project.
12
u/hemps36 12d ago edited 12d ago
Similar to Craft Anything, think it also uses Rust?
3
u/my_penis_loves_you 12d ago
Why doesn't it include C#? I'm curious.
45
u/RedditKilledTheApps 12d ago
(x) Doubt
29
u/Key_River7180 12d ago
why dont you rust-anything rust-anything?
12
u/Arcanium_Walker 12d ago
Press X to Doubt
11
u/Serenase 12d ago
Or you can just prompt your agent straight to do it.
8
u/kobaasama 12d ago
Do people now have blind trust on ai generated code? After a js developer converting their js code to rust do they know what goes where? Or how to even read rust code?
7
u/Cheap-Try-8796 12d ago
Rust deez nuts
5
u/realrealvantheman 12d ago
Allowing C is where things get nasty. What if my application is in C and runs on some obscure platform with abnormal type mappings that cannot be represented cleanly in Rust? Or if conversion rules for said platform are safer, but the rust equivalent is not, even if the platform allows it?
5
u/deanominecraft 12d ago
the approach of falling back to the original seems like a good idea until you think about it for more than 5 seconds.
it forces you to keep a lot of the same structure between the old and new apps, which also means keeping a lot of bad architectural decisions. rust helps to make better decisions here but if you fight against it you are going to have a bad time and not get as much benefit from moving to rust, it also seems like it would require a lot of unsafe code to call back into the original
4
u/Fidel___Castro 12d ago
what's the biggest project it's done? I'd like to do this but I'm concerned my repo is too large for it to economically make sense
11
u/fakintheid 12d ago
Slop
2
u/ponzi_gg 12d ago
is this what takes me to the dark side...
2
u/olzk 11d ago
Can it port Kernel to Rust?
2
u/anactualditto 10d ago
The 12 other people and Claude don't get a mention?
1
u/Tom-Crack 12d ago
Let me test it
1
u/lil_nosh_X 12d ago
All my homies write their secrets in rust.
1
u/cdrewing 12d ago
Could I use an APK from Android as a reference and ask it to rewrite it in rust for my Linux PC?
I love RealCalc on my Android but I hate the calculators in Ubuntu.
1
u/lectricball 12d ago
can this rewrite shitty ass tradingview app with electron?
1
u/arker0 11d ago edited 11d ago
I'm trying to vibe-port JDownloader from Java to Go (I chose Go over Rust because cross-compiling is easier, which matters here since JDownloader runs everywhere). I've been working on it for 3 weeks, and it's obviously not the easy 1-2-3 process you describe.
I'm also trying to map all the methods, functions and features so that it's easier to update the port when upstream changes, fixes or updates something. Maybe this could be useful for your project too?
And I'm trying to stick to the Java mentality and workflow wherever possible, so that the original developers could eventually jump in and drop Java (even if I doubt they will).
I'll try to adapt your repo to my Go port. Hope it improves my attempt!
1
u/AteX99 10d ago
Can it rewrite rust into rust?
1
u/-snip- 9d ago
This AI bro fixation with rust is so dumb. Language facilities exist for human ergonomics. Why would I slopify a project into unreadable AI garbage just to get language features I likely won’t use? 20x faster under what workloads? From which languages? I hate that AI is enabling randoms to make shit like this
1
u/Independent_Row_6529 9d ago
Rustify Windows and get rid of slop
1
u/nekoiscool_ 8d ago
Time to rust my code!
1
u/Ok_Solid6442 6d ago
Did YOU write it or did claude?
1
u/Horta-horta 6d ago
And why not C-Anything, or Assembly-Anything
1
u/MobiusStrip12138 6d ago
This is sarcasm, right? atp I can’t really tell.
1
u/CreditDue8861 5d ago
The incremental fallback approach is clever, especially keeping a kill switch for each ported unit. How does the record/replay system handle nondeterministic behavior like timestamps, randomness, network calls, or concurrency? Are those normalized or mocked?
0
u/dreamy-catzy 12d ago
No offence, can you rewrite lisp machine in rust?
-1
u/andreas_lassak 10d ago
c# is 2x faster than rust :)
0
u/[deleted] 12d ago
[deleted] — view deleted comment