modscheme / apache... 
Author Message
 modscheme / apache...

Quote:

> Is anybody doing cgi style web programming in scheme?
> Is there any scheme module for apache?

This is difficult to do, at least with the Scheme environments I
looked at (Guile, SCM and a few others), because they don't play nice
with the top level C environment.  They want you to call a function
that never returns to do processing of Scheme.  Ick.

Quote:
> Can I dump the perl monster yet??

You could use mod_dtcl: http://www.*-*-*.com/ :-)

Ciao,
--



Sun, 30 Jun 2002 03:00:00 GMT  
 modscheme / apache...
Is anybody doing cgi style web programming in scheme?
Is there any scheme module for apache?

Can I dump the perl monster yet??

Sent via Deja.com http://www.deja.com/
Before you buy.



Mon, 01 Jul 2002 03:00:00 GMT  
 modscheme / apache...

Quote:

>> Is anybody doing cgi style web programming in scheme?
>> Is there any scheme module for apache?

>This is difficult to do, at least with the Scheme environments I
>looked at (Guile, SCM and a few others), because they don't play nice
>with the top level C environment.  They want you to call a function
>that never returns to do processing of Scheme.  Ick.

Elk allows to be called non toplevel (and returns control).

see http://www-rn.informatik.uni-bremen.de/software/elk/

Quote:
>> Can I dump the perl monster yet??

>You could use mod_dtcl: http://comanche.com.dtu.dk/dave/ :-)

>Ciao,
>--


--
------------------------------------------------------------------------------
email: marc dot hoffmann at users dot whh dot wau dot nl
------------------------------------------------------------------------------


Mon, 01 Jul 2002 03:00:00 GMT  
 modscheme / apache...

Quote:

> > Can I dump the perl monster yet??

> You could use mod_dtcl: http://comanche.com.dtu.dk/dave/ :-)

Hmm. Then how would I dump the tcl monster?


Mon, 01 Jul 2002 03:00:00 GMT  
 modscheme / apache...

Quote:

> Is anybody doing cgi style web programming in scheme?
> Is there any scheme module for apache?

> Can I dump the perl monster yet??

We have implemented an apache module for OpenScheme. But, in fact,
the CGI API is sufficient enough to obtain the same result.

We have implemented a supermarket WEB site in OpenScheme.

http://www.force-sud.com Go to 'magasin' to activate the OSM script.

Our customer wants his site simple: The customers can fill a basket
with the referenced items and fill an order form. The protocol does
not use SSL channel, but send an email to the supermarket with the
customer informations.

The products are referenced only by their name. More informations such
as a per product page, image, video, is planed soon.

The CGI program is fast enought to be interpreted: This help the
bug fixes and enhencements. When the code will be more stable,
we will compile the script to generate a binary.

The whole CGI takes 1500 lines. It uses the database cababilities
of OpenScheme. A local database is build using MsExel (requirement)
and it is converted into a text file send via FTP to the site. Then
the script rebuild the OpenScheme database. We plan to make a
management tools for Windows that deals directely to the site db.

The site is in French. All the generated pages use templates to
replace some tokens by the corresponding HTML code. In addition,
all the French messages are tokenised to be translated. The
configuration file as the form of the old .ini files under Windows.

The OpenScheme site is http://www.open-scheme.com

OpenScheme is available for Free. The supermarket script is available
into the professional version of OSM.

Cheers,


http://www.erian-concept.com
-

Sent via Deja.com http://www.deja.com/
Before you buy.



Mon, 01 Jul 2002 03:00:00 GMT  
 modscheme / apache...

Quote:

> Is anybody doing cgi style web programming in scheme?

Yes.  See my previous post in this newsgroup with "web" in the subject
line.

Quote:
> Is there any scheme module for apache?

I don't know.  But I know there is JServ (http://java.apache.org/),
which you can use to run BRL.  See my previous post.

Quote:
> Can I dump the perl monster yet??

Depends which perl modules you're depending on now, and how much coding
you're willing to do.

Here's an example BRL page:

<HTML>

<head>
[(inputs word) ; HTML input.  Will be null if no such input.
(define newword (if (null? word) "something" word))]
<title>Backwards</title>
</head>

<body>
<form>
Type a word: <input name="word">
<input type="Submit">
</form>

<p>[newword] spelled backwards is
 [(list->string (reverse (string->list newword)))]
</p>

<p>This message brought to you by [(cgi SERVER_NAME)] as a public
service.</p>

</body>
</HTML>



Mon, 01 Jul 2002 03:00:00 GMT  
 modscheme / apache...

Quote:
> > Is anybody doing cgi style web programming in scheme?
> > Is there any scheme module for apache?

> This is difficult to do, at least with the Scheme environments I
> looked at (Guile, SCM and a few others), because they don't play nice
> with the top level C environment.  They want you to call a function
> that never returns to do processing of Scheme.  Ick.

Gambit-C supports this.  Basically the C world calls a function to
initialize the Scheme side of the application, and this function
returns control normally to the C world.  Then from C you can call all
Scheme functions that have been exported to the C world (using the
c-define special form of the C-interface).  There is an example of
this in the Gambit-C distribution, below is the C and Scheme code.

Marc

/* File: "client.c" */

#include <stdio.h>
#include <stdlib.h>

/*
 * ___VERSION must match the version number of the Gambit header file.
 */

#define ___VERSION 21
#include "gambit.h"

/*
 * Include declarations exported by server.
 */

#include "server.h"

/*
 * Define SCHEME_LIBRARY_LINKER as the name of the Scheme library
 * prefixed with "____20_" and suffixed with "__".  This is the
 * function that initializes the Scheme library.
 */

#define SCHEME_LIBRARY_LINKER ____20_server__

extern ___mod_or_lnk SCHEME_LIBRARY_LINKER ();

int main (argc, argv)
int argc;
char **argv;
{
  char *temp;

  /*
   * Setup the Scheme library by calling "___setup" with appropriate
   * parameters.  The parameters set to zero will use the system
   * default.
   */

  ___setup_params_struct setup_params;

  setup_params.argc                = argc;
  setup_params.argv                = argv;
  setup_params.stack_cache         = 0;
  setup_params.min_heap            = 0;
  setup_params.max_heap            = 0;
  setup_params.live_percent        = 0;
  setup_params.gc_hook             = 0;
  setup_params.fatal_error         = 0;
  setup_params.standard            = 0;
  setup_params.debug_level         = 0;
  setup_params.default_io_encoding = ___IO_CHAR_ENCODING; /* native encoding */
  setup_params.force_tty           = 0;
  setup_params.force_unbuffered_io = 0;
  setup_params.linker              = SCHEME_LIBRARY_LINKER;

  ___setup (&setup_params);

  /* Main part of program: call Scheme functions */

  temp = eval_string ("(define x 200)");
  if (temp != 0)
    {
      printf ("result = %s\n", temp);
      ___free_string (temp); /* don't forget to reclaim string */
    }

  temp = eval_string ("(expt 2 x)");
  if (temp != 0)
    {
      printf ("result = %s\n", temp);
      ___free_string (temp);
    }

  temp = eval_string ("(+ 1 2"); /* note: missing closing parenthesis */
  if (temp != 0)
    {
      printf ("result = %s\n", temp);
      ___free_string (temp);
    }

  temp = eval_string ("(+ x y)"); /* note: y is unbound */
  if (temp != 0)
    {
      printf ("result = %s\n", temp);
      ___free_string (temp);
    }

  /* Cleanup the Scheme library (required before terminating) */

  ___cleanup ();

  /* Terminate program */

  exit (0);

Quote:
}

/* File: "server.h" */

/*
 * The only declaration in "server.scm" is the function "eval_string".
 */

extern char *eval_string ( /* char* */ );

; file: "server.scm", 11/10/96

; This file shows how to use the C-interface to implement a "Scheme
; server", that is a program which is mainly written in C and that
; makes calls to Scheme functions to access certain services.

;------------------------------------------------------------------------------

; This is a simple server that can evaluate a string of Scheme code.

(define (catch-all-errors thunk)
  (call-with-current-continuation
    (lambda (return)
      (##catch-all
        (lambda (signal-name args)
          (return
            (if (symbol? signal-name) (symbol->string signal-name) #f)))
        thunk))))

(define (read-from-string str)
  (with-input-from-string str read))

(define (write-to-string obj)
  (with-output-to-string (lambda () (write obj))))

; The following "c-define" form will define the function "eval_string"
; which can be called from C just like an ordinary C function.  The
; single argument is a character string (C type "char*") and the
; result is also a character string.

(c-define (eval-string str) (char-string) char-string "eval_string" "extern"
  (catch-all-errors
    (lambda () (write-to-string (eval (read-from-string str))))))

;------------------------------------------------------------------------------



Mon, 01 Jul 2002 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Opinion: Linux+Apache+Java+Servlets || Linux+Apache+Python

2. Answer to Mod_python and Apache problems: make_obcallback(): could not import mod_python.apache

3. FastCGI relay with Apache

4. Anyone integrating J with Apache ?

5. Parseing apache log files

6. Apache and awk

7. Show server processes using apache and gawk - showprocesses (0/1)

8. Show server processes using apache and gawk

9. VisualWave behind Apache?

10. Apache Web Server and ISAPI Broker

11. Not Clarion: Apache and ASP

12. CGI and Harbour under Apache

 

 
Powered by phpBB® Forum Software