Hacker News new | ask | show | jobs
by strager 1253 days ago
Why would a project need to become "idiomatic Rust" for a Rust port to be useful?
3 comments

To be useful as a comparison between implementation languages, it should be idiomatic. Otherwise it just tells you what it's like to transliterate one language into another, something which is usually only done for interop purposes - running on a platform which doesn't have a native compiler, or to enable native-level APIs when foreign function support is poor.

Code size after transliteration is a race the target language can seldom win; abstractions that also exist (or close enough) in the target language get translated 1:1, abstractions which don't get broken down 1:n, and abstractions which exist in the target language but don't have analogues in the source language generally don't get used at all. It's hard to end up with a shorter program following this approach. Only boilerplate with redundant repetition and ceremony - code which has little functional effect other than to satisfy declaration order rules, symbol visibility and so on - can get eliminated.

My wording may have been unclear. I have no doubt you had good technical justification for this port. I'm purely talking about the experimental results regarding builds and toolchains here. For people starting a new project rather than porting, I don't think this is a useful data point
To avoid being hounded by the purity police, of course!