News for hackers. Stuff that matters.
Re:GitHub releases an ImageNet for code and a CodeSearchNet ... by mikekchar on Friday September 27, 2019 @04:14AM (#21089600)
I haven't looked at this in detail, but where I could see this technology going is by doing a kind of lint. We've got hand built linters for most languages and some of them are really good (Clippy in Rust is amazingly good -- it practically writes my code sometimes). However, a tool that analysed my code, picked out things that were idiomatically strange and then suggested example code that might be better would be quite useful, I think.
Re:GitHub releases an ImageNet for code and a CodeSearchNet ... by mabrocks on Friday September 27, 2019 @04:22AM (#21089646)
[I'm one of the Microsoft Research people who worked on this]

There are many interesting ideas that you could build on top of this kind of data, and we only scratched the surface so far.

For example, the simple "search" technique we are using as a baseline is based on the idea of joint embeddings: We learn functions f_query and f_js/f_python/... to map from the inputs into some vector space such that, for example, for a (python method, docstring) pair, f_query(docstring) is near to f_python(method). To search given a query, we just do f_query(query) and look for nearest neighbours in all the code we indexed before.

Now, we could also just do f_python(def bubblesort(...): ...) and look for the nearest neighbour that is in C#, and should get out a C# implementation of bubblesort. Similarly, we could apply all kinds of filters on the results (code from highly-starred repos, code that uses framework X, ...) to do more interesting thing.

Re:GitHub releases an ImageNet for code and a CodeSearchNet ... by melling on Friday September 27, 2019 @04:34AM (#21089718)
I’d like to type my code in one language and have it translated into another.

Someday I’d like to learn Rust, for example.

If I could leverage the languages that I already know, I could more quickly build something more useful.

Re:GitHub releases an ImageNet for code and a CodeSearchNet ... by nestorD on Friday September 27, 2019 @06:32AM (#21090345)
A seq2seq model trained on something like roseta code might be a viable way to do that...