Rewriting in Rust
blog.jetbrains.com
Rewriting in Rust
1–10 of 68 posts
Re: Rewriting in Rust
#2Re: Rewriting in Rust
#3Re: Rewriting in Rust
#4Re: Rewriting in Rust
#5Re: Rewriting in Rust
#6I understand that's a guest post in Jetbrains blog, and these guests could very well be real people, project maintainers, conference speakers and whatnot, but I feel they used LLM so heavily that it reads like a slop. Pease do better next time.
Re: Rewriting in Rust
#7My company gave me a brand new, beefy Macbook pro and that thing can barely handle IntelliJ sometimes...
Re: Rewriting in Rust
#8I think every project should seriously ask itself if it actually needs manual memory management. My hunch is that most people who think they need it, do not. If you really truly do need it, then yes Rust is a great way to get most of the benefits of garbage collection while still having manual control over memory.
Re: Rewriting in Rust
#9I really wished the documented their benchmarking methodology here, or at least cautioned the reader not to jump to conclusions based on the benchmarks shown.
GNU 'sort' performance can drastically be altered by the locale in use, the input, and the arguments given to the --buffer-size and --parallel options. GNU 'sort' is fairly conservative in how many threads it will use by default, and in my experience, much more so than uutils. This is because throwing more threads at 'sort' may make it faster (or may not), but also risks running out of memory. This is an issue with uutils, which is poor at deciding when to use external sorting:
$ export LC_ALL=C
$ for i in {a..z}; do yes $i | head -n $(numfmt --from=iec 512M) | tr -d '\n' >> input; done
$ time sort input > /dev/null
real 0m24.245s
user 0m0.896s
sys 0m19.161s
Here is the same command using the latest uutils commit compiled with 'make PROFILE=release': $ time uu-sort input > /dev/null
Killed uu-sort input > /dev/null
real 2m53.560s
user 1m40.634s
sys 0m59.847s
The process gets killed by the OOM killer. This is likely because uutils 'sort' decides to use 18 threads, instead of the 1 used by GNU 'sort'. I find it a bit frustrating that benchmarks are thrown out without any methodology or citations, because they are often trusted without question. These could be benchmarks from before uutils had localization, which was the case before 2025, and treated LC_ALL=en_US.UTF-8 as LC_ALL=C. In that case, of course it would be much faster than GNU coreutils, but it also means uutils would give you the wrong results for non-ASCII characters. There is, as shown above, much more considerations beyond speed that seemingly never get the time of day next to flashy benchmarks...Re: Rewriting in Rust
#10Was just testing latest gen LLM capabilities, and decided to give it goal of rewriting a small opensource project in Rust. (Should be noted: was not some tiny library, but an actually useful network service).
It completed the entire rewrite from typescript to rust in about 2 hours, ~600k tokens used. Worked perfectly on first try with no follow up changes required. Memory and CPU usage now a tiny fraction of TS version (obviously). Rust code was simple, easy to read, accurate test suite, etc.
I was pleasantly surprised.
Obviously bigger code bases with more complex business logic will likely struggle here, but there are some advantages to "RIIR" when performance matters, even security benefits aside. Rust can help squeeze more juice out of old hardware; reduced memory footprint especially helpful with current RAM prices.
For small services where operational cost matters, having LLMs "rewrite it in rust" might be worth the spend.