This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: Loading and unloading scheme function definitions.
- From: Per Bothner <per at bothner dot com>
- To: "Bhinderwala, Shoeb" <SBhinderwala at wellington dot com>
- Cc: Kawa List <kawa at sources dot redhat dot com>
- Date: Tue, 23 Sep 2003 12:03:57 -0700
- Subject: Re: Loading and unloading scheme function definitions.
- References: <A8A970E739924A4AAAE99901320BFBC6778137@srv_exchg2.wellmanage.com>
Bhinderwala, Shoeb wrote:
Can scheme function defintions be loaded and unloaded dynamically.
In a long-running application (24x7), user could modify a scheme function
definition (which say is stored in the database). Is it possible to update
the bindings in the Scheme environment on the fly so that the old definition
is replaced by the new one.
You have to be somewhat careful about what gets inlined or otherwise
resolved statically, as Kawa by default is somewhat agressive in
optimization and inlining. There is a --no-inline option that should
turn off inlining, but it may be more conservative that you'd like.
I.e. when inlining, a call to a Scheme procedure or reference to a
Scheme global variable may be compiled to a call to a Java method
or a reference to a Java field - if Kawa has enough information.
Otherwise, it will get whatever function or value is dynamically
bound to a Symbol. You want the former for speed, and the latter
for loading/unloading flexibility.
But as long as you're aware of the issue, you shouldn't have problems.
What Kawa doesn't know about at compile time, it can't inline, so
anything that you might want to be able to update should be loaded or
compiled separately from other modules.
Kawa doesn't provide much control over class-loeaders
and classpaths, but I haven't heard of that being a problem.
--
--Per Bothner
per@bothner.com http://per.bothner.com/