I figured out how to get GitHub Copilot to run in the terminal
github.com
github.com
(I stay away for obvious copyright reasons.)
To cover the lack of good libraries and/or language abstractions.
But afaik almost everybody uses it as autocomplete on steroids.
So the reasoning behind using it is the exact same as using autocomplete in I.e. Intellij.
It's just slightly more powerful, since it will usually autocomplete the whole line (occasionally a bit more), instead of just the current keyword.
And it's scary how good it is for "autocomplete" sometimes. I've found it much more useful on our angular webside frontend rather than the c# backend.. but man on the angular/javascript side it really saves time.
I can't think of any good examples off the top of my head, but every few days I literally am wondering to myself "how did I now I wanted to do exactly that!"
I do find it's much better in some languages though. And probably especially with languages you're new in. It doesn't do much for me in PHP, but does a lot in JavaScript.
I tried copilot during the beta, and apart from the obvious legal licensing issues, I simply could not find a valid usecase for any of the codebases I usually work with.
At my day job, I spend more time thinking of better ways to do X, rather than writing boilerplate code :)
Are you telling me there isn’t a fair bit of boilerplate in bog standard implementations of OP_ADD or in a grid layout with a sidebar and a footer?
The irony here is that the level of abstraction necessary to remove all boilerplate means that you’re removing the descriptive nature of the boilerplate and making your code difficult to understand.
Boilerplate isn’t necessarily a bad thing but sometimes it can be rather verbose and it is very nice to offload that typing to a tool.
I think the thing that weirds me out about copilot is that I can't peer inside it. I guess I like knowing something will always work?
> At my day job, I spend more time thinking of better ways to do X, rather than writing boilerplate code :)
Not that you are suggesting otherwise, and I am being somewhat facetious, but oftentimes boilerplate is preferred to boiling the ocean.
Not all jobs are on mature projects.
I get tired of highly subjective anecdotes being used as concrete truths.
You are not the center of reality as we don’t know there is one. So good on you for having a job where the boring work was already in place. Look how far you have come on your own leveraging past effort. So proud of you.
10%+ speedup is a huge, obvious win. Anything that increases my productivity is good.
I feel like it's possible some time could be shaved off somewhere there, but this all happens very quickly and it's not an area where optimization would improve things much overall. For this to amount to literal hours of typing, I think I would need to be either very much slower at typing, writing an immensely large volume of boilerplate, or working over many many years. Typing stuff is essentially never a bottleneck for me.
Harder doesn't mean quicker :)
This is the first time I've ever seen this lol. I'd have had a hell of a time learning how to code if that were true!
it is "intelligent context-aware code autocomplete on steroids"
You mean the part where I said that I haven’t tried it?
1) When it's 100% correct, I smile, because it's often very clever, and as a programmer whose very existence is based on work elimination, when that amazing technological weapon is aimed at my own work needs as a developer, this is some Inception-level glee.
2) It's often wrong. Maybe like, 33% of the time? BUT when it's wrong (note that 95% right is still "wrong," so it's still very good), I smile, because it's often STILL clever, even in its wrongness, and this cleverness amuses me while working. For example, I use Elixir, which linguistically (but NOT semantically) is very similar to Ruby, so on occasion I've seen it make a Ruby-flavored suggestion to my Elixir. "Silly Copilot," I'd say smiling as I'd correct it (and probably teach it further).
So basically, it's made my day slightly more joyful, which is great. I already enjoy programming, so watching a program try to write my code ahead of me is absolutely fascinating.
Simple example of labor saving- I was doing some bash scripting and I wanted some constants for ANSI colors. Well I started writing them, and Copilot finished the whole damn table (with correct constant names, using the naming pattern I'd already established). And all the color codes were correct. This was wonderful! It's GREAT for language domains you're not hugely familiar with. Like, know how you have to often look something up working in a lesser-used language? Well in Copilot, you can just start writing a comment describing what you need or what the code will do, and 8 times out of 10 it will then spit the actual correct code out for you, it's just amazing.
Oh, tip: There's a keystroke combo that will advance through various suggestion possibilities. Often the first suggestion is not quite there, but another suggestion is.
Disclosure: I work at Microsoft, opinion is my own.
Often, it creates code that follows the style of the surrounding environment.
Honestly at this point, the copyright concern seems either ignorant or paranoid to me. The program is interactive and generally only creates small chunks of code at a time. You can read and modify the code it generates (I always do). I only operate on it in digestible chunks, none of which are "original" enough to be considered copyright. Surely, you as a developer can easily say whether the code generated is just some non-copyrightable snippet (some simple BFS code) vs stolen code lifted off a codebase (weirdly specific implementations, fast invsqrt, comments that look like they were written for a different context, magic numbers, undiscovered algorithms).
I would argue that if you can't differentiate between meaningful IP and boilerplate algorithm implementations (with variable names conveniently matching the surrounding context), then you have a different problem.
Yesterday I implemented a BFS in about 30 seconds because copilot recognized the pattern and auto-completed. It took 5 seconds to autocomplete, and 25 seconds to read and fix one line that was wrong. That normally would have taken me 5-10 minutes to code + debug (the copilot code didn't have any errors, minus the 1 I easily found). The productivity gains are too good.
Is there a job title where I can put this to use? I'm alright in general feature work, generally exceptional in bug fixes or finding exploits, and exceptional in code reviews. I always get stuck in leetcode tests of technical interviews though despite having like 8 years of experience.
> $ for((i=1;i<10000;i+=1)); do cat /dev/urandom | od -N 1 -An -i | awk '{print $1 % 10 + 1}' >> rand.txt ; done
> $ cat rand.txt | sort | uniq -c
1051 1
932 10
1012 2
1042 3
983 4
1015 5
1042 6
1035 7
992 8
995 9You can see it quite intuitively if you iterate over all possible numbers between 0 and 255:
$ (for i in {0..255}; do; echo $i | awk '{print $1 % 10 + 1}'; done) | sort -n | uniq -c
26 1
26 2
26 3
26 4
26 5
26 6
25 7
25 8
25 9
25 10What do you think each byte from /dev/(u)random is?
R % 10 + 1
The problem is that 10 does not evenly divide 256, hence for large R, the mapping will be incomplete. Specifically, 250 => 1
251 => 2
252 => 3
253 => 4
254 => 5
255 => 6
with no more random numbers available to yield results 7, 8, 9 and 10. R * 10 / 256 + 1
EDIT: I am wrong, this still has bias.And indeed this is how Python does it
https://github.com/python/cpython/blob/e37ac5fbb6de593521cf2...
https://github.com/python/cpython/blob/e37ac5fbb6de593521cf2...
I wonder if you could bundle it as a language server to make integrating it into editor workflows easy. It’s “basically” just the completion capability, right? Or maybe there’s something else to the interactions that make it not work nicely.
I understand that the company should pay for Copilot in principle.
However, is paying $120 per year that much when it helps you in your at least mid-five-figures job? I would ask for the reimbursement if it was annual, but filling out a form to ask for $10 back every month seems a bit over the top. Maybe I'm a spendthrift?
Am I missing something here? Would you say I am being irresponsible with my money?
I just remembered to cancel my AMC membership. That one was definitely not helping me do my job faster, and I'm not particularly regretful of losing a few dollars.
It's a slippery slope. You can't start giving freebies to your bosses (who are almost certainly much wealthier than you are) or it'll never end, just like you can't ever pay blackmail
You don’t want Bob being less productive just because he didn’t want to spend $10 a month.
Second… It's a work tool just like any other work tool, why should I buy it out of pocket? In the end it's to the advantage of the company if I'm faster at my job.
Now I'm thinking, precisely because it's not paid by the company but by the single user, in case there is legal action, the company might shift the blame on the developer. If they reimbursed they would have no way of claiming they weren't aware.
Right now it's only individual developers, placing the burden on them and preventing any major repercussions for Github.
This changes when (large) companies start using it, and when GitHub gives potentially copyrighed code to companies.
Personally I only use it for personal/OS projects right now, not professionally.
If that was my role I'd totally forbid it, precisely for the reasons you indicated.
If a developer is paying on his own for it to work, who would have the legal responsibility in the end? The developer personally? Another good reason to stay away from it.
That being said…I think this line of thinking is probably mostly a nothing-burger at this point. My experience is that anything sufficiently complicated that Copilot outputs is likely to be somewhat wrong.
I’ve only really found it to be (quite) useful for speeding up small things like if statements, switches/matching, short documentation etc, which I don’t think you can copyright anyways. I wonder to what degree we can expect customization options in the future to forbid any complex code from being generated, or to constrain Copilot to helping with specific whitelisted
Perhaps, extending that last thought, there’s an ideological argument to be made that code that is so simple an AI can generate it isn’t worthy of being protected under copyright law anyways. I don’t know.
https://semiosis.github.io/posts/nlsh-plus-tabnine-real-time...
It uses NLSH and Cterm. https://semiosis.github.io/nlsh/ https://semiosis.github.io/cterm/
https://mullikine.github.io/posts/ai-terminals/
Also, there is ii, the fully imaginary interpreter
One piece of info I was able to get out of copilot devs directly in their Q&A session was that it looks at other open tabs for completion context (the example they gave being header files in C/C++, commonly open alongside implementations).
I've taken to just prototyping things in giant, single files because Copilot at least has the entire program in it's buffer (I think) to give suggestions based on.
https://github.com/orgs/community/discussions/29932#discussi...
With the time it takes to return results with that much context, I wouldn't be suprised if they generally limit context to less than that though.
I'm actually enjoying it as it's providing a lot of context on the time and notes/discussion on every command I run. Also good for history searches as regular cli history ultimately relies on your own memory.
Still it feels like you need to already have paid your dues... (I'm 20+ years in...) .
My friends have been using warp.dev and claim that the AI autopilot has made them 10x as productive on the shell. I just lament that people who haven't suffered through learning shell primitives as a teenager are now as productive or more than me. In time, all our primitive skills fall to the machine. I love it.
"Catching up" by using this tool will only land you in a lawsuit for copyright infringement.
People learn by being told they are wrong. When you use copilot you are constantly being given examples that challenge your intuition. Maybe copilot is wrong, maybe you are wrong, either you are learning more with it on than with it off. Countless programmers get stuck in a rut writing the same bad code over and over again because nobody tells them it’s wrong. And it doesn’t matter if you’ve been programming for 1 month or 20 years, we all have something to learn.
I don't know how you can tell me that my spelling has actually improved, and that I'm learning something from spellcheck other than not to worry about spelling things correctly because the computer will do it.
edit: By the same reasoning, you could argue that people are better at remembering phone numbers now because their cellphones remind them of the numbers every time they make a call. It would be a vaguely plausible theory before cellphones were widespread, but obviously false with experience.
>Our GPT-3 powered AI search will convert natural language into executable shell commands. It's like GitHub Copilot, but for the terminal.
First time I'm hearing about this. Looks pretty cool. I think I already have a pretty good grasp on CLI commands, but I'll give it a shot, especially since the other features also seem interesting.
https://news.ycombinator.com/item?id=30921231
The most worrying comments are those by the OP, the "founder and CEO of warp", who comes across as a liar and scammer. Super-unimpressive.
It's not perfect, but still incredible useful (and sometimes scary; in a good way).
I particularly like it for writing tests, but it's useful in normal code too.
It's nowhere near as accurate as it is when using Rust or TypeScript but it's still mostly "autocomplete, on steroids", just with fewer "oh shit" moments.
based on my bash history and folder structure.
I can't wait until someone open sources a model that will really drive innovative in this space. I don't feel great about a company uploading unknown information from my filesystem as context.
Once you get to "vimshell %", you could just run bash and disable the vim keybindings.
A less hacked together solution would probably be running nvim in the background, feeding it the content from the current terminal session, intercepting the copilot suggestions, and then returning them as terminal suggestions (I'd use `tmux send-keys` and `tmux read-pane` with some regex to get the copilot results). Even less hacked together would be to implement a bash plugin to send out the necessary copilot API requests.