This is the mail archive of the kawa@sourceware.org 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: Getting rid of the "edit-compile-run-cycle" for Kawa


Yes, we've been using KawaPageServlet with automatic servlet mapping,
and it works great, as documented.  But it isn't giving us automatic
recompile of static modules.  Definitions made inside the servlet
itself are immediately reflected, however.

> It does that, if you replace "class" by "module": A module A requires B,
> and B requires C...

I'm not seeing that behavior.  For one thing, I'm getting the (require
"foo.scm") usage to work from within a servlet.  But if that file,
"foo.scm" contains a (require "bar.scm"), I can't get that second
require to work.  What should "bar.scm" be?  An absolute path, like
"/usr/tomcat/webapps/someapp/ROOT/WEB-INF/classes/bar.scm"?  Or a path
relative to the calling file's path?  I've tried absolute and relative
paths and only the absolute paths are working for calls to require
from within servlets, but as I mention above, nothing is working for
me when calling from a static module file.

I should mention that I'm using Tomcat on Windows XP.  I've tried this
with both Kawa 1.9.1 and the latest build from source.

There are other problems but I'll wait until I get this path thing sorted out.
Thank you!
-Ethan

On Sat, May 3, 2008 at 8:49 AM, Per Bothner <per@bothner.com> wrote:
> Ethan Herdrick wrote:
>
> > Hi -
> >
> > We really want to improve our dev environment for our Kawa web app.
> > The main problem is the "edit-compile-run-cycle".  Even though Kawa is
> > a great language, this style of development makes it feel like we are
> > just using Java.  It slows us down.  What I want is to change some
> > function defined in a static module and simply refresh any page in our
> > app that uses that function and see the result of the change.
> >
>
>  Have you tried this:
>  http://www.gnu.org/software/kawa/server/auto-servlet.html
>
>  [One of the problems I need to fix with Kawa is that finding
>  documentation isn't always easy.  This particular file is an example
>  of that ...]
>
>  I haven't tested this recently, but hopefully it still works.
>  Please let me know.  I also have some further serlvet-related
>  patches from various past experiments - these need to be re-tested
>  and integrated.
>
>
>
> > In trying to achieve this I've made a simple macro "require/smart"
> > that will expand to (require <foo>) if the system is in production
> > mode, and expand to (load "\some-path\foo.scm") if in development
> > mode.  Of course, our existing code behaves somewhat differently when
> > loaded instead of required.  I've been working through this but I'm
> > not sure what the ultimate result will be.  I might be overlooking
> > some fatal flaw in this plan.  This technique does work fine in a very
> > simple proof of concept with a very simple tree of dependencies made
> > up of three simple files of definitions.
> >
>
>  I always discourage use of load.
>
>
>
> > In an old post to this list (found here:
> > http://www.sourceware.org/ml/kawa/2006-q4/msg00002.html )  Per wrote:
> >
> > "...you can:  (require "file-name")  and it automatically compile sit,
> > as a module, and recompiles if it has changed.  It updates the global
> > environment. (However, there is no support for updating existing
> > values -such as if an existing value references an updated function -
> > but that could be added.)"
> >
> > That would be fantastic.  What would need to be done to add that?
> >
>
>  It should work now - though I just found a bug ...
>
>
>
> > Could it understand dependencies, i.e. recompile a class if a class it
> > depends on has been recompiled?
> >
>
>  It does that, if you replace "class" by "module": A module A requires B,
>  and B requires C, the way it is supposed to happen is this:
>  If a module A requires A, it will make a dependent of B and C.
>  Next time the require is "executed", then the dependence of B and C
>  is checked.  If C is modified, this will before B to be recompiled,
>  which will force A to be recompiled.
>
>  Or something like that - I haven't looked at it in a while.
>  --
>         --Per Bothner
>  per@bothner.com   http://per.bothner.com/
>



-- 
Ethan Herdrick
www.biographicon.com - Everyone's biography.


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