LispOS: LispEnv or Tunes?

Kelly Murray kem@Franz.COM
Thu, 01 May 1997 13:39:49 -0700


> > Again, I will say this is a somewhat narrow focus in the big picture.
> > It represent only, say, 20% of all software written maybe.
> > That is billions of dollars!  This is "our" niche.  It beats the hell
> > out of the one we have now!

> Yeah... but you can't do much with only HTML!

That is our "secret weapon"!  Everybody thinks HTML is brain-dead,
and it is, but so was X windows, and now we're all talking about how
we must have it to get useful work done.
HTML *IS* useless for a user interface if you run is some brain-dead static
httpd system, that wants to send text files back to the browser.
Recall HTTP was designed to be a simplified FTP.

But if you change the web server to dynamically generate HTML and GIFS
with tight and fast execution in the server,
then you can do a whole lot more.
The user-interface is limited since it doesn't have keystroke level
input, and only 1 mouse button.
But that can be seen as a good thing, it *requires* the interface to
be mouse-click oriented, which ends up making it easy to use
for non-computer people, who are the eventual end users.

There is a client<->server speed issue.  Not really a problem for fast
local networks, and 100mb intranets are now becomming cheap and
common.  More of problem for the intranet, but using Frames you can
do better.  Furthermore, one might have an adaptable user interface,
that detects the client connection speed and can reduce the bandwidth
needed for the interface.  This isn't easy, but is probably impossible
in a non-lisp, non-integrated httpd server.


> What I would consider is to have a virtual filer-like WWW namespace,

I'm not familiar with this.  Again, I think http://www.hotmail.com has
done an excellent job with their mail interface -- using just HTML and
nothing more.  

I am going to write a SilkScript source code single-stepper that will run
completely using just the web browser interface.
I know I can do it.  Can you?

My perspective and experience is that hackers develop and improve what they use.
If you're developing using emacs, you'll be hacking and improving
emacs. If you're developing using a HTML-based web-browser interface,
then you'll be hacking and improving it.
If it is just used for "delivery", it's functionality will be impoverished
relative to other tools.  However, I understand that an
all-web-browser based development environment is not practical
in the beginning, but that is my goal.


> Some better syntax for HTML than the raw string would be nice... perhaps:
> (make-html :title "blah" :base-url "blah" 
>    :body '(
>      (H1 "fnarg")
>      (P "My name is " (B "Alaric") ", and I live in a " (A :href "house.htm" :text "house!"))
>      ...
>
That's not too bad.  I not sure about using the same 
single letters that HTML does.
SilkScript supports them, but I've never used them in the code I've written.

Let me show a couple simple examples used in Charlotte
(the internal name of my web server), written in SilkScript.


;;
;; SilkScript form example
;;
(form demo-form
      
  :variables
  
   (hide   :type :hidden :default "")
   (name   :type :text
	   :size 12
	   :maxlength 80
	   :default "")
   (langs  :type :checkbox
	   :choices '(lisp "Lisp")
		     (java "JAVA")
		     (c    "C")'
	   :default 'lisp')
   (prefer :type :radio
	   :choices '(lisp "Lisp")
		     (java "JAVA")
		     (c    "C")'
	   :default 'lisp')
    
  :present
  
    (present-demo-form ()
		       
      (input hide :default "hidden value")
      (hline)
      (text :break :bold "Please enter your name:")
      (input name :default "Your Name Here")
      (text :break :bold "Select Your Language:")
      (input langs)
      (text :break :bold "Select Your " (:italic "Prefered") " Language:")
      (input prefer)
      (break-line)
      (input submit :name " Submit ")      
      (input reset)

    )
    
  :accept

     (accept-demo-form ()
      (http-response "200 OK"
	"Content-Type: " "text/html")
      (hline)
      (text "The hidden value was: " hide)
      (text :break "Here was your input: ")
      (enumerate (:style :itemize)
	(enumerate-item () (text " name = " name))
	(enumerate-item () (text " langs = " langs))
	(enumerate-item () (text " prefer = " prefer))
	)
      (if (member 'lisp' langs)
	then
	  (text "Response Accepted!")
	  (if (member 'lisp' prefer)
	    then
	      (text " Excellent! "))
	else
	  (text "Please try again: ")
	  (present-demo-form)
        )
      )
  )



;;
;; here is another one using tables to display the pending server requests
;;

(procedure server-pending-requests-page ()
    ;;
    ;; Show all pending requests still in queue
    ;;
    (section "Pending Requests: "
      (table ()
	(row ()
	  (label () "Host IP")
	  (label () "Request Line")
	  (label () "Request Time")
	  (label () "State")
	  )
	(loop for req in  (append *pending-requests*
				  *pending-output-requests*
				  *pending-input-requests*)
	    do
	      (row ()
		(cell (:align :left)
		  (text (ipaddr-to-dotted (request-remote-host req))))
		(cell (:align :left)
		  (text (request-request-line req)))
		(cell (:align :left)
		  (text (format-date nil t (request-start-time req))))
		(cell (:align :left)
		  (text (request-state req)))
		))))
    )