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

Re: (LONG) Scheme HTML design program - my idea and request for comments



On May  6, Patrick Giagnocavo wrote:
> [...]
> I looked at
> [...]
> I decided on DrScheme because
> [...]
> No language flames, please!

On this list there is probably no danger for that...


> Here is my idea:
> 
> Currently, for HTML sitebuilding, I use Frontier, which is a
> commercial program from UserLand software.  It runs on Windows and
> Mac.  They have a "freeware" version which is several revs behind
> the current commercial version, which is $899 per user.

I hate these programs.  They might be useful for doing things like
placing divs at certain places and making mapped images but nothing
much else...


> You can download the freeware version for Mac and Windows at:
> 
> Humph; well, actually, they keep on moving their servers and their
> files around, so I can't find a working link right now.  I have some
> screen shots at the Web page on my server (see above).
> 
> Frontier has a reasonably simple language, but what makes it stand
> apart from other tools for HTML I have used is that it has some
> objects/datatypes that are really useful:

My belief is that as soon as you use any language, you're in better
shape because you have the ability to abstract and reuse stuff.  Of
course, that could be added to html, but it is so bad that any time
taken to rant is trivially useless...  So, a language is good, Scheme
is better.


> 1.  A "wptext" type, which is any arbitrarily large kind of text
> file (though in frontier, everything is stored in its "object
> database").  This lets you type in text with any amount of HTML you
> want included in it.  HTML markup that is in the wptext is not
> munged or manhandled - so you can always type in "raw" code and know
> that it will work.

Well, any implementation that uses text scripts will have this
ability, just including srings.  But if you have a good thing to work
with, you wouldn't use "raw" text.  For example, with my thing I can
always type a literal "<big><tt>&lt;Foo!&gt;</tt></big>" but I'd much
prefer (big: (tt: "<Foo!>")).  (Actually, you'd have to quote the
former with my thing otherwise you'll get &amp;s).


> 2.  An "outline" type, which is VERY USEFUL - in fact, all other
> objects in Frontier are under the Frontier.root outline (similar but
> not exactly the same as everything being derived from Object in some
> OOP implementations).  It is basically a tree or hierarchy
> structure, with nodes and leafs (leaves?).
> 
> The outline type is especially nice, since Frontier includes a set
> of "verbs" (=functions) that let you traverse the outline and
> manipulate it.

Well, any language will give you a way to handle some recursive types
and to define functions that use them.  IMO, Scheme is particularly
good at this.


> 3.  A "glossary" which is really killer.  [...]
> At any time, in any page, you refer to it by putting the name in
> quotes.  For instance, if my glossary has
> 
> http://www.cs.rice.edu/CS/PLT/packages/drscheme/index.html and the
> associated text "DrScheme Home Page"
> 
> I can have a link automatically generated and inserted into any page
> by simply placing those exact words in quotes:
> [...]
> you dig?  This is a really great way to handle links - especially
> since it encourages conformity among several web pages, and avoids
> unclosed tags and spelling errors and of course tedious typing.

Again, any language will give you that.  You can simply define a
variable such as:

  (define drscheme-home-page
    (ref~: "http://www.cs.rice.edu/CS/PLT/packages/drscheme/index.html";
           "DrScheme Home Page"))

and then simply add a reference to it wherever you want.


> 4.  The ability to run scripts to generate the pages.  The ability
> to have "directives" or defines at the top of the file that set
> certain options for that page (eg #title above refers to the <TITLE>
> tags); these override sitewide defaults.  Of course, under Scheme
> you would have full access to *whatever* you wanted -including
> access to a database if using SrPersist.

Yeah.  Doesn't it feel good to have such a great toy?  (You'll
probably need to work a little to get this working).


> 5.  Similar to #3 you can reference any function or object or
> variable within a wptext by using {} .  So you could include part of
> another page, or the result from any other command, into that page.

If you talk about mixing "normal" html text with Scheme code, like
those php thing or similar server side junk languages, then I have a
simple preprocessor at:

  http://www.cs.cornell.edu/eli/misc/preprocessor.scm

that allows you to mix some language with text.  There are some
examples using this with Scheme and other languages at:

  http://www.cs.cornell.edu/eli/misc/preprocessor-sample

And an example with my html thing at:

  http://www.cs.cornell.edu/eli/misc/preprocessor-sample1

(It's better than standard things since it allows you to use different
language and different levels of these meta-quotes.  Also, it not too
stable, I've just discovered a bug while writing this so I'm changing
it a little.)


> 6.  If you pay the money for the latest commercial version you get a
> Webserver that is integrated inside the Frontier program.  This lets
> you offer up dynamic web pages.

So you could either wait for / implement a Scheme server, but I don't
know how that will handle a lot of traffic, or you can integrate
MzScheme into some server.  I have a friend that did this with IIS.


> 7.  In the future, I have this idea that dynamic pages could be
> "compiled" into scripts that run under different web server
> platforms, like Apache/PHP or AOLserver/TCL (www.aolserver.com).
> This would let people deploy on different servers and not be locked
> into a specific technology.

You some meta-script that will write versions for all languages?  That
shouldn't be too hard...

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
         http://www.cs.cornell.edu/eli/meaning.html        Maze is Life!