[Prev][Next][Index][Thread]
Re: Can one do the following in dylan?
On Tue, 27 Mar 2001, Samuele Pedroni wrote:
> [the motivation of this mail is really intellectual curiousity, not to
> start a flamewar, java
> is not my language-of-choice, I have not such a thing]
>
> In java the following is possible:
> [loading pre-compiled classes at runtime then instantiating them using
> name-lookup]
>
> Is something like that (*language-aware* dynamic loading, no C low-level
> shared library stuff)
> possible in dylan? (AFAIK no but ...)
No, is the short answer :-)
As you may know, Fun-O's Functional developer does let you load DLLs at
runtime and thereby add new classes, methods etc. Gwydion Dylan has
dynamic-linked libraries these days, AFAIK, so I suppose I *could* do
that, too.
Another similar sort of thing (but by no means a replacement for Java's
ability) is that you can create classes dynamically. If you also
implemented a parser for some language, which built up Dylan methods etc.,
you could "compile" it into your currently-running application. Not sure
how useful that would be, though!
Also, I suppose you could use COM/CORBA/... components. There's a
syntactic overhead (perhaps less in Dylan) and a runtime overhead (though
perhaps not much worse than the general overhead of running Java ;-) but
you can do it cross-langauge.
Lastly, loading classes dynamically in the true Java sense isn't
incompatible with Dylan's language design, as I understand it. That is,
there wouldn't have to be any incompatible language changes to add it in
future (just a lot of design and implementation work!).
> PS 1. what's the sense? (ignoring impl aspects, applet hype and security
> concerns) this is one the few
> things that is a non controversial java win (sometimes a big-win) =>
> - is such a feature useful/unuseful?
> - is it compatible with dylan philosophy? with dylan "design
> compromises"?
> 2. yes it's the cause of many java design compromises (I know!)
I think design is the cause of many design compromises ;-)
HTH,
Hugh
References: