Re:Programming with Natural Language Is Going to Work (2010)
by pornel on Wednesday May 24, 2023 @07:09AM
(#36056365)
Rust is 90% arguing with the compiler and 10% debugging. And yesterday GPT-4 solved a WTF lifetime issue for me pulling a trick I wouldn't have thought about.
[ Parent
| on HN ]
Re:Programming with Natural Language Is Going to Work (2010)
by ChatGTP on Wednesday May 24, 2023 @07:15AM
(#36056401)
What was the WTF lifetime issue?
Re:Programming with Natural Language Is Going to Work (2010)
by pornel on Wednesday May 24, 2023 @07:21AM
(#36056452)
I wanted to compare function pointers, but that's tricky due to unique function types, disallowed non-primitive casts, plus apparently not allowed for types with higher-ranked lifetimes (for<'a> fn(&'a)). GPT-4 came up with using a type alias (type FnComparable<'a>) that added necessary coercions and gave them equal lifetime.
Re:Programming with Natural Language Is Going to Work (2010)
by Ygg2 on Wednesday May 24, 2023 @07:12AM
(#36056377)
Probably because its corpus of knowledge includes someone solving it like that.
Re:Programming with Natural Language Is Going to Work (2010)
by pixl97 on Wednesday May 24, 2023 @10:08AM
(#36058291)
I'm not really a programmer, but when I write code for stuff I need this is how I operate. The novel idea I want to solve is the end goal, not the intermediate code that I'm gluing together that other people have generally created.