[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] Shared library support in Modula-2

From: Andreas Fischlin
Subject: Re: [Gm2] Shared library support in Modula-2
Date: Sun, 04 May 2008 14:36:25 +0200
User-agent: Thunderbird (Macintosh/20080421)

Dear Gaius,

The more dynamic loading is done, the better for a modular language such as Modula-2. The performance penalty is minimal according to our experience with MacMETH featuring a dynamic linking loader since mid 80es!


Gaius Mulley wrote:

As mentioned in a previous email, I think there are three main ISO
Modula-2 language features that remain to be implemented.  (Type
COMPLEX, multidimensional unbounded arrays and to finish exception

Coupled with exception handling is module initialisation and
finalisation - both straightforward - however they do lend themselves
to fit nicely with shared library support and map onto the shared
library constructor/destructor.  This raises the question of whether
to implement inter module procedure calls by using dlopen/dlsym.  In
effect a module could have an array of void *'s which are contain the
address of each and every external procedure call.  Initially each
array element could be directed to the default handler which looks up
the symbol name in the external shared library.  Once looked up the
address would be stored into the appropriate array element ready for
next time the procedure is called.  Of course a similar scheme would
need to be done for external variables.

Alternatively shared library support could just map the initialisation
and finalisation calls onto the same shared library
constructor/destructor.  Any inter procedure calls could be linked
using traditional `ld' calls.  Or put another way multiple modules
could be linked into a single shared library using `ld'.

I guess the advantage with the first method is that it would be
possible to compile every library as a shared library.  Finally
the user could run the runtime system followed by the main module
name and watch the application come to life via a series of
dynamic library loads.  Ie:

  m2 modulename

It might be quite nice from the perspective of IDEs, maybe.  Although
it would contain a slight performance cost.  My question is, whether
this is sensible or what users want?  Or do you want both :-)


gm2 mailing list

Andreas Fischlin, Ph.D., Group Director

Terrestrial Systems Ecology
Institute of Integrative Biology: Ecology, Evolution, Infectious Disease
Department of Environmental Sciences, ETH Zurich

ETH Zurich, CHN E35.1
8092 Zurich, Switzerland

Phone: +41 44 633-6090 / Fax: +41 44 633-1031

    _/_/_/ _/_/_/ _/  _/
   _/       _/   _/  _/   Eidgenoessische Technische Hochschule Zuerich
  _/_/_/   _/   _/_/_/   Swiss Federal Institute of Technology Zurich
 _/       _/   _/  _/   Ecole polytechnique federale de Zurich
_/_/_/   _/   _/  _/   Politecnico federale de Zurigo

            Make it as simple as possible, but distrust it!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]