On 2013-05-25 07:39, Axel Simon wrote:
> Hi Daniel,
> 
> On 25.05.2013, at 02:50, Daniel Wagner <wagne...@seas.upenn.edu> 
> wrote:
> 
>> The more I looked at the gtk3 support we had so far, the more
>> uncomfortable I got with how different the interfaces were. Since 
>> it's
>> not really possible for a cabal package to depend on a compilation 
>> flag,
>> I feel like the right thing to do is to split gtk2 and gtk3 support 
>> into
>> separate packages. I've begun doing this, and I encourage interested
>> readers to pull the latest sources and try it out.
>> 
>> There is at least one unfortunate drawback to this: there is now a
>> pretty fair amount of code duplication between the "gtk" and "gtk3"
>> packages. Ideas on how to handle this are welcome.
>> 
>> ...in fact, just generally all feedback on this split is welcome. =)
> 
> Before I try to do a visual diff: Could you detail what got
> duplicated? Just the cabal file and the Setup.hs? Or are there modules
> that cannot be customized using CPP flags?

Actually, quite a lot of things got duplicated. Anything that was *not* 
inside #if's before -- the interface that's common between gtk2 and 
gtk3, which is the bulk of the code, I believe -- is now duplicated 
between the two packages.

It's not that things *can't* be customized with CPP -- just that 
downstream packages would have no way of influencing which way the CPP 
went. There is a lot of shared interface, but there's also a lot of 
unshared interface, and this means it would be perfectly reasonable to 
write a GUI that targets gtk3 but not gtk2 (or vice versa). But there 
would be nothing you could write in your cabal file that would say "I 
want gtk3 and not gtk2" (or vice versa). You would just have to tell 
your users "well, build gtk2hs with the -fgtk3 flag" and then if they 
have other software that they want to use that tells them "build with 
the -f-gtk3 flag" they're just hosed. They can't do both.

~d

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Gtk2hs-devel mailing list
Gtk2hs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel

Reply via email to