News for hackers. Stuff that matters.
Re:Aroma: Using machine learning for code recommendation by ccozan on Monday April 08, 2019 @05:02PM (#19609007)
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?

Re:Aroma: Using machine learning for code recommendation by eranation on Monday April 08, 2019 @11:44PM (#19611595)
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 by melling on Monday April 08, 2019 @11:13PM (#19611448)
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 by ccozan on Tuesday April 09, 2019 @12:33PM (#19616410)
I think my idea goes about a rapid prototyping, where i build the skeleton of a program faster, no matter the boiler code, and then workout the details.

Intellisense or shortcuts do this up to a level, but the current big IDEs are limited. Maybe some editor with the concept of VIM with a separate command and edit mode would be more fit to work like that.

Re:Aroma: Using machine learning for code recommendation by Pombal on Wednesday April 10, 2019 @08:11AM (#19623817)
I believe there will be of more interest now for two main reasons:

- Ubiquitous frictionless headphones with built in mics like the AirPods.

- More demand and access to remote working where people are alone at home.

Re:Aroma: Using machine learning for code recommendation by JudgeWapner on Monday April 08, 2019 @05:57PM (#19609456)
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 particular syntax and try really-really-hard to color between the lines, and subject yourself to the chinese-water-torture of syntax errors till YOU get better at it".

Why not invert that, whether via mouse input, a visual (as in literally, visual, not microsoft-visual) connection, or a text editor that simply doesn't let you type invalid productions. Like Intellisense, but taken to the function or block level. You cannot save the file or even leave insert mode until the code compiles. Or even better, you cannot even temporarily input invalid syntax. From the first keystroke, it inserts a variable declaration, click/type up or down to choose a function call, conrol structure, etc.

Some vim-like integration would go as follows:

command mode:

* <space>+F outputs a function called func1, auto-highlighted for you to rename (or accept default). * <space>+R on the func name lets you set its return type * <space>+A for args, * <space>+B to edit the function body

At no point would you be allowed to input non-compiling syntax. Things like indentation would be non-issues, set uniformly by defaults.

Re:Aroma: Using machine learning for code recommendation by thedirt0115 on Monday April 08, 2019 @06:49PM (#19609884)
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 by Keyframe on Monday April 08, 2019 @06:29PM (#19609722)
Re:Aroma: Using machine learning for code recommendation by JudgeWapner on Monday April 08, 2019 @06:52PM (#19609911)
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 by patternmaster on Monday April 08, 2019 @05:11PM (#19609082)
Chain a text-to-speech component to tranx and you're done

Paper: https://arxiv.org/pdf/1810.02720v1.pdf

Code: https://github.com/pcyin/tranX

Live demo (try Django out): http://moto.clab.cs.cmu.edu:8081/

Re:Aroma: Using machine learning for code recommendation by sansnomme on Monday April 08, 2019 @05:30PM (#19609247)
This seems to be a lot better those those Seq-to-Seq natural language to SQL networks. Can you elaborate more about them?
Re:Aroma: Using machine learning for code recommendation by randomsearch on Monday April 08, 2019 @06:02PM (#19609498)
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, adopted, simplified etc?

“Data-driven language design”.

Re:Aroma: Using machine learning for code recommendation by ccozan on Monday April 08, 2019 @08:00PM (#19610370)
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!