Re: Does it sound a good idea to implement "backend plugins"?

2018-10-04 Thread Shao, Cheng
> A long time ago, I’ve tried to inject plugin logic to allows some control > over the driver pipeline (phase ordering) and hooking various code gen > related functions. > > See https://phabricator.haskell.org/D535 Cool! I haven't thoroughly read the history of that diff, but allowing manipulati

Re: Does it sound a good idea to implement "backend plugins"?

2018-10-04 Thread Moritz Angermann
A long time ago, I’ve tried to inject plugin logic to allows some control over the driver pipeline (phase ordering) and hooking various code gen related functions. See https://phabricator.haskell.org/D535 At that time I ran into issues that might simply not exist with plugins anymore today, bu

Re: Does it sound a good idea to implement "backend plugins"?

2018-10-04 Thread Shao, Cheng
> Adding "pluggable backends" to spin up new targets seems to require quite a > bit of additional infrastructure for initialising a library directory and > package database. But there are probably more specific use cases that need > inspecting/modifying STG or Cmm where plugins would already be

Re: Does it sound a good idea to implement "backend plugins"?

2018-10-04 Thread Luite Stegeman
I think it sounds like a potentially good idea in general, but I agree with Ben and Matthew here that a more concrete plan of intended use is needed. Adding "pluggable backends" to spin up new targets seems to require quite a bit of additional infrastructure for initialising a library directory an

Re: Does it sound a good idea to implement "backend plugins"?

2018-10-04 Thread Ben Gamari
"Shao, Cheng" writes: > Hi all, > > I'm thinking of adding "backend plugins" in the current Plugins > mechanism which allows one to inspect/modify the IRs post simplifier > pass (STG/Cmm), similar to the recently added source plugins for HsSyn > IRs. This can be useful for anyone creating a custo

Re: Does it sound a good idea to implement "backend plugins"?

2018-10-04 Thread Matthew Pickering
Sounds like a reasonable idea to me. However, you should take some time to propose a concrete interface as this part was not obvious in the design of source plugins. Matt On Thu, Oct 4, 2018 at 2:56 PM Shao, Cheng wrote: > > Hi all, > > I'm thinking of adding "backend plugins" in the current Plug

Does it sound a good idea to implement "backend plugins"?

2018-10-04 Thread Shao, Cheng
Hi all, I'm thinking of adding "backend plugins" in the current Plugins mechanism which allows one to inspect/modify the IRs post simplifier pass (STG/Cmm), similar to the recently added source plugins for HsSyn IRs. This can be useful for anyone creating a custom GHC backend to target an experime