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
Technically, one needs to ensure they know what is occurring throughout that code. E.g. one should know what is happening when a multuline procedure in their own code comes out in a lambda function style from a LLM. There is also an ethical element about which ones you used based on supporting the success in the market of a given LLM's ideological viewpoints. Claude's terms of service specifically forbid machine learning outputs which is basically most of the good statistical analysis you could do. Deep Seek has serious things to consider if you talk to it, so my opinion would be to get coding help from Mistral LLMs. On Tuesday, December 9, 2025, Hans W <hwborchers at gmail.com> wrote:> 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 > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide https://www.R-project.org/ > posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Humans who don't adapt to LLMs, or whatever form AI takes as it evolves, will be left in the dust. People may just now be waking up to the fact that we're three years into a tremendous revolution, one of the greatest in human history. It follows the Bronze Age, the Iron Age, the Industrial Revolution, the computer revolution, the Information Age, and now... AI. AGI is approaching. How quickly? Who can say. Whether AI can ever be truly sentient remains a mystery. But once it can adequately replicate sentience, some will ask: what's the difference? As to the question of who judges what's acceptable from a coding standpoint: capitalism will. Corporations will. And the question of whether this is the future of coding is already behind us. It is coding now, and it will only continue to improve in capability. Try Replit, Cursor, Claude Code. Humans are incapable of keeping up. AI still struggles with some of the most complex tasks, and it does poorly at orchestrating across large repositories, but it's improving rapidly. Just my observations. Those who look down their noses at all this will be left behind. All the best! Gregg On Tuesday, December 9th, 2025 at 6:32 AM, Hans W <hwborchers at gmail.com> wrote:>>> 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 >> ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide https://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 603 bytes Desc: OpenPGP digital signature URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20251209/5bef54c0/attachment.sig>