guile-user
[Top][All Lists]
Advanced

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

Web Development with Guile in HB


From: Alejandro Forero Cuervo
Subject: Web Development with Guile in HB
Date: Sat, 11 Nov 2000 20:55:50 -0500

I'm the primary author of Hyper Builder (HB), a free web development
platform useful to generate dynamic (server-side) content.

In the latest unstable version (1.9.24), we have added support for
embedding Scheme code in HB source files using Guile.  The syntax for
HB files is very simple and, along with HTML, is all that one needs to
know in order to generate dynamic web content using Scheme.

The support is very poor at this point, mostly because I could not
find the information I needed.  I am new to developing with Guile and
have been looking into it for just a few hours.  I looked at data-rep,
many outdated documents and a CVS checkout of guile-doc.  The
following are a few questions I have:

1. Is there any workaround to having to call a function that never
   returns (such as gh_enter or scm_boot_guile)?  I know this makes it
   easier to write the garbage collector but it makes it impossible
   (impossible, not just very hard and complex) to build support of
   Scheme as a module/plugin (at least using HB's definition of
   modules).  Or are the only workarounds stupid hacks such as forking
   and dedicating one process entirely to execute Scheme code?

2. How can I make functions such as `display' call my callback
   functions rather than print to stdout?  In an application server,
   such as HB, printing to stdout is stupid.  I want to capture
   whatever output the Scheme code produces and add it to some
   buffers.  Redefining those functions (how?)?  Or can I call some
   functions to set my callback function so it gets called rather than
   something that calls write/printf?

3. How can I define procedures (as with gh_new_procedure) in a way
   such that my callback functions get passed a given void pointer I
   specify?  This is necessary because HB uses multiple threads to
   attend requests simultaneously so my functions need to know which
   was the HTTP request that caused them to be called.  For example,
   in the previous question, my function needs to know what buffer it
   should work with.

4. Is Guile reentrant/thread safe?   Or should I wrap all calls to
   Guile functions with a mutex/lock?  In case it can be compiled both
   ways, how can I find out how it was compiled?

5. How can I use multiple environments/contexts/name-spaces?  So if HB
   executes some code in some file with a few (define)s, only that
   code can see them.  I guess this is not necessary when parsing
   input from just one user, but when we have an application server
   executing code from different files and different users, we need
   separate contexts for each.  I read some examples in a tutorial but
   it was extremely outdated.  Could someone point me to an example on
   how to do it in the latest version?

I think those are all the questions that hold me from finishing the
support for embedding Guile into .hb files.  Once I'm ready, HB will
be extensible using Guile and one will be able to do all sorts of web
development using it.

Thank you very much for your work in Guile and for your time.

Alejo.
http://bachue.com/alejo

--
The mere formulation of a problem is far more essential than its solution.
      -- Albert Einstein.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]