GitHub Copilot is starting to produce D code that can almost pass code review

Vladimir Panteleev thecybershadow.lists at gmail.com
Tue Apr 5 18:04:37 UTC 2022


On Tuesday, 5 April 2022 at 07:23:53 UTC, Walter Bright wrote:
> Thank you for your extensive and thorough reply.
>
> You're right, I was thinking of integrating it with MicroEmacs. 
> I'd like it to be as simple as:
>
>     hinttext = copilot(sourcetext);
>
> which would make it great fun to play around with. Alas, I have 
> little hope it would be that simple :-) since most programmers 
> can't bear to make things simple.

I don't have experience with Copilot specifically but it's 
probably not that simple because of reasons such as:

1. Authentication. It is a paid service so access has to be 
authenticated.
2. Context is probably inferred not just from the text before the 
cursor, but also text after the cursor or maybe even other files 
from within the same project.
3. Session information, so that multiple queries can be 
associated together for additional context.
4. Multiple answers (or retrying for a different answer).
5. Feedback (the service probably wants to know which answer, if 
any, the user chose, so that they can improve future predictions).
6. Obligatory telemetry :)

A local (offline) though non-free Copilot alternative is TabNine. 
It completes on a much smaller scope (rest of line or so) and can 
understand D to a limited extent. TabNine is written in Rust.

There are some undertakings for a libre implementation, but none 
I know that are at a point where they can be useful in practice.



More information about the Digitalmars-d mailing list