News for hackers. Stuff that matters.
Re:Solving Advent of Code Puzzles with GitHub Copilot: Day 1 by lokedhs on Wednesday December 01, 2021 @10:50PM (#29412363)
I can't help but think that whenever copilot is able to help with a solution, it's because the language itself doesn't allow you to express solutions concisely. I looked at the solutions in the article, and very little of the code is actually part of solving the problem. There are a few bytes of relevant information in each line.

I usually use Common Lisp, and whenever I find myself typing boilerplate of a type that copilot would be able to help with, it's because I haven't used the right abstractions.

As an extreme example of this, I solved day 1 in KAP (my APL dialect) and for the second problem, my solution was 8 characters long. There was no real need to have anything type that out for me.

Re:Solving Advent of Code Puzzles with GitHub Copilot: Day 1 by jakear on Thursday December 02, 2021 @01:09AM (#29413060)
Agreed, even with trivial JS constructs parts 1 and 2 can be solved (including parsing) in 58 chars (and only O(n), not O(n*w) like Copilot's solution). The copilot prompt alone for the just the logic part of part one was 98 chars.

Surprise, programming languages are more efficient at encoding logic than English.

Re:Solving Advent of Code Puzzles with GitHub Copilot: Day 1 by 8fingerlouie on Thursday December 02, 2021 @05:42AM (#29414574)
It could be that my use case was simple enough, but for a class i'm taking, we were tasked with creating some code for a web application, as well as unit tests for it, and while copilot wasn't of much use for coding the actual application, it pretty much nailed autogenerating the test cases.

Now, as i said, this was for a class, so it was simple. Sadly work policies at my employer forbids the use of copilot (or anything transmitting code out of the company), so i can't really test it with "real code",

Re:Solving Advent of Code Puzzles with GitHub Copilot: Day 1 by thomasahle on Thursday December 02, 2021 @01:42AM (#29413225)
It's a question of whether copilot can be "creative". I'm mit sure, but it did manage to solve some of the harder leetcode questions here https://youtu.be/FHwnrYm0mNc and I'm curious how it will fare on the later advent of code problems.
Re:Solving Advent of Code Puzzles with GitHub Copilot: Day 1 by callmekit on Thursday December 02, 2021 @02:18AM (#29413423)
The exact answers to leetcode questions are probably included many times in the Copilot dataset, in many programming languages. Fresh Advent of code problems are much more interesting.
Re:Solving Advent of Code Puzzles with GitHub Copilot: Day 1 by YeGoblynQueenne on Thursday December 02, 2021 @05:38AM (#29414543)
Copilot is trained on examples of programs, so it will not be able to produce programs unlike any it has seen before.

This will not be easy to see in any kind of coding exercise. It is very hard to come up with coding problems with solutions that have never been written before, at least for a coding competition like Advent of Code. For example, we don't know of polynomial time solutions to the Travelling Salesman problem but it wouldn't make sense to have that as a coding challenge in Advent of Code, or Leetcode, or anywhere else.

Since nobody has ever produced a program solving such a problem, Copilot will not be able to produce a solution either, but it's not designed to do that anyway.

Re:Solving Advent of Code Puzzles with GitHub Copilot: Day 1 by jvictor118 on Thursday December 02, 2021 @09:34AM (#29416596)
I'm fascinated by APL but man is it hard to get used to. I keep waiting for someone to build something like APL but sufficiently modernized as to actually be useful to me :)
Re:Solving Advent of Code Puzzles with GitHub Copilot: Day 1 by lokedhs on Thursday December 02, 2021 @10:25AM (#29417240)
That is what I'm trying to do, actually. However, the core syntax for fundamental array operations are still the same, but there is a layer of regular imperative structures around it, so you can write code that looks like JS if you want. It's just not as efficient.

It's not ready for actual use yet though, but any suggestions would of course be appreciated.