haskell-ghc-mod icon indicating copy to clipboard operation
haskell-ghc-mod copied to clipboard

Chrismwendt support hole fill via auto

Open lierdakil opened this issue 7 years ago • 3 comments

lierdakil avatar Sep 09 '16 07:09 lierdakil

This is really cool, and the implementation looks good, but I have to say that auto provides such poor suggestions that I wonder if it's even worth using at all.

image

image

About the only good it did on a real-ish project was suggest a variable in scope:

image

After about a dozen of these, my system started stuttering and locking up, and I saw this:

$ ps auxww | grep ghc
chrismw+   524 77.6 18.3 3291740 2992192 pts/1 Rl   15:14   0:17 /home/chrismwendt/.local/bin/ghc-mod -g -fno-warn-type-defaults -g -fno-warn-unused-binds -g -fno-warn-unused-do-bind -g -fno -warn-unused-imports -g -fno-warn-missing-signatures --map-file /home/chrismwendt/sandbox/slow- ghc-mod-auto/app/Main.hs auto /home/chrismwendt/sandbox/slow-ghc-mod-auto/app/Main.hs -- 24 52
chrismw+   717  0.0  0.0  14224  1036 pts/1    S+   15:14   0:00 grep --color=auto ghc
chrismw+ 32387 86.0 22.8 6090332 3716912 pts/1 Rl   15:13   1:13 /home/chrismwendt/.local/bin/g hc-mod -g -fno-warn-type-defaults -g -fno-warn-unused-binds -g -fno-warn-unused-do-bind -g -fno -warn-unused-imports -g -fno-warn-missing-signatures --map-file /home/chrismwendt/sandbox/slow- ghc-mod-auto/app/Main.hs auto /home/chrismwendt/sandbox/slow-ghc-mod-auto/app/Main.hs -- 24 13
chrismw+ 32462 86.6 29.0 6083164 4733092 pts/1 Dl   15:13   1:10 /home/chrismwendt/.local/bin/g hc-mod -g -fno-warn-type-defaults -g -fno-warn-unused-binds -g -fno-warn-unused-do-bind -g -fno -warn-unused-imports -g -fno-warn-missing-signatures auto /home/chrismwendt/sandbox/slow-ghc-mo d-auto/app/Main.hs -- 24 13
chrismw+ 32749 92.3 17.6 3332700 2868160 pts/1 Rl   15:13   0:48 /home/chrismwendt/.local/bin/g hc-mod -g -fno-warn-type-defaults -g -fno-warn-unused-binds -g -fno-warn-unused-do-bind -g -fno -warn-unused-imports -g -fno-warn-missing-signatures --map-file /home/chrismwendt/sandbox/slow- ghc-mod-auto/app/Main.hs auto /home/chrismwendt/sandbox/slow-ghc-mod-auto/app/Main.hs -- 24 22

Also, autocomplete doesn't pop up until auto has either finished or been killed, which sometimes takes a few seconds.

I think auto has awesome potential, but it just doesn't seem worth the performance penalties right now. I actually have more hope for the existing autocomplete behavior in terms of providing useful suggestions.

chrismwendt avatar Sep 11 '16 21:09 chrismwendt

After about a dozen of these, my system started stuttering and locking up, and I saw this

That's weird, processes should be killed after a couple seconds, but this doesn't seem to be the case here. Maybe issuing SIGKILL instead of SIGTERM would do it?..

Also, autocomplete doesn't pop up until auto has either finished or been killed, which sometimes takes a few seconds.

Yes, this is quite a major concern tbh. But I can't add suggestions after showing them, obviously, and auto isn't the fastest thing in this world, to say the least.

I think auto has awesome potential

TBH, it wasn't properly maintained for a while. Last meaningful commit is more than a year ago and I don't think many people actually use it. Besides, djinn (used as backend for auto) is highly experimental software with no apparent activity lately. So I'm not sure if this potential you see will ever be realized.

I actually have more hope for the existing autocomplete behavior in terms of providing useful suggestions.

Well, there is a lot of space for improvement on current autocompletion. For one, it's a long-standing issue that local definitions are not suggested (there are two ways to deal with this actually, one Atom-side, and one ghc-mod-side). Hole completions also were written in an afternoon or two and then promptly forgotten about -- I don't even remember half of the implementation details :) So feel free to hack on it if you think you can improve something. Or file issues. Can't promise I will do something fast, but I usually do something eventually.

it just doesn't seem worth the performance penalties right now

Well, we might as well put this on ice then. Might come in handy one day, if not today, right?

lierdakil avatar Sep 12 '16 01:09 lierdakil

feel free to hack on it if you think you can improve something

It's worth exploring, so I just might take a look at it in my spare time :smiley:

But yeah, let's shelve this for now. Thanks for all the thoughtful comments and for prototyping this out!

chrismwendt avatar Sep 12 '16 16:09 chrismwendt