Why Not Rewrite It in Rust? (2016)
31–40 of 79 posts
Re: Why Not Rewrite It in Rust? (2016)
#32Earlier quoted context omitted.
If you haven't already, check out the Rust By Example section on this: https://doc.rust-lang.org/rust-by-example/std/str.html
The frustrating part was concatenation, it was surprisingly annoying to combine a few strings and an int into a single string.
let cat = format!("{}{}{}", s1, s2, n);Re: Why Not Rewrite It in Rust? (2016)
#33a reminder that "rewrite it in rust" is not usually a ground up rewrite, it's an effort to translate the c into a safer language as you go, it doesn't just burn it down, salt the earth and start over. Have a look at remacs [1] to see how this works in practice. 1: https://github.com/remacs/remacs
Re: Why Not Rewrite It in Rust? (2016)
#34As a D user, I am looking at Rust with curiosity, but haven't yet seen any reasons that would make me switch.
Re: Why Not Rewrite It in Rust? (2016)
#35Writing a few lines of "why not rewriting it in XXX" is more a sign of inexperience or immaturity in my humble opinion. Maybe it is a good idea, but if you are going to propose to a dev team a massive rewrite that will take months or years, you should at least have the decency to analyze the code base, do a small POC, profile some part and point out where the improvement could happen. (And if you've discovered someth…
Programmers, especially naive ones, tend to think asymptotically. We focus on what would be the most theoretically ideal and write off pithy concerns like "time" and "effort" as implementation details. I'm guilty of this myself. Rust is this unusual situation where a new language is in many ways a strict improvement over a very widely-used preexisting language. That is extremely rare. So I think that's where the reli…
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 project incrementally while keeping it working (and for C->Rust, you can), then the arguments against rewriting your code don't apply, and I'd actually consider full rewrites a useful exercise even if you weren't rewriting to a better language.
Re: Why Not Rewrite It in Rust? (2016)
#36I feel like all the language comparisons are largely missing the point, at least for me. I don't write (mostly orthodox) C++ because it's a great language. In fact, I think it's a terrible language, hampered by a myriad of systemic issues that will never be addressed and seem to be getting worse over time. However, I also don't write code in a vacuum and other things matter more to me than language features. First-cl…
If you had a code base in Rust would you consider rewriting it in a language with First-class GPGPU support, a mature ecosystem (including some of the highest quality, most efficient code that exists), vastly superior tooling and multiple established compilers?
In almost all cases though, the that fact that my codebase is working means the ecosystem, tooling and compilers are good enough as is and so I won't have a compelling reason to rewrite. I can get great programmers productive in Rust faster than the boss can figure out that neither I nor the new guy knew anything about rust on the first day.
Typically the only time the factors you mention come into consideration is a brand new project. I will generally know before I write the first line of code if I need GPGPU support or not. I ecosystem, tools, and existence of compilers are just a few of trade offs I will consider.
Re: Why Not Rewrite It in Rust? (2016)
#37Re: Why Not Rewrite It in Rust? (2016)
#38Edit: I should explain a bit. C has had the concept of cross compiling baked into it for decades. It's a well established, easy path. By dint of C, C++ comes along for the ride. Lots of linker is magic required for bare metal C programming. Weird flags required for arch-linux-gnueabi cross compiling. Rust is very new and just doesn't have that history yet. It's an opportunity for someone who has a lot more spare time than myself. :-)
Re: Why Not Rewrite It in Rust? (2016)
#39On version 6 I switched to Rust (having only just started learning the language) and it feels pretty unlikely I'd switch back.
The rookie mistake isn't to want a rewrite. It's to ridicule something you haven't tried in earnest.
Re: Why Not Rewrite It in Rust? (2016)
#40As a D user, I am looking at Rust with curiosity, but haven't yet seen any reasons that would make me switch.
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.