Live data from Hacker News

Rewriting in Rust

blog.jetbrains.com

1–10 of 68 posts

Re: Rewriting in Rust

#2
I think that a line-for-line rewrite in Rust like Bun did isn’t really getting all of the benefits of using Rust. A key benefit is utilizing the type system to make the borrow checker work for you by making certain checks happen at compile-time instead of runtime. Making it impossible for certain mistakes to occur is a massive benefit but you need to restructure everything to do so.

Re: Rewriting in Rust

#3
I 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

#5
I 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

#6
post #3

I 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.

Yes, there are quite a few signs of LLM usage in the post, which I also found annoying. But I also had the feeling that someone really cared about the quality of the text and I found only one strange/useless sentence in the post, which today has to be taken as a win, I guess.

Re: Rewriting in Rust

#7
I would love it if jetbrains were to speed up IntelliJ. I started a new job writing Java professionally last year and, up that point, I had no idea that IDE's could actually be that slow.

My company gave me a brand new, beefy Macbook pro and that thing can barely handle IntelliJ sometimes...

Re: Rewriting in Rust

#8

I 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.

I wouldn't consider Rust a manual memory environment. There are ways to do that at edges if needed, but it is otherwise very much automatic which is kind of the whole point of its design.

Re: Rewriting in Rust

#9
Note, I am a co-maintainer of GNU coreutils. Whether that makes my opinion relevant, biased, or both, you can decide. :)

I 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

#10
Small related anecdote:

Was 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.

Post reply on HN