3 ms·
>This requires a kind of linguistic understanding that is beyond basic intellisense Are you sure? If you would look at the statistics what comes after up
by croes 4y ago
>This requires a kind of linguistic understanding that is beyond basic intellisense
Are you sure?
If you would look at the statistics what comes after
up = foo.north()
right =
I bet most of the time it's
up = foo.north()
right = foo.east()
down = foo.south()
left = foo.west()
- elcomet 4y agobut it contextualizes it with adapted variable names, case and everything. That's very hard to do with only statistical analysis.
- gamegoblin 4y agoExactly, for example if I give it: hn_example_up = foo.north_garbage_jlakd() hn_example_right = it correctly spits out hn_example_up = foo.north_garbage_jlakd() hn_example_right = foo.east_garbage_jlakd() hn_example_down = foo.south_garbage_jlakd() hn_example_left = foo.west_garbage_jlakd() Even though those identifiers including random letters are certainly not in the training data. It can do surprisingly good basic reasoning. Here is another example. I give it: hn_example_up = foo.x_0_y_1() hn_example_left = foo.x_neg_1_y_0() So my function names are like referring to unit distances on the x/y axes. Copilot correctly figures out what I'm doing and completes: hn_example_up = foo.x_0_y_1() hn_example_left = foo.x_neg_1_y_0() hn_example_down = foo.x_0_y_neg_1() hn_example_right = foo.x_1_y_0() A few weeks ago I coded a rubik's cube solver that involved some very nuanced and weird spatial reasoning and was blown away by Copilot's ability demonstrate it "understood" concepts such as turning the right side down is identical to turning the left side up when viewed from the back of the cube, or stuff like that.
- sidlls 4y agoNo it isn’t. Variable names are literally fungible in this context.
- phire 4y agoYes, ultimately it's just a really good statistical model. But it does a really good job, and it's not just matching code it's seen before. You can use any variable name. You can do this in a weird programming language which uses weird symbols for assignment and calls. copilot will probably see though it and give you a good prediction. You can probably even swap west for not_east in code elsewhere in the file, and it will manage to predict that you also want not_east here. And I guaranteed nobody has written code like that before.