Everyone seems to act like the only option is to rewrite everything or nothing. Isn't possible to have rust and C talk to each other, and progressively rewrite the most relevant parts of the code in rust?
Why Not Rewrite It in Rust? (2016)
71–79 of 79 posts
Re: Why Not Rewrite It in Rust? (2016)
#72Earlier quoted context omitted.
Rust may hopefully get better autocompletions if they work on their Language Server implementation. C# compiler was explicitly rewritten so that it is IDE friendly and I fully agree with this decision. That said even good, old Java has excellent tooling support that I do miss from all these hip languages (such as Rust).
The compiler team is planning on following in C#’s footsteps with the rust-analyzer project.
Re: Why Not Rewrite It in Rust? (2016)
#73Earlier quoted context omitted.
The frustrating part was concatenation, it was surprisingly annoying to combine a few strings and an int into a single string.
The fastest and easiest way is to use format!. let cat = format!("{}{}{}", s1, s2, n);
Best intro documentation of any language I have tried to learn recently.
EDIT for those who havent seen it: https://doc.rust-lang.org/book/
Re: Why Not Rewrite It in Rust? (2016)
#74My humble opinion: it is almost never worth rewriting a large codebase in a new language. The only exceptions are if (a) the old language is so old that it lacks an active community and is no longer being improved, or if (b) the old system needs so many changes that you might as well rewrite it anyway.
The old system needs a big change; it's flaky and riddled with security flaws because the old language encourages undefined behavior. C was a big improvement on assembly, but it's also the leading reason everything we rely on fails frequently.
Re: Why Not Rewrite It in Rust? (2016)
#75Earlier quoted context omitted.
The fastest and easiest way is to use format!. let cat = format!("{}{}{}", s1, s2, n);
steve, think I sent you an email before and you responded, but just wanted to say again the Rust Book is a work of art. Since I read it and emailed you, I completed a fairly non-trivial Grad School project entirely in rust. I took a lot of the shortcuts, but the rust book was an excellent primer. Best intro documentation of any language I have tried to learn recently. EDIT for those who havent seen it: https://doc.ru…
Re: Why Not Rewrite It in Rust? (2016)
#76Re: Why Not Rewrite It in Rust? (2016)
#77Earlier quoted context omitted.
> those projects also benefit from decades of refinement and bug fixes. Rewriting them means losing all of that. Not my experience at all, having spent a significant chunk of my career doing rewrites for scalability. Having the existing codebase makes it very easy to benefit from the accumulated knowledge, while at the same time doing a pass through that can catch a lot of outright errors. If you can rewrite a projec…
Maybe. But even with the old code base for reference, it's easy to not see that those weird lines right there are written the way they are to handle two different corner cases (and of course there's no helpful comments to explain it). This is especially true if you're rewriting from $MORE_OPAQUE_LANGUAGE to $CLEARER_LANGUAGE. There can be a lot of not obvious things going on in the opaque stuff, and you can drop thin…
If the knowledge is so opaque as to be nonobvious from the code in front of you, then it's already an accident waiting to happen: someone making normal maintenance changes to that code (not a rewrite) would be equally likely to break those properties.
Re: Why Not Rewrite It in Rust? (2016)
#78Earlier quoted context omitted.
I think Rust is such a well designed language. But as someone coming from more high-level languages I sometimes feel a bit lost due to not getting as much help from the IDE as I'm used to for C# in Visual Studio and Java in IntelliJ. For Rust I've only tried IntelliJ with the Rust plugin, which seems like the best choice for what I'm after.
VS Code support is good too. https://areweideyet.com/
Re: Why Not Rewrite It in Rust? (2016)
#79Earlier quoted context omitted.
The fastest and easiest way is to use format!. let cat = format!("{}{}{}", s1, s2, n);
They should do string interpolation like C# since C# 5. Really easy to use, type safe and avoids a lot of mistakes.