-
Notifications
You must be signed in to change notification settings - Fork 206
[RFC] Ide generation and Guidance Proposition #107
Conversation
Not commenting fully, but please note also #25 |
I like the nicer Readme, however I don’t think we should encourage generated IDE integrations. Instead I would like IDEs to be able to figure out everything by API introspection at runtime. We already have some commands for that such as I'd be interested to hear why you prefer code generation over api introspection. Obviously there are still things missing there, but we can just add whatever the people writing the IDE integrations feel necessary.You can still use the same code for a lot of plugins if you get it via introspection. Edit: I somehow missed your last paragraph. Imho the first four points are easily achievable via introspection. I am not sure what you mean by "reason easily on user interface" and I don’t know anything about sublimetext. |
I thought a little bit about HIE components over the night.
basically, for each ide, we want to
and each command-function basically:
if we have in ide-generator-base expose data-types like data Visual = Popup Text | Status Bar | CodeInsertion | ... with corresponding helper code, then each ide backend, only has to write very few custom things, such as
in addition to above text, I really prefer code generation (== api introspection in haskell) to api introspection in plugins because:
With that design, choosing a different set of plugins becomes quite easy by swapping the |
again, mini-precision about the PR content: the demo code I wrote in the PR doens't reflect the level of widget gui abstraction we could achieve, the package split suggested is not done, and the readme can still be tweaked more to drive more people. This PR is more here to get us discuss than anything. |
ping @lukexi, as author of stack-ide-sublime interested in switching to hie when it's ready : do you have any opinion on plugin code generation vs available commands introspection from within the plugin ? |
This is an interesting approach, and I think it may be beneficial. It is similar to the one adopted by Wrangler Can you put together a small POC? |
One disadvantage of code generation is that every update which changes something about a function also requires an update to the bindings. In particular the bindings need to be always kept in sync with the executable. While that’s obviously doable it is not completely trivial since the package management systems of editors typically don’t deal with executables so it’s up to the user to not mess up. |
Maybe we should split this up, so on the one hand hie exe can emit a json If an IDE prefers to go the fully-dynamic route that is fine. Once things stabilise, I expect the IDE-specific plugin to be delivered via Much like ghc-mod now, with its atom, vim, etc plugins. On Fri, Nov 27, 2015 at 1:13 PM, Moritz Kiefer notifications@github.com
|
@alanz @cocreature I agree @cocreature to keep things in sync, it would be to our resort to generate binding and publish them on each editor package system for each releases. This way, people still access them the usual way.
Indeed, this is an other downside against my proposal: since we'll probably have to release plugins via traditional package management platforms anyway, we will have no simple ways but to error out when api don't mach with generated plugin :/ |
@rvion I wasn’t afraid of us not updating the bindings, in fact the opposite: since their is package management for editor plugins users are likely to update their editor bindings without updating hie. In particular some plugin management systems (at least melpa for emacs) simply update from git so users will also need to update hie fairly often. Of course we can tell users not to use update or use some other mechanism (for emacs that would be melpa-stable) but at some point it will probably break. In the end I think we should just leave it up to the people developing the individual integrations whether they prefer code generation or runtime introspection. Personally I don’t see a huge value in code generation for the emacs bindings and I like the idea of being able to add,change & remove things in hie while not changing the bindings, so unless someone else involved on the emacs side ( @gracjan ) brings forward strong reasons for why we should generate the bindings, I'd prefer to stick with the current approach there. I don’t think we gain a lot by forcing everybody into one camp here. |
@cocreature You've convinced me :) |
@rvion I wasn’t trying to convince you, if you prefer code generation for the sublime text bindings go for it! I just was trying to explain why I don’t think that it is always superior. |
I agree with @cocreature that for some IDEs it makes sense to make dynamic bindings, and for others not. We need to be able to support both. |
@cocreature We're on the same page. I wanted to push code generation because I didn't see enough drawbacks, and I thought it might turns out to be a good idea, but situation is not so clear as I thought. I may still try that for sublime or atom plugin, since I'm not a python expert :) @alanz yes, I agree |
If we provided a |
Despite liking code generation, I also lean towards using API introspection as much as possible here. Code generation does make quite a bit of sense in the following contexts:
|
What do we do with this PR? The discussion seems to have stagnated and the actual PR has become outdated. Can we just close this? Some of the readme changes would be nice to have but we can also do that in a separate PR. |
@rvion can you update this to reflect the non-contentious changes, so we can land them? |
## Architecture | ||
|
||
1. __BIOS layer__: | ||
1. __BIOS layer__: Ghc Mod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's spelled ghc-mod
;)
Yes, I'll make an other PR soon to replace this one. For info, I am working on some side projects around haskell-ide-engine (a web based ide + some missing tooling I'd like to have), I hope to have something to show soon. |
Sounds good |
This PR is just here to see if you agree the philosophy :)
(The code is not ready to be merged)
I mostly did 3 things:
I changed the readme
(see here: https://github.com/haskell/haskell-ide-engine/tree/invite-people-to-programatically-generate-plugins#haskell-ide-engine-hie)
I added new ide-xxx folders
(related to the discussion at the bottom of PluginDescriptor no longer serialisable. #93)
I suggested one place to add plugin-generation code in hie
The advantage of generating code from hie is that: