Live data from Hacker News

Aroma: Using machine learning for code recommendation

ai.facebook.com

41–50 of 62 posts

Re: Aroma: Using machine learning for code recommendation

#41
post #29

Maybe ontopic: I would like a voice controlled system that works with me. For example: saying, "I need a loop over a list" and promptly I get served in my text editor the loop. Or "I need to open a file and read contents". Or "Create an object ThisAndThat, with three properties" ... etc. Of course ideally would even ask for more details like, what kind of list is that, or how shall the file be read. How hard would be…

I've envisioned something like this even for written code. Basically unify the language and the editor, so that you could (theoretically) right-click on main() and say "add loop" and have the correct code auto-generated. Not because a mouse is somehow better (it's much worse in fact), but basically an editor/UI that only allows you to produce valid code. Currently for most languages, we have: "type productions of a p…

This is easier with a minimalistic (syntactically) language like Lisp. Check this out, the editor refuses to let you write code that won’t compile: http://danmidwood.com/content/2014/11/21/animated-paredit.ht...

Re: Aroma: Using machine learning for code recommendation

#42

Earlier quoted context omitted.

I've envisioned something like this even for written code. Basically unify the language and the editor, so that you could (theoretically) right-click on main() and say "add loop" and have the correct code auto-generated. Not because a mouse is somehow better (it's much worse in fact), but basically an editor/UI that only allows you to produce valid code. Currently for most languages, we have: "type productions of a p…

Hmm, so https://github.com/SirVer/ultisnips ?

yes, that is awesome. Now imagine connecting that to a machine-learning backend and letting it slowly train itself on how to write software. yes, I know ML doesn't need this vim-type language specifically, but it should help by only feeding it valid productions.

Re: Aroma: Using machine learning for code recommendation

#43
post #11

I want something like this for math. Write an equation, or a definition and see a bunch of different 'versions' of that snippet and where they are being used. This would help so much with understanding concepts and merging fields. It is way too common for different fields to independently "discover" some concept and be completely ignorant of all the work that has been done on that concept by some other field.

doesn't wolframalpha give you something like this?

Re: Aroma: Using machine learning for code recommendation

#44

One danger I can see coming up is that if someone writes incorrect code it could end up propagating throughout other codebases. I guess this is still an issue without automatic tools, but I feel like this might make it easier…

Aroma would only surface what it thinks is "idiomatic" coding patterns. So if you have many instances of incorrect code, you might already be in trouble :)

Given how many "everybody does X wrong" articles we see here, I think we're already in trouble. :P

(Thinking specifically of the "binary search in the Java API was broken for X decades" one with the integer overflow.)

Re: Aroma: Using machine learning for code recommendation

#46
post #29

Maybe ontopic: I would like a voice controlled system that works with me. For example: saying, "I need a loop over a list" and promptly I get served in my text editor the loop. Or "I need to open a file and read contents". Or "Create an object ThisAndThat, with three properties" ... etc. Of course ideally would even ask for more details like, what kind of list is that, or how shall the file be read. How hard would be…

As you expanded your database of common tasks, do you think that would eventually become a repository of “things I shouldn’t have to remember”, which could then be used to redesign languages? Machine code instructions designed by hand are not necessarily the best fit for the code we actually generate. Similarly, might our approach to language design lack pragmatic insight as to which constructs should be favoured, ad…

This is actually a good idea. Also let's not forget the StackOverflow huge "library" on quick solutions. Someone has to harness that vast knowledge source!

Re: Aroma: Using machine learning for code recommendation

#47
Interesting. In typical Facebook style, they do not attempt to fix the root problem (there's too much code, and much of it has been copy-pasted) but instead expend even more resources just to allow (or even encourage) it to proliferate. The effort would be far better expended on a tool to refactor out all that duplication, because they've created something that can clearly identify duplication.

It reminds me of how they hit a limit in the Android VM because their code had so many classes, and decided to work around it instead of reflecting (no pun intended) on how they ended up with so much code in the first place: https://news.ycombinator.com/item?id=5321634

Re: Aroma: Using machine learning for code recommendation

#48
post #29

Maybe ontopic: I would like a voice controlled system that works with me. For example: saying, "I need a loop over a list" and promptly I get served in my text editor the loop. Or "I need to open a file and read contents". Or "Create an object ThisAndThat, with three properties" ... etc. Of course ideally would even ask for more details like, what kind of list is that, or how shall the file be read. How hard would be…

Well, I’ve been discussing it on HN for years now. There really hasn’t been much interest.

https://news.ycombinator.com/item?id=8515987

https://news.ycombinator.com/item?id=11418285

Mention coding by voice and someone will explain how they can’t imagine not using a keyboard, or they bring up the open office problem.

Considering the limited scope, it’s probably just a matter of the proper editor integration.

Re: Aroma: Using machine learning for code recommendation

#49
post #29

Maybe ontopic: I would like a voice controlled system that works with me. For example: saying, "I need a loop over a list" and promptly I get served in my text editor the loop. Or "I need to open a file and read contents". Or "Create an object ThisAndThat, with three properties" ... etc. Of course ideally would even ask for more details like, what kind of list is that, or how shall the file be read. How hard would be…

As a software engineer, a part of me dreads that day, as this may be the beginning of the end of our profession as it is. But then when I think of it, the AI that can accomplish this will be trained using existing code as a learning sample, and not just static code, it will learn by looking at commits and how code evolves over time, so it is bound to also learn to write bugs, change its mind on design, refactor things that need not refactoring, do premature optimization, rewrite it all in go/rust/the newest cool language on the block, then get stuck because all of its questions got closed as non constructive on stackoverflow, So maybe we'll still have a job after all.

Re: Aroma: Using machine learning for code recommendation

#50
Not directly about the article but I am annoyed that the FB AI blog is very much a part of FB the social network. While reading the blog I got three useless notifications (boxes in the bottom left corner). The whole page has no other indication that I am logged into FB nor any option to log out.
Post reply on HN