This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Loading and unloading scheme function definitions.


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/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]