Hacker News new | ask | show | jobs
by kzrdude 1191 days ago
I don't believe GPT is built for this still. There's a too big risk it will fill in another implementation from its training instead of adapting the input.

Here, who says the idiomatic translation is not .sort()? It should use the stdlib.

1 comments

I say the idiomatic translation of a function named insertion_sort() should not use the stdlib sort. The algorithm used by Rust’s stdlib is PDQsort.

In general translations should stay as close to the original as possible, while eliminating any possibility of segfaults.

That's a literal translation, not to idiomatic Rust - in my opinion. All depends on what the semantics of the program should be.