Live data from Hacker News

Rewriting in Rust

blog.jetbrains.com

21–30 of 68 posts

Re: Rewriting in Rust

#21
post #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 t…

I’ve seen people do this and I’m always confused, do they believe they will never have to reason about the code ever again.

I suppose if it is like the Zig Rewrite where essentially all development is being done by Claude, I can imagine this making sense.

But in any other case, you had a codebase that presumably you wrote, you could reason about, you could refactor etc. and then you made it into a completely unintelligible code base, which even if written cleanly will take a long time to reason about. Typescript to Rust is not just syntax changes. It doesn’t make sense to me, unless you believe you will be completely out of the loop in managing this code in the future.

Re: Rewriting in Rust

#22
post #14

I think he forgot to praise cargo. (Imho, having cargo available is often already worth a RIIR.)

There have been times I needed to yell at Claude to rewrite some Python program into a faster lang because it was truly CPU-bound. I chose Rust purely cause of Cargo and the rest of the toolchain, despite being way more familiar with C++ (did use Rust but it was 9y ago). Didn't even care about the borrow-checker for that.

Re: Rewriting in Rust

#23
post #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.

What most people mean when they say this is GC vs no GC. Rust is the latter. You have to care about ownership unless you're wrapping in Rc/Arc.

Re: Rewriting in Rust

#24

Earlier quoted context omitted.

There’s none of those details because it’s an AI written article. It doesn’t even talk about the stuff it says it’s going to in the very first paragraph.

That's a really great point, and demonstrates a deep understanding of how AI is changing the landscape of writing online!

[dead]

Re: Rewriting in Rust

#25
post #8

Earlier quoted context omitted.

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.

What most people mean when they say this is GC vs no GC. Rust is the latter. You have to care about ownership unless you're wrapping in Rc/Arc.

I agree with you, but I just want to point out that there are other seamless solutions to memory management like refcounting, used by for example GDscript (Swift? Perl?). You definitely wouldn't consider this manual memory management

Re: Rewriting in Rust

#26
> our attempt to give it an honest look.

Oh no, what are we hiding?

> introduces bugs you already fixed.

Isn't this why every bug fix gets a unit test?

I appreciate rewrite isn't always the answer but it's a strange post when the authors should be giving constructive ways forward so we move to Rust and then use their 1k star Django clone they link to.

Instead anytime a question is posed it falls back to "sometimes" and little detail after that.

Citing a nine year old paper instead of something newer or doing their own benchmarking wasn't ideal either.

Re: Rewriting in Rust

#27
post #25

Earlier quoted context omitted.

What most people mean when they say this is GC vs no GC. Rust is the latter. You have to care about ownership unless you're wrapping in Rc/Arc.

I agree with you, but I just want to point out that there are other seamless solutions to memory management like refcounting, used by for example GDscript (Swift? Perl?). You definitely wouldn't consider this manual memory management

No, I would consider refcounting as variants of GC.

Re: Rewriting in Rust

#28

Earlier quoted context omitted.

There’s none of those details because it’s an AI written article. It doesn’t even talk about the stuff it says it’s going to in the very first paragraph.

That's a really great point, and demonstrates a deep understanding of how AI is changing the landscape of writing online!

Did I just read an HN comment written by an AI? Looks sycophantic enough

Re: Rewriting in Rust

#29

Earlier quoted context omitted.

There’s none of those details because it’s an AI written article. It doesn’t even talk about the stuff it says it’s going to in the very first paragraph.

That's a really great point, and demonstrates a deep understanding of how AI is changing the landscape of writing online!

changing the landscape of writi' you mean fucking shit up to the point of no return?

Re: Rewriting in Rust

#30
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.

I had the same impression, and Occam's Razor suggests that the reason is because the author wrote it with the heavy assistance of a language model. But I do wonder if might also be a certain proportion of the tech industry that has started internalising LLM speak and uses it even in writing that is authentically their own.
Post reply on HN