News for hackers. Stuff that matters.
Re:FauxPilot – an attempt to build a locally hosted version ... by stagas on Wednesday August 03, 2022 @03:53AM (#32328825)
Tangential, maybe someone here knows; how complicated would be to implement an autocompleter that just understands syntax + patterns and can offer me suggestions but based on my own stuff? Like what is the simplest version of Copilot that doesn't require huge amounts of training but just does a decent job at recognizing tokens and trying to fill in the structure based on some input code. e.g: `app.get('/',|` <- at this point I should get an express.js handler autocomplete like `(req, res, next) => {}`, maybe with multiple choices grepped from my own data ranked by occurences. Is this too extreme it needs a multibillion parameter AI model to achieve? Does anything like this exist? Like an auto-snippet thing but contextual and token replacing.
Re:FauxPilot – an attempt to build a locally hosted version ... by danpalmer on Wednesday August 03, 2022 @04:01AM (#32328898)
To do this in a way that’s actually useful is hard. Microsoft has had Intellisense, JetBrains have autocomplete in Intellij and other products. Both have big teams and decades of work put into them, and still and great, hence the ML approach being tried now.
Re:FauxPilot – an attempt to build a locally hosted version ... by amelius on Wednesday August 03, 2022 @07:39AM (#32330355)
Is it really that difficult?

If I type app.get('/', then looking for literal occurrences and presenting me a menu of all the literal completions I have used before (no ML required at all) would already be a huge win.

Re:FauxPilot – an attempt to build a locally hosted version ... by danpalmer on Thursday August 04, 2022 @07:25AM (#32341536)
What if it's not called `app` – in larger codebases there's often a layer of indirection with different naming.

What if it's not indented the same amount, is it the same?

What if it's not a GET, but a POST? Both use the req/res handlers so you'd want the prediction for both.

What if it's not for the path /, but for some other path. As you can only have one handler for the root, most handlers will be for different paths.

Maybe you can write these edge cases in for the Express situation and get req/res prediction, but that's a bunch of work to automate ~10 characters and it only works for this specific use-case. It doesn't work for any other languages, frameworks, libraries, or use-cases.

There are 2 ways to do this well: 1) static analysis of code to understand what is allowed to come next, and predicting based on that (Intellij, Intellisense, etc) or 2) ML or statistical analysis to determine what's likely to come next without knowing much about the rules (Copilot, Tabnine, Intellicode). Both of these approaches are hard to do right, but have a high pay off.

Re:FauxPilot – an attempt to build a locally hosted version ... by bsima on Wednesday August 03, 2022 @07:46AM (#32330402)
Emacs and vim do this out of the box
Re:FauxPilot – an attempt to build a locally hosted version ... by sneak on Wednesday August 03, 2022 @08:02AM (#32330563)
Vim does not do this "out of the box".
Re:FauxPilot – an attempt to build a locally hosted version ... by bbkane on Wednesday August 03, 2022 @08:44AM (#32330939)
It does it on the "word" level: https://stackoverflow.com/a/52635099/2958070
Re:FauxPilot – an attempt to build a locally hosted version ... by amelius on Wednesday August 03, 2022 @08:53AM (#32331038)
Yes, I use this a lot.

One problem though is that sometimes I have a sub-folder with lots of (unrelated) files and Vim starts searching it, thereby basically hanging the editor without a possibility to stop the operation.

Re:FauxPilot – an attempt to build a locally hosted version ... by runxel on Wednesday August 03, 2022 @07:01AM (#32330083)
That's exactly the thing I would be looking for, too.

Especially since I'm working in proprietary niche language, it would be so great to have my own code to be the corpus of the model.

It could be so easy: stuff your codebase into a model generator and out comes some sensible autocomplete. Well, at least I hope we will see something like this soon.

Re:FauxPilot – an attempt to build a locally hosted version ... by BrandonJung on Monday August 08, 2022 @11:38AM (#32386813)
If you would like a custom model on your code (or language) this is one of the unique capabilities of Tabnine. We have done this on lots of code already and do it all the time for companies across the globe. Your code is your code. Transparently I am with Tabnine.
Re:FauxPilot – an attempt to build a locally hosted version ... by runxel on Tuesday August 09, 2022 @09:38AM (#32397691)
I've tested Tabnine but found it significantly slowing down my whole PC down to barely usable at all. Maybe this issue has been fixed and I can have another look at it. Also it seemed to me that the suggestions were only based on the existing code, whereas Github's Copilot appears to be "smarter".
Re:FauxPilot – an attempt to build a locally hosted version ... by triyambakam on Wednesday August 03, 2022 @12:33PM (#32333873)
The plugin TabNine does what you're looking for. I've been using it enjoyably for about two years.
Re:FauxPilot – an attempt to build a locally hosted version ... by BrandonJung on Monday August 08, 2022 @11:40AM (#32386867)
Clarification - a user can run Tabnine on their laptop only OR as a part of Tabnine Enterprise we can run the large cloud models in your VPC (on GPU's) for your entire team of developers. Your code is your code and you can run it anywhere.
Re:FauxPilot – an attempt to build a locally hosted version ... by colordrops on Wednesday August 03, 2022 @01:21PM (#32334488)
It sends your code to the cloud though.
Re:FauxPilot – an attempt to build a locally hosted version ... by triyambakam on Wednesday August 03, 2022 @02:40PM (#32335331)
Well, it _can_ but that option is configurable.
Re:FauxPilot – an attempt to build a locally hosted version ... by colordrops on Wednesday August 03, 2022 @02:50PM (#32335424)
How effective is it without cloud access?
Re:FauxPilot – an attempt to build a locally hosted version ... by triyambakam on Wednesday August 03, 2022 @07:59PM (#32337832)
I'm pleasantly surprised at its effectiveness!
Re:FauxPilot – an attempt to build a locally hosted version ... by eitland on Wednesday August 03, 2022 @05:11AM (#32329391)
For sane, modern languages like C# and Java, autocomplete has worked somewhere between adequate and amazingly well for a long time already.

I think it used to be kind of usable also in VB6 also, at least that is how I remember it.

Golang and Typescript seems to have good support too now.

But for just the thing you mention above you could go a long way with live templates or what it is called in different IDEs, or just text templates with variables like the Rails guys used to use in their demos.

Re:FauxPilot – an attempt to build a locally hosted version ... by jayshua on Wednesday August 03, 2022 @12:24PM (#32333756)
The latest version of Sublime Text works kind of like that. It know the tokens that most commonly appear together in the folders you currently have open in the sidebar and prioritizes the suggestions popup based on that. Seems to work pretty well for me.

It's a relatively new feature - within the last year I think.