by nicce · 1y ago · 0 comments
LLM was able to connect the dots of some more complex and rarer Rust features and my requirements. I did not know that they could be used like that. One case was, for example, about complex usage of generic associated types (GATs).
What it comes to lifetime issues, usually it is about wasting time if trying to solve with LLMs.
Asking it to write Nim code to solve my problem resulted in a mess of compilation errors, and it kept looping through multiple broken approaches when I pointed out what was flawed.
Finally, I just decided to ask it to explain the C design pattern I was unfamiliar with, and it was capable of bridging the gap enough for me to be able to write the correct Nim code. That was pretty cool. There was no documentation anywhere for what I needed, and nobody else had ever encountered that problem before. That said, I could have just gone to the Nim forum with a snippet and asked for help, and I would have solved the problem with a fraction of the electricity usage.