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

Re: loading additional code



Hello!

On Sat, 5 Jan 2002, Wojciech Sobczuk wrote:
> i'm currently developing a http server in mzscheme.  it already serves static
PLT provides a http server in mzscheme. 
What is the rationale behind this new implementation?
(Just curious)

On Sun, 6 Jan 2002, Wojciech Sobczuk wrote:

> On Sat, Jan 05, 2002 at 11:49:29PM +0100, David N. Welton wrote:
> [..snip..]
> > 
> > > i'm also planning to develop some kind of JSP equivalent for scheme.
> > > i don't think custom tags will be needed, because scheme is so
> > > readable and 'natural' that it can be seamlessly included in the
> > > HTML code like:
> > 
> > > 	<(reqparam "foo")>
> > > would display a request parameter "foo", contrary to the long and dirty
> > > java code for the same:
> > > 	<%= request.getParameter("foo") %>
> > 
> > <? ?> are the correct markers to use for processing instructions in
> > xml, possibly accompanied by an identifier like this:
> > 
> > <?mzwebscheme 
> > (display "hello world")
> > ?>
> 
> true!  but my main aim is - make it simple, developer friendly and quick to
> work in.  i'm tired of all this formalism which doesn't give anything.
> i'm the one parsing the document - why not use <(.  java people didn't fear to
> use % instead of ?, why would i?
> if i use '(' - it will embed scheme really nicely into the page - because a
> programmer would have to write the '(' to start a piece of scheme code.
>
Documents containing <( ... )> or <% ... %> are not weel-formed XML document,
while <?mzwebscheme s-expr ?> is proper XML PI (prod. 16 of W3C XML Rec.).
Which makes it possible to use XML/XHTML processing/editing tools on the documents
containing <? but not <( or <% . So, this formalism gives something.
Shorter PITarget (say, 'mz' instead of 'mzwebscheme') may be more developer
friendly. 

Using XML element abd dedicated namespace may be a solution also. 
<mz:scm> S-expr </mz:scm>

I do agree that one-liner
<h1><(+ 2 2)></h1>

is looking more pleasant than 
<h1><?mzwebscheme (+ 2 2)?></h1>
or
<mz:scm>(+ 2 2)</mz:scm>

but for a larger document blurred distinction between 
<h1><(+ 2 2)></h1>
and
<h1>(+ 2 2)</h1>
may be a disadvantage.


> > 
> > > is this the right way to go?  or perhaps i should experiment with
> > > XML related code in http://pobox.com/~oleg/ftp/ and go some other
> > > way?
Olegs's SSAX provides support for PIs and namespaces both.
SXPath may be also interesting in this context.


> > You might also look at things like 'BRL' which do web/scheme (he uses
> > Kawa though, if I'm not mistaken).

LAML (uses mzscheme)
JScheme (former SILK) 
HB
autogen
mod_lisp
are other examples...

Best regards,
          Kirill.