From: Kurt N�rmark
Subject: Announcing 'Lisp Abstracted Markup Language' (LAML) vers. 14
Date: 
Message-ID: <Vr7V4.1946$xp.16543@twister.sunsite.auc.dk>
With this I want to announce version 14 of LAML. Earlier versions have been
announced on comp.lang.scheme.

LAML is a Scheme-based package for generation of HTML pages from a Scheme
source, and for CGI programming in Scheme.  LAML means 'Lisp Abstracted
Markup Language'. The idea is to use Scheme as a markup language instead of
HTML or XML. With this a document with markup in reality becomes a Scheme
program.  Processing the file f.laml will - in the simple cases - give a
file f.html. In more complicated situations a number of different html files
can be generated.

LAML provides a language-homogeneous solution within the functional
programming paradigm, as a contrast to PhP or ASP in which imperative
programs are mixed with SGML-like markup.  We find that the functional
paradigm is very attractive compared with the imperative paradigm in the
HTML application domain; This is mainly because of the natural composition
of function calls in the functional paradigm which matches the nesting of
HTML elements in a WWW document.

Here are a number of relevant URLs to more information about LAML:

The LAML Home Page:

  * http://www.cs.auc.dk/~normark/laml/

where you will find a number of papers on LAML and a number of links.

The LAML Software page

  * http://www.cs.auc.dk/~normark/scheme/index.html

with download possibilities, all the software and extensive documentation.
If you download the LAML zip file you should bring up the index.html file in
your WWW browser.

If you want to read about my motivation for creating LAML please see

  * http://www.cs.auc.dk/~normark/scheme/laml-motivation.html

Version 14 features a variety of improvements:

  * Completion of a very accurate mirror of HTML in Scheme.
  * Support of CSS attribute side by side with HTML attributes.
  * Useful browsers for LAML and Scheme.
  * Now available for MzScheme, SCM, and Guile.
  * and much more...

Please take a look at all the news at
  * http://www.cs.auc.dk/~normark/scheme/change-logs/news-14.html


I appreciate any feedback about LAML from you.


Kurt N�rmark
Department of Computer Science
Aalborg University, Denmark.

·······@cs.auc.dk
http://www.cs.auc.dk/~normark

From: Tom Breton
Subject: Re: Announcing 'Lisp Abstracted Markup Language' (LAML) vers. 14
Date: 
Message-ID: <m3d7mhq597.fsf@world.std.com>
"Kurt N�rmark" <·······@cs.auc.dk> writes:

> 
> 
> I appreciate any feedback about LAML from you.

That is fascinating.  But have you looked at the Latte approach?
http://www.latte.org 

It solves at least one problem you mention on your site, that of
escaping strings appropriately.  In Latte, every token is a string,
except when escaped by `\'.  In other words, the default is reversed.


-- 
Tom Breton, http://world.std.com/~tob
Not using "gh" since 1997. http://world.std.com/~tob/ugh-free.html
Some vocal people in cll make frequent, hasty personal attacks, but if
you killfile them cll becomes usable.
From: Rob Warnock
Subject: Re: Announcing 'Lisp Abstracted Markup Language' (LAML) vers. 14
Date: 
Message-ID: <8g55nl$cvsg0$1@fido.engr.sgi.com>
Tom Breton  <···@world.std.com> wrote:
+---------------
| "Kurt N�rmark" <·······@cs.auc.dk> writes:
| > I appreciate any feedback about LAML from you.
| 
| That is fascinating.  But have you looked at the Latte approach?
| http://www.latte.org 
+---------------

And don't forget "Mistie":

    <URL:http://www.cs.rice.edu/~dorai/mistie/mistie.html>

I've used it a bit. Fairly nice. Also in Scheme. Uses a TeX-like
bottom-up "trigger character" style -- any character can be enabled
(with ""mistie-def-char") to call a Scheme procedure when seen, and
the entire state of triggers can be readily pushed/mutated/popped to
compose complex actions. For example:

	Suppose we want a contiguous sequence of blank lines to be come
	out as the paragraph separator, <p>. We could "mistie-def-char"
	the newline character as follows: 

	(mistie-def-char #\newline
	  (lambda ()
	    (newline)
	    (let* ((s (h-read-whitespace))
		   (n (h-number-of-newlines s)))
	      (if (> n 0)
		  (begin (display "<p>")
		    (newline) (newline))
		  (display s)))))

	This will cause newline to read up all the following whitespace,
	and then check to see how many further newlines it picked up.
	If there was at least one, it outputs the paragraph separator,
	viz., <p> followed by two newlines (added for human readability).
	Otherwise, it merely prints the picked up whitespace as is.

It also provides a more traditional keyword-style, the "control sequence",
which is simply a special trigger character which picks up a token and
dispatches on it, e.g., you can say "\newtitle" or ·@footnote" and call
a Scheme procedure for each.

As I mentioned, the action routine for a trigger character can "push the
world" and redefine itself or some other character, and a later action
can "pop the world" to restore the original definition. The example Scheme-
based "style sheets" in the distribution use this to do argument gathering,
for example. Control sequence "\foo" might redefine "{" to redefine *all*
characters to push themselves into a side buffer, and redfine "}" to undo
that and then do something with the accumulated characters. So you could do:

	\foo {some text here,
	there,
	everywhere}

which would result in some Scheme procedure being called with the string
"some text here,
there,
everywhere".

And of course, you can have multiple arguments, too, if you like:

	\bar{abc}{def}{ghi}


-Rob

-----
Rob Warnock, 41L-955		····@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		PP-ASEL-IA
Mountain View, CA  94043
From: Kurt Nørmark
Subject: Re: Announcing 'Lisp Abstracted Markup Language' (LAML) vers. 14
Date: 
Message-ID: <39290E71.F9A6BDED@cs.auc.dk>
Tom Breton wrote:

> "Kurt N�rmark" <·······@cs.auc.dk> writes:
>
> >
> >
> > I appreciate any feedback about LAML from you.
>
> That is fascinating.  But have you looked at the Latte approach?
> http://www.latte.org
>
> It solves at least one problem you mention on your site, that of
> escaping strings appropriately.  In Latte, every token is a string,
> except when escaped by `\'.  In other words, the default is reversed.

I have taken a quick look on Latte. In my interepretation Latte provides
an alternative syntax to HTML, at a slightly higer abstraction level. As a

contrast, LAML brings HTML into Scheme as a number of *mirror functions*,
one for each HTML element (tag). This creates the string quoting problem
which
you mention; However, it allows for easy and straightforward abstraction
such that
you now can create your own mark up very easily (as a flexible but
somewhat
anarchistic alternative to XML). This is a very powerful thing, and leaves
the string
quoting problem as a minor detail.

Here is an example of an LAML document (a FAQ on something).

(load (string-append laml-dir "laml.scm"))
(style "simple")
(load (string-append (startup-directory scheme-system) "functions.scm"))

(generic-page-1
  "Demonstration of abstractions"
  (con
    (standard-intro "My FAQ")
    (ul
     (map present-faq-entry
       (list
          (faq-entry  'teacher
            "What is Lisp"
            "Lisp is a list processing language...")

          (faq-entry  'student
            "What is LAML"
            "LAML is Scheme in which HTML is mirrored...")

          (faq-entry  'student
            "What is the main differences between Scheme and Lisp"
            "Scheme is a relatively small, but powerful Lisp dialect...")
        )))
    (standard-signature)
  )
  white black blue blue
)

For more details on this example please see


http://www.cs.auc.dk/~normark/scheme/slides/lugm-99-amsterdam/html/laml-brief-TF-lugm99-slide-laml-abstractions.html

which is part of a slide show (created via LAML) on LAML.

--kurt
From: Jorgen 'forcer' Schaefer
Subject: Re: Announcing 'Lisp Abstracted Markup Language' (LAML) vers. 14
Date: 
Message-ID: <hhog5yo1k4.fsf@forcix.burse.uni-hamburg.de>
Kurt N�rmark <·······@cs.auc.dk> writes:

> Tom Breton wrote:
> >
> > That is fascinating.  But have you looked at the Latte approach?
> > http://www.latte.org
> >
> > It solves at least one problem you mention on your site, that of
> > escaping strings appropriately.  In Latte, every token is a string,
> > except when escaped by `\'.  In other words, the default is reversed.
> 
> I have taken a quick look on Latte. In my interepretation Latte provides
> an alternative syntax to HTML, at a slightly higer abstraction level. As a
> contrast, LAML brings HTML into Scheme as a number of *mirror
> functions*, one for each HTML element (tag). This creates the
> string quoting problem which you mention; However, it allows
> for easy and straightforward abstraction such that you now can
> create your own mark up very easily (as a flexible but somewhat
> anarchistic alternative to XML).

Well, latte is (almost) a scheme, just with different syntax.
Like LAML, latte-html has all HTML elements as functions, with
attributes as optional arguments.  The difference is, that the
default for Scheme programs (and LAML) is to "read scheme" and
only for "" quoted stuff it moves to "read string" -- Latte does
it the other way around, and reads strings all the time, and only
for \ escaped stuff it moves to "read latte".

The changed syntax helps alot in writing longer texts in
websites, and the functions help alot in abstracting, like your
document for the nice case of a faq list abstraction.  As another
thing, Latte inserts <p> evertime you have an empty line, which
is very nice in texts as well, but sometimes a bit disturbing ;)

Your example would be in latte almost identical (given the
function definitions of style in laml.scm or similar):

> (load (string-append laml-dir "laml.scm"))
> (style "simple")
> (load (string-append (startup-directory scheme-system) "functions.scm"))
> 
> (generic-page-1
>   "Demonstration of abstractions"
>   (con
>     (standard-intro "My FAQ")
>     (ul
>      (map present-faq-entry
>        (list
>           (faq-entry  'teacher
>             "What is Lisp"
>             "Lisp is a list processing language...")
> 
>           (faq-entry  'student
>             "What is LAML"
>             "LAML is Scheme in which HTML is mirrored...")
> 
>           (faq-entry  'student
>             "What is the main differences between Scheme and Lisp"
>             "Scheme is a relatively small, but powerful Lisp dialect...")
>         )))
>     (standard-signature)
>   )
>   white black blue blue
> )

{\load {\string-append \laml-dir laml.scm}}
{\style simple}
{\load {\string-append {\startup-directory scheme-system} functions.scm}}

{\generic-page-1
  \"Demonstration of abstractions\"
  {\con
    {\standard-intro My FAQ}
    {\ul
     {\map present-faq-entry
       {\list
          {\faq-entry teacher
            \"What is Lisp\"
            \"Lisp is a list processing language...\"}

          {\faq-entry student
            \"What is LAML\"
            \"LAML is Scheme in which HTML is mirrored...\"}

          {\faq-entry  student
            \"What is the main differences between Scheme and Lisp\"
            \"Scheme is a relatively small, but powerful Lisp dialect...\"}
        }}}
    {\standard-signature}}
  white black blue blue}

        -- forcer

-- 
((email . ·······@mindless.com")       (www . "http://forcix.cx/")
 (irc   . ·······@#StarWars (IRCnet)") (gpg . "/other/forcer.gpg"))
From: Tom Breton
Subject: Re: Announcing 'Lisp Abstracted Markup Language' (LAML) vers. 14
Date: 
Message-ID: <m34s7qjr7w.fsf@world.std.com>
Kurt N�rmark <·······@cs.auc.dk> writes:

> Tom Breton wrote:
> 
> > "Kurt N�rmark" <·······@cs.auc.dk> writes:
> >
> > >
> > >
> > > I appreciate any feedback about LAML from you.
> >
> > That is fascinating.  But have you looked at the Latte approach?
> > http://www.latte.org
> >
> > It solves at least one problem you mention on your site, that of
> > escaping strings appropriately.  In Latte, every token is a string,
> > except when escaped by `\'.  In other words, the default is reversed.
> 
> I have taken a quick look on Latte. In my interepretation Latte provides
> an alternative syntax to HTML, at a slightly higer abstraction
> level. 

I don't think that's correct.  When I visited the Latte site, I saw
that Latte encompassed essentially Scheme.

> As a
> 
> contrast, LAML brings HTML into Scheme as a number of *mirror functions*,
> one for each HTML element (tag). This creates the string quoting problem
> which
> you mention; However, it allows for easy and straightforward abstraction
> such that
> you now can create your own mark up very easily (as a flexible but
> somewhat
> anarchistic alternative to XML). This is a very powerful thing, and leaves
> the string
> quoting problem as a minor detail.

Look, please don't take this the wrong way, but I get a strong
impression that you are "defending" your approach.  You said you
wanted comments and I took you at your word.  Do you?


> the string
> quoting problem as a minor detail.

I'm sorry, I don't think that is so.  You're talking about having to
quote and escape every string in a text markup language.

 
> 
> For more details on this example please see

I have visited your site and read 2 of your papers.  I got the gist of
it.

-- 
Tom Breton, http://world.std.com/~tob
Not using "gh" since 1997. http://world.std.com/~tob/ugh-free.html
Some vocal people in cll make frequent, hasty personal attacks, but if
you killfile them cll becomes usable.
From: Kurt Nørmark
Subject: Re: Announcing 'Lisp Abstracted Markup Language' (LAML) vers. 14
Date: 
Message-ID: <392A48E9.D1F44D9@cs.auc.dk>
Tom Breton wrote:

> Kurt N�rmark <·······@cs.auc.dk> writes:
>
> > Tom Breton wrote:
> >
> > > "Kurt N�rmark" <·······@cs.auc.dk> writes:
> > >
> > > >
> > > >
> > > > I appreciate any feedback about LAML from you.
> > >
> > > That is fascinating.  But have you looked at the Latte approach?
> > > http://www.latte.org
> > >
> > > It solves at least one problem you mention on your site, that of
> > > escaping strings appropriately.  In Latte, every token is a string,
> > > except when escaped by `\'.  In other words, the default is reversed.
> >
> > I have taken a quick look on Latte. In my interepretation Latte provides
> > an alternative syntax to HTML, at a slightly higer abstraction
> > level.
>
> I don't think that's correct.  When I visited the Latte site, I saw
> that Latte encompassed essentially Scheme.

Yes, I now realize that Latte is much closer to Scheme than i first understood.
Thank you to Jorgen Schaefer for giving the Latte counterpart to my LAML
example.
I will certainly study the Latte approach much more carefully now.

>
>
> > As a
> >
> > contrast, LAML brings HTML into Scheme as a number of *mirror functions*,
> > one for each HTML element (tag). This creates the string quoting problem
> > which
> > you mention; However, it allows for easy and straightforward abstraction
> > such that
> > you now can create your own mark up very easily (as a flexible but
> > somewhat
> > anarchistic alternative to XML). This is a very powerful thing, and leaves
> > the string
> > quoting problem as a minor detail.
>
> Look, please don't take this the wrong way, but I get a strong
> impression that you are "defending" your approach.  You said you
> wanted comments and I took you at your word.  Do you?

I am defending my approach because I belive in it. I has worked for me
the last two years. I am confident that other Scheme programmers can use it.
But you are free to draw your own conclusions, of course. No problems for me at
all.
And if it turns out that there are good solutions to the string quoting 'detail'
I will find this
very interesting for future versions of LAML. By the way, ······@EatonVance.Com
pointed out
the BRL way of dealing with this problem (http://brl.sourceforge.net/) which is
probably
the best idea I have seen.

>
> > the string
> > quoting problem as a minor detail.

When you read an LAML (Scheme) program used for markup purposes
your conclusions are undoubtedly correct. But you have to realize HOW it
is created. I will illustrate this with the following example:

The step from

  (body "Here is a simple string without markup")

to

  (body
    (con "Here is a simple string " (em "without") " markup")
  )

is carried out by a single editor (emacs) command called embed. con is a
brief alias for string-append. The author selects 'without' and embeds
it in an em form. The editor command nest and unnest are also useful.
(I am missing an un-embed, however). You can proceed by embedding 'Here'
in an anchor tag:

  (body
    (con  (a "Here") " is a simple string " (em "without") " markup")
  )

Again you just used a single embed command.Now you add an 'href attribute value
pair:

  (body
    (con  (a 'href "some-url" "Here") " is a simple string " (em "without") "
markup")
  )

You keep, as an invariant, that the Scheme expressions are well-formed during
the entire authoring process. Looking at the result, I should be the first to
admit
that it does not look very nice. However, from a writing point of view, there
are no big troubles. I almost never make lexical or simple syntactical errors.

I can manage to author and write LAML (Scheme) documents in this way. The real
advantage
is that my document IS a Scheme program, and I can *immediately* define new
markup
elements, on an ad hoc basis, or more systematically by organizing new stuff in
libraries and 'styles'. For instance the example above could be changed to

  (body
    (con  (a-tag "Here" "some-url") " is a simple string " (special-em "with") "
markup")
  )

given that the following simple definitions are supplied:

(define (a-tag anchor url)
 (html4:a (as-string anchor) 'href url))

(define (special-em x)
  (em 'css:letter-spacing "0.3cm" (font-color red x)))



>
> I'm sorry, I don't think that is so.  You're talking about having to
> quote and escape every string in a text markup language.
>
>
> >
> > For more details on this example please see
>
> I have visited your site and read 2 of your papers.  I got the gist of
> it.
>
> --
> Tom Breton, http://world.std.com/~tob
> Not using "gh" since 1997. http://world.std.com/~tob/ugh-free.html
> Some vocal people in cll make frequent, hasty personal attacks, but if
> you killfile them cll becomes usable.
From: Tom Breton
Subject: Re: Announcing 'Lisp Abstracted Markup Language' (LAML) vers. 14
Date: 
Message-ID: <m3k8gl149r.fsf@world.std.com>
Kurt N�rmark <·······@cs.auc.dk> writes:

> Tom Breton wrote:
> 
> > Kurt N�rmark <·······@cs.auc.dk> writes:
> >
> > > Tom Breton wrote:
> > >
> > > > "Kurt N�rmark" <·······@cs.auc.dk> writes:
> > > >
> > > > >
> > > > >
> > > > > I appreciate any feedback about LAML from you.
> > > >
> > > > That is fascinating.  But have you looked at the Latte approach?
> > > > http://www.latte.org
> > > >
> > > > It solves at least one problem you mention on your site, that of
> > > > escaping strings appropriately.  In Latte, every token is a string,
> > > > except when escaped by `\'.  In other words, the default is reversed.
> > >
> > > I have taken a quick look on Latte. In my interepretation Latte provides
> > > an alternative syntax to HTML, at a slightly higer abstraction
> > > level.
> >
> > I don't think that's correct.  When I visited the Latte site, I saw
> > that Latte encompassed essentially Scheme.
> 
> Yes, I now realize that Latte is much closer to Scheme than i first understood.
> Thank you to Jorgen Schaefer for giving the Latte counterpart to my LAML
> example.
> I will certainly study the Latte approach much more carefully now.
> 
> >
> >
> > > As a
> > >
> > > contrast, LAML brings HTML into Scheme as a number of *mirror functions*,
> > > one for each HTML element (tag). This creates the string quoting problem
> > > which
> > > you mention; However, it allows for easy and straightforward abstraction
> > > such that
> > > you now can create your own mark up very easily (as a flexible but
> > > somewhat
> > > anarchistic alternative to XML). This is a very powerful thing, and leaves
> > > the string
> > > quoting problem as a minor detail.
> >
> > Look, please don't take this the wrong way, but I get a strong
> > impression that you are "defending" your approach.  You said you
> > wanted comments and I took you at your word.  Do you?
> 
> I am defending my approach because I belive in it. I has worked for me
> the last two years. I am confident that other Scheme programmers can use it.
> But you are free to draw your own conclusions, of course. No problems for me at
> all.
> And if it turns out that there are good solutions to the string quoting 'detail'
> I will find this
> very interesting for future versions of LAML. 

I'm glad to hear it.  I thaut for a moment there I was watching
fragmentation and duplication of effort for no reason.

> By the way, ······@EatonVance.Com
> pointed out
> the BRL way of dealing with this problem (http://brl.sourceforge.net/) which is
> probably
> the best idea I have seen.

Thank you for the url.  I will be sure to check it out.


> > > the string
> > > quoting problem as a minor detail.
> 
> When you read an LAML (Scheme) program used for markup purposes
> your conclusions are undoubtedly correct. But you have to realize HOW it
> is created. I will illustrate this with the following example:

[snip example]

There's certainly value in emacs commands to automatically manipulate
the markup.  Handling LAML or Latte, I am sure, is a lot easier in
emacs than handling XML/SGML as psgml does.  I've written and
published some extensions to psgml, and I'll be the first to say that
handling s-exps is much, much easier.

But ISTM there's also value in data that withstands manual
manipulation well.  Commands can't anticipate everything, and some
people will make the smaller changes by hand, with inevitable
mistakes.  So ISTM it's nice to have a representation that doesn't
easily get out-of-sync, and doesn't get too badly tangled up when it
does.

And I'll spare a tiny footnote for those poor souls who have no
emacs.  }:)

-- 
Tom Breton, http://world.std.com/~tob
Not using "gh" since 1997. http://world.std.com/~tob/ugh-free.html
Some vocal people in cll make frequent, hasty personal attacks, but if
you killfile them cll becomes usable.
From: ·······@sperience.com
Subject: Re: Announcing 'Lisp Abstracted Markup Language' (LAML) vers. 14
Date: 
Message-ID: <nm9g0r6u8ds.fsf@scrubbing-bubbles.mit.edu>
Kurt =?iso-8859-1?Q?N=F8rmark?= <·······@cs.auc.dk> writes:

> And if it turns out that there are good solutions to the string
> quoting 'detail' I will find this very interesting for future versions
> of LAML. By the way, [Bruce Lewis] pointed out the BRL way of dealing
> with this problem (http://brl.sourceforge.net/) which is probably the
> best idea I have seen.

Thanks!  As a side note, I'd rather not have my work e-mail address
appear on Usenet for the time being, but no big deal.

Here's the full text of the message Kurt is referring to:

It's encouraging to hear about success with LAML.  I can imagine it being
very nice to create web applications with a single language.  I usually have
to use three: HTML, SQL and Scheme.

To address the negative side re. splitting a long string into string
constants interspersed with other expressions, you might consider borrowing
an idea from BRL.  There are only two ideas in BRL that could be argued as
cleverness, and this is one: an asymmetric string syntax.  Constant strings
are delimited with square brackets, thus:

        ]Hello, World![

This seems strange at first, but does make things more readable, e.g.

        When the LAML program [(kbd "f.laml")] runs it usually writes a file
[(kbd "f.html")] in the same directory as [(kbd f.laml)].

(Constant strings can also begin with the beginning of the file and end with
EOF.)

It especially reduces the tendency to leave out spaces from the
beginning/end of a string when needed.  This tendency comes from the fact
that in English you never leave a space inside a quote mark.  The square
brackets are much closer to actual usage in English and [editor: pls list
other languages that use square brackets this way].  They seem natural to
me, but someone used to square brackets being synonymous with parens might
want to use curly braces or somesuch.  A future version of BRL may be
configurable that way.

If you want to compare pure-Lisp web programming with template engines, feel
free to use BRL as the example template engine; I won't be offended.  This
would eliminate the language-war aspect of comparison to PHP, JSP, etc.

For the time being, I'll continue to work on BRL as a template engine.  I
want it to be something that people with web experience but little
programming experience can jump right into.  I want it to be something
"everybody else is using" so that I don't have to justify it to management.
(Current management is friendly toward BRL, but things change.)  I want it
to be popular, so giving it mass appeal is a priority at present.

Some time in the future I'd be interested in putting LAML into BRL so that
those who acquire a taste for Lisp through BRL can use it more and more.

http://brl.sourceforge.net/

-- 
(for-each (lambda (str) (display (string-append (make-string (- 40
(quotient (string-length str) 2)) #\space) str)) (newline)) '(""
"Bruce Lewis" "MIT 1990" "http://brl.sourceforge.net/"))