[HN Gopher] GitHub Copilot Labs
___________________________________________________________________
GitHub Copilot Labs
Author : orph
Score : 87 points
Date : 2021-12-01 16:23 UTC (6 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| penjelly wrote:
| having used copilot for only a couple hours and found it
| annoying... this might be a but less obstructive. though contrary
| to the commenter the samples in that thread didnt seem all that
| great to me. ill try it out tho and since its in the sidebar itll
| hopefully be less distracting.
| penjelly wrote:
| quick test is actually a bit impressive.
| qbasic_forever wrote:
| Neat! The explain feature is exactly what I had hoped to see
| built: https://news.ycombinator.com/item?id=27813639
| acapybara wrote:
| Most (all?) of the commenters here seemed to miss the entire
| point of this feature:
|
| "Create custom prompts
|
| We provide a few preset prompts to get you started: three that
| explain what a particular block of code does, and another that
| generates example code for calling a function.
|
| You can customize the prompt and stop sequence of a query in
| order to come up with new applications that use Codex to
| interpret code. Creating these can feel like more of an art than
| a science! Small changes in the formulation of the prompt and
| stop sequence can produce very different results. The three
| different "explain" examples showcase strategies that tend to
| produce useful responses from the model, but this is uncharted
| territory! We're excited to see what you use this for."
|
| This isn't for explaining code. That's just an example. This lets
| us create custom prompts for the OpenAI API using the codex
| model.
| lucasmullens wrote:
| What's the use-case for this? Hopefully not for commenting code.
|
| This only seems to be able to explain syntax, which seems pretty
| useless for anyone who isn't new to the language they're using.
| Am I missing something?
| IanCal wrote:
| It's a pretty straightforward, understandable task - which then
| leads you towards making your own tweaks to it / writing
| something new.
|
| It may also just be an interesting attempt at something that
| could be great depending on how well it worked - it's an
| experiment. A general "explain to me what this code does" that
| was as good as a human explaining overall what is going on
| could be very useful in more complicated parts of a codebase.
|
| My final thought is that being new to a language and needing to
| dig around in a codebase is something I do quite a lot and so
| it could be useful even if it's quite basic.
| paxys wrote:
| The use case is exactly what is stated on the box. You select a
| bit of code in a language/syntax that may be unfamiliar to you,
| and it tries to explain it better in English.
| jorams wrote:
| I'm wondering the same thing. There is one example in the
| discussion where explaining syntax seems useful, a regular
| expression. There's a bunch of existing solutions for that, and
| the explanation generated by Copilot is wrong.
| codeenlightener wrote:
| Hello! I'm the founder of https://denigma.app, an AI that
| explains code.
|
| Copilot Labs seem to be quite early stage, asking users to
| essentially build the model for them. Denigma, on the other hand,
| is a product that has been around for a while.
|
| Denigma goes beyond line by line explanations- we explain of
| programming concepts and business logic and complex code.
|
| Less than 24 hours ago, someone from GitHub used their company
| email to subscribe to Denigma. Perhaps you should give it a shot
| too. :)
| aasasd wrote:
| Kinda offtopic, I wonder how's the life of code reviewers and
| freelancers' clients now with the existence of Copilot.
| napalmall wrote:
| This is impressive. Is it still beta and invite only?
| penjelly wrote:
| edit: i am wrong, its still beta/waitlist for copilot.
|
| copilot? i believe its open to anyone now. this feature? its a
| nightly build according to the post.
| spullara wrote:
| Is this the same backend that is powering https://denigma.app ?
| mdaniel wrote:
| Almost certainly not
|
| ---
|
| That was also the first time I had heard of denigma.app and
| their tagline of
|
| _We stress-tested it on the worst, most obscure code we could
| find. That 's why we're confident it will work on your complex
| codebase._
|
| gave me a good chuckle since just trivially modifying their
| example ... _sort of_ worked
|
| Given: RUN apt-get update && exit 1 && apt-
| get install -y libnss3 libgtk-3-0 libx11-xcb1 libxss1
| libasound2
|
| It produced:
|
| - Next, apt-get is used to update the system and exit 1 is used
| to stop any further commands from running.
|
| - Then libnss3, libgtk-3-0, libx11-xcb1, libxss1, and
| libasound2 are installed using apt-get.
|
| For good fun, I tried another small edit RUN
| exit 1 && apt-get update && apt-get install -y libnss3
| libgtk-3-0 libx11-xcb1 libxss1 libasound2
|
| With an even _better_ explanation:
|
| - The code then runs an exit command and uses apt-get to update
| its package list before installing libnss3, libgtk-3-0,
| libx11-xcb1, libxss1, and asound2.
| CyberShadow wrote:
| I think having it produce good output on nonsensical /
| obviously wrong code would be a very different target than
| explaining commonly found code, so your expectation is a
| little unreasonable at this point.
| mdaniel wrote:
| Well, they're the ones that said "worst" and "most
| obscure," that wasn't me paraphrasing
|
| But my heartburn is the intersection of these two bullet
| points: "and exit 1 is used to stop any further commands
| from running", followed by _any other claim_
|
| > obviously wrong code
|
| Based on my experience with code reviews, I'd bet $5 I
| could put (or leave) "&& exit 1 &&" in the middle of a sea
| of RUN commands and it'd go unnoticed. So I guess it
| depends on who the target audience is for both this and the
| absolutely laughable Labs output: people who don't want to
| read what an if statement does, or people looking for the
| _meaning_ of the code?
| codeenlightener wrote:
| Denigma works poorly on short code, especially single lines.
| er4hn wrote:
| Oh wonderful. Can I finally have something to explain non trivial
| Nix expressions to me? Love the ideas behind Nix, loathe the
| syntax.
| minimaxir wrote:
| I made the first comment on that issue: tbh it does work better
| than expected on intentionally bad code, but not perfect. It
| could be useful to speed up documentation though.
| armchairhacker wrote:
| when i first used copilot i thought it wasn't very useful. But as
| i've used it more i realize it helps a lot. A surprising amount
| of code is just boilerplate, e.g. a single if-statement is 3
| lines but you're not going to abstract all your if statements, so
| you write similar if statements over and over again.
|
| It especially helps when i'm programming in a language or library
| i'm not familiar with, because i don't quite understand the
| syntax but copilot does.
| IanCal wrote:
| I've found the same. Particularly coming in nicely when I add
| some kind of parsing in and out of a data structure and it auto
| fills in all the parameters.
| jimmaswell wrote:
| I've been finding it amazingly useful from the outset. It's
| like it reads my mind generating whole correct functions just
| from a small comment or example, and it's great at
| extrapolating repetitive increments/transformations. Write a
| small comment telling it what you want and it's uncanny what it
| can spit out.
| mrtranscendence wrote:
| I've had the opposite experience so far, though I've
| admittedly not used it _that_ much yet. I 've got this Python
| fiscal date library at work, and I wanted to add a something
| like a `strtftime()` method which would replace $P with the
| period, $Q with the quarter, etc, but treat $$ as a literal $
| (so that e.g. $$P would result in $P). Simple enough, but I
| thought it would be cute to see if I could get copilot to do
| it for me.
|
| I spent at least a half hour trying to figure out what kind
| of prompt would result in a correct implementation. No matter
| how explicit I was it kept giving answers that failed to
| handle the $$P -> $P conversion correctly. Finally I was able
| to get it to spit out an answer that at least had the right
| idea, but it had an unrelated bug in it.
|
| The package also has some functions to determine holidays,
| and I was impressed that Copilot could generate code for new
| holidays that mimicked my style, docstrings and all. But
| disappointingly it failed for any slightly obscure holiday
| (say, Eid al-Fitr), generating code that was just wrong, even
| when I hinted that it would have to use an alternative
| calendar library. It kept trying to use the Hebrew calendar
| for Islamic and Hindu holidays, I guess because I'd already
| imported it for Hanukkah.
|
| It also seems useless for Spark ETL, having to be handheld to
| a degree that it would be easier just to write the code
| myself. My first attempt to play around with Copilot was to
| see if it could do a salted join (no luck, unless by "salted
| join" I meant something like "a join on a column called
| salt").
|
| I'll keep playing around with it, maybe it's just a "me"
| problem.
| unbanned wrote:
| What exactly are you asking it to do?
___________________________________________________________________
(page generated 2021-12-01 23:00 UTC)