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

Re: Can one do the following in dylan?





Samuele Pedroni wrote:

> Bruce and Hugh thanks for the prompt answers. But <wink>
>
>
> I'm a bit lost, is that a yes or a no answer. Can I load those dll programatically
> at runtime... is there a dynamic-load function that can load
> a textually referred dll.
>
> Let be concrete with an example.
>
> Can one write a servlet server in dylan? having both the servlets and
> the server being written in dylan and working together at dylan level,
> not at some lower level (COM or other components framework).
> It should be possible to compile servlets separately from the server
> which should meet (link with) them lately at runtime without being
> aware of them at its compilation time.
>
> [Or are you simply referring to the fact that a dylan lib can be
> deployed as dll and one can compile his code against such a dll
> but that must be known at compilation time?]
>
> One can write such a server in java, python, a lisp system with eval
> or better load (of compiled code) or eventually compile present in a
> deployed runtime, I imagine in Objective-C,... in C(++) it would be
> painful because
> language level dynamic linking here is low-level dynamic linking ;).
> What's the situation with dylan?
>
> regards, Samuele Pedroni.

In short, everything is possible in Dylan ;-) For loading dll's by name you'd have to
interface with the underlying OS, which Dylan supports.

Beyond that you'd have to create some framework and/or convention to detect what
plugins have been loaded (including if needed their names). The plug-in libraries
would be compiled against the framework, not the other way around.

For example, for each plug-in subclass each plug-in library would call a framework
function 'register-plug-in("name")'
and define a method of a framework function 'make-plug-in(plug == "name")'. For this
approach lexical class definitions would work.

I think one could come up also with a dynamic class definition approach (there is no
problem with dispatching to unknown - at compile time - subclasses of a class, as long
as it is open), but it is not necessary. Loading a dll
with some lexical class definition is equivalent to defining a class dynamically.

I appologize for not being more precise - I haven't given it too much thought and
haven't used Dylan for a while.

Roman


Warning
Could not process part with given Content-Type: text/x-vcard; charset=us-ascii; name="Roman.Budzianowski.vcf"

References: