Live data from Hacker News

Why Not Rewrite It in Rust? (2016)

transitiontech.ca

21–30 of 79 posts

Re: Why Not Rewrite It in Rust? (2016)

#21
post #5

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

VS Code support is good too. https://areweideyet.com/

Re: Why Not Rewrite It in Rust? (2016)

#22
post #19
post #4

Writing 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…

Incidentally, Tor has some Rust in it these days. I haven't heard from them for a while, so I don't know how the project is going...

Re: Why Not Rewrite It in Rust? (2016)

#23
I 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-class GPGPU support, a mature ecosystem (including some of the highest quality, most efficient code that exists), vastly superior tooling, multiple established compilers, good C compatibility, the list goes on. The purported advantages of Rust, such as the trait system (which is legitimately great), the static safety guarantees (which I personally don't care about at all) and others pale in comparison.

If you really like Rust, you don't address these things by obnoxiously evangelizing language features. You address them by building up the ecosystem, improving the tooling, making the language more pleasant to use and eventually advocating for important vendors to include first class support for Rust in their products. Then, and only then, might this kind of in your face evangelism make some sense, if we ever get there - and the way towards it is paved with patience and lots of hard work, not opening GitHub issues.

Re: Why Not Rewrite It in Rust? (2016)

#24
post #19

Earlier quoted context omitted.

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…

Incidentally, Tor has some Rust in it these days. I haven't heard from them for a while, so I don't know how the project is going...

Tor is probably one of the better cases because of its stringent security requirements, but there remains an oft-ignored tradeoff of losing all that refinement work (and the fact that you can't just flip a switch to make it happen). It's a cost/benefit decision.

Re: Why Not Rewrite It in Rust? (2016)

#25
post #24

Earlier quoted context omitted.

Incidentally, Tor has some Rust in it these days. I haven't heard from them for a while, so I don't know how the project is going...

Tor is probably one of the better cases because of its stringent security requirements, but there remains an oft-ignored tradeoff of losing all that refinement work (and the fact that you can't just flip a switch to make it happen). It's a cost/benefit decision.

Totally; that's why it's not a wholesale re-write, it's slowly replacing old code bit by bit, or writing new code.

Which is the only real way to migrate any codebase of significant size to a new language.

Re: Why Not Rewrite It in Rust? (2016)

#26

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

Re: Why Not Rewrite It in Rust? (2016)

#27
post #4

Writing 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…

If you are not an important member of the dev team you shouldn't propose it at all. Even if you have a magical process that could transform a known maintainable mess into maintainable rust you don't get to talk about it to the dev team.

Re: Why Not Rewrite It in Rust? (2016)

#28

As a D user, I am looking at Rust with curiosity, but haven't yet seen any reasons that would make me switch.

Why don't you rewrite D in Rust?

Because 'R' as a name is already taken. Even if it weren't, it would lead to too many bad pirate jokes.

Re: Why Not Rewrite It in Rust? (2016)

#29
post #26

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

Depends on the codebase. If one of those things could qualitatively improve my codebase - for instance, by introducing GPGPU support and speeding everything up by an order of magnitude - I very well might. Ultimately, it's a cost-benefit calculation that has to be done for every individual case, it's not something you can answer in the abstract. None of the language features of Rust can offer a similar level of advantage, except perhaps in cases where (limited) static guarantees of certain kinds of memory safety are of critical importance.

Re: Why Not Rewrite It in Rust? (2016)

#30
post #14

I've dabbled with Rust a few times for hobby projects, but what always turns me off is how frustrating it is to work with strings.

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.
Post reply on HN