News for hackers. Stuff that matters.
Re:Coping with Copilot by lolinder on Saturday August 20, 2022 @10:20PM (#32536848)
I've found it extremely helpful in writing highly repetitive code that's too complicated for a Regex find/replace. For example, I used it when writing a recursive descent parser in Rust for a hobby project.

I wrote the grammar in a comment at the top of the file, wrote and imported the AST enum, and wrote the first production. After that, I just prompted Copilot and it worked its way down the grammar, producing the parser functions one at a time. The CLion integration was able to consider the imported data structures as part of the prompt, so it even stored everything in the correct AST nodes.

For something like that, it's easy to verify that it did it correctly (through visual inspection and testing), and it allowed me to write the entire parser in about 2-3 seconds per rule.

Re:Coping with Copilot by xigoi on Monday August 22, 2022 @06:13AM (#32549466)
Why not just use a parser generator?