Chatbot -generated R Code
Hans W <[email protected]>
| Newsgroups | gmane.comp.lang.r.general |
|---|---|
| Message-ID | <CAML4n3NN65DWOVmc3wTTOph-EfWAd2R1+wjnpcaOUa6DtEHbtw@mail.gmail.com> |
SORRY if I missed such a discussion somewhere on R-HELP For many years I wanted to write an R function that finds the closest pair of points among a, maybe huge, set of points on the 2-dimensional plane. I never did, perhaps considering the possible complexity of this task. Now I found a book, among others describing the "sweeping algorithm", perfectly suited for the problem. And as a test, I questioned chatbots like DeepSeek and ChatGPT about such a function - and mentioned the sweeping algorithm. DeepSeek, for instance, came immediately up with a complete, efficient solution and test cases that I checked with brute force. I can see that it utilized the sweeping algorithm, documented the code, and set up a help file. I made some changes, improved the code a bit, but still it is code generated by a clever chatbot, whatever I do. Now I ask myself: Is this a correct and lawful way to write code in the future? I am not even sure DeepSeek may not have used an implementation of the sweeping algorithm that is under ACM license and would not be allowed on CRAN. I wonder how one handles this matter? Will this be the future of code writing (for R and other languages)? I would really appreciate to hear your opinion or a hint to a discussion about it. Hans Werner