Gentoo Archives: gentoo-dev

From: Paul de Vrieze <pauldv@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Dynamic Modularization
Date: Wed, 24 Aug 2005 11:22:10
Message-Id: 200508241318.07966.pauldv@gentoo.org
In Reply to: [gentoo-dev] Dynamic Modularization by Keziah W
1 On Tuesday 02 August 2005 08:45, Keziah W wrote:
2 > Hi all,
3 > I got this idea and I'm not sure if it would be feasible, but if it is,
4 > it could lead to many Cool Things:
5 > Is there any reason not to have dynamic libraries for most of the
6 > changes made by USE flags, that are used only if present, and then the
7 > USE flags would just specify whether to compile that library?
8 >
9 > That way, one of the benefits would be that USE flags could be changed
10 > on the fly, and the whole system could be tweaked with minimal
11 > recompilation... but probably the biggest benefit would be the
12 > programming paradigm shift that this could affect, by pushing the
13 > packages toward a more dynamic, client-server module where the
14 > different parts of the package have separate purposes that they each
15 > independently achieve.
16 > This way, it could also make development a lot easier.
17 > As an example, lets use some fictional package "quux" that has optional
18 > support for Kde or Gnome.
19 > the quux-kde library and the quux-gnome library could be
20 > interchangable, and, from the point of view of the quux-core code, the
21 > same, allowing one programming interface to apply to both. Changes to
22 > quux's main system would just be in quux-core, and quux-kde and -gnome
23 > could remain the same, while if gnome support needed improvement, it
24 > would just be a matter of improving the quux-gnome library, with no
25 > risk of breaking the main system or causing undesired results
26 > elsewhere.
27 > This would also allow for more shared code, because two packages could
28 > use the same library in some cases.
29 >
30 > So, what do you think?
31
32 What you think about shows incomplete knowledge of the shared library
33 system. In short you propose a plugin architecture. This is possible
34 (though slower), but only if the application source actually is written
35 to encompass this. The way dynamic libaries are normally used is just as
36 if the code were internal to the application. With plugins (dlopened) it
37 works with pointers to functions in some way. This means a layer of
38 indirection, and the necessity for the program to be able to cope with
39 the absense of said library. In short it is an option more appropriate
40 for upstream to perform. In many cases it is just not appropriate. Global
41 application of such a system is impossible though.
42
43 Paul
44
45 --
46 Paul de Vrieze
47 Gentoo Developer
48 Mail: pauldv@g.o
49 Homepage: http://www.devrieze.net