Re: Ruby performance woes



| Why not LHP (Lisp instead of Perl Hypertext Preprocessor)?
From: r...@xxxxxxxx (Rob Warnock)
Why not, indeed? See:
http://rpw3.org/hacks/lisp/minimal.lhp

Linkname: here
URL: http://rpw3.org/hacks/lisp/minimal.lisp
Lynx won't let me see it, but will let me download it to the hard
disk on my personal account on my ISP:
2 -rw------- 1 rem user 743 May 1 23:34 tmp-minimal.lisp
Hmm, you seem to have extended the Common Lisp syntax whereby a
keyword in the first position in a list is a HTML-like tag whereas
a normal symbol is the name of a function (or special operator or
macro) as usual. That's a neat idea. But this is something
completely different from what I was asking about, which would be
mostly HTML syntax with embedded scriptlets, like PHP and JSP. What
you've done is similar to a *different* idea I've been thinking
about from time to time.

Now here's my take on all this: PHP and JSP and what I inquired
about in this thread are a way of having a graceful transition
between people who know *only* how to code HTML and learning how to
enhance the Web pages with a little bit of active content. By
comparison, CGI using Perl or other language is fullfledged coding
the Web Page in some language other than HTML, where in effect the
entire CGI application is one huge analogy to a scriptlet. Your
idea (similar to what I suggested elsewhere) goes in a different
direction, using the s-expression parse-tree to intermix two modes:
- Ordinary Lisp code, as if CGI.
- S-expressions used as a directly alternate expression of SGML or XML.
My similar idea would have used strings rather than keyword symbols
in the first position within a list, but the basic idea is the
same.

So the bad thing is that you have usurped the filetype "LHP" to
mean the fully s-expression alternate to SGML or XML, so that
nobody can use that to represent what I proposed in this thread,
something analagous to PHP or JSP. Maybe it would have been better
if you had used "LML", to be directly analagous in name with SGML
and XML. Is it too late to make that change? (Do you have a user
base of more than a hundred different Web authors?)

Now I have one actual nitpick: You don't show a version number. So
if somebody uses your idea but extends to new keywords as tags,
they won't be able to differentiate their syntax from yours so that
you can share the same filetype and the Web server can use the
version number to know how to emulate the source correctly.
What do you think about including a version number somehow?
(I don't have a specific proposal, although perhaps binding the
lexical variable version at the very top would have that implied
meaning as a side effect? Perhaps the version "number" should
actually be Java-style package (reversed FQDN) plus particulars?)

http://rpw3.org/hacks/lisp/appsrv-demo.lhp
Linkname: here
URL: http://rpw3.org/hacks/lisp/appsrv-demo.lisp
4 -rw------- 1 rem user 3533 May 1 23:58 tmp-appsrv-demo.lisp
Oops, I didn't need to download it, because it was already inline.
(That's what I get for listening to Jay Leno at the same time.)

I've been using that filetype since 2000 or so for my "appsrv"
infrastructure [which does dynamic loading/compiling/caching of
Lisp source files which use HTOUT to emit HTML (though CL-WHO
or HTMLGEN should also work as well)].

Hmm, I don't recall seeing you mention it in the newsgroup before.
Did you post and I missed it, or is this the first time you've
explicitly mentionned this kind of server-dynamic Web page?

... when I was developing "appsrv" there was already a Lisp-based
server from some SRI folks that was using[1] that filetype, namely,
"Lisp Server Pages":
http://www.cliki.net/Lisp%20Server%20Pages
http://sourceforge.net/projects/lsp
XLSP is a lisp based dynamic XML management facility. It is currently
usable with Allegro CL and LispWorks implementations. It's
implementation is in two parts: XMLP for general XML processing, and
XLSP for managing interactions with web servers.
Typo: "It's" (contraction of "it is") should read "Its" (possessive)

It's not clear what is going on there. It sounds like it's merely a
package for parsing and otherwise dealing with XML, which has not
much to do with PHP/JSP-like scriptlets or anything else like
what we've been talking about. Too bad there's no link to any
introduction or tutorial or other way to know what they're really
talking about.

Plus, the acronym LSP implies (correctly) that the pages are coded
in a style similar to ASP or JSP, that is, as native HTML with escapes
into code with some sort of "<% ... %>" brackets. I wanted to avoid
that association, since my pages would be "all Lisp" [see first two
URLs above].

I'll take your word for the first part of that because I can't
figure out from their Web pages what they are really doing.

By the way, I've never had access to a Web server that can run ASP,
so I never had any curiosity to learn what ASP source is like.
But now I decided I needed to know, so I did a Google search,
and found a set of examples:
<http://www.w3schools.com/asp/asp_examples.asp>
<http://www.w3schools.com/asp/showasp.asp?filename=demo_variable>
<http://www.w3schools.com/asp/showcode.asp?source=demo_variable>
<%
dim name
name="Donald Duck"
response.write("My name is: " & name)
%>
Hmm, no delimiter to break apart statements, just newline.
So I guess it's impossible to have really long statements, and
impossible to nest statements? I already don't like it.
Oh well. My major question was answered with those samples, indeed
it's like JSP and PHP in syntax, not like your all-sexpr syntax.

So I went with "Lisp-Handled Pages" (LHP) instead.

OK, that's not parallel to PHP (Perl Hypertext Preprocessor).
I guess PHP needs to be renamed PSP to be analagous to JSP and ASP.

Note: I certainly have no "lock" on LHP, any more than SRI has a "lock"
on LSP, see [2]; anyone is free to develop anything they want that uses
those filetypes. I *do* think it would be nice if the ones named LHP
used "pure Lisp" and the ones named LSP used "<% ... %>" escapes, just
to avoid confusion. [And, yes, I'm aware that by this convention PHP
should really be called "PSP". Foolish consistency, hobgoblins, etc.]

Yeah, fat chance of our PHP->PSP name change ever being effected.

I'm too sleepy to go on, so I'll stop my reply now and plan to look
in detail at the lemonodor stuff another day.
.



Relevant Pages

  • Re: How not to send headers?
    ... I've been asked to port this to an ANSI terminal-type display, eliminating the web server and browser. ... Initially I thought about using C to write the app, but XML handling in C is a real PITA, plus I don't get to reuse my PHP code. ... So, now I want to use PHP to generate those same pages except that I don't want to send headers ever, and I need to loop waiting for characters to arrive from the keypad and display pages based on those chars... ...
    (comp.lang.php)
  • Re: Starting with JSP files
    ... Im used to PHP, so im used to the PHP opening tag and the php closing ... I was hoping that it was more like php, just create a,jsp file and put ... JSP can also output XML but I'd have to look up the ...
    (comp.lang.java.advocacy)
  • Re: How not to send headers?
    ... I've been asked to port this to an ANSI terminal-type display, eliminating the web server and browser. ... Initially I thought about using C to write the app, but XML handling in C is a real PITA, plus I don't get to reuse my PHP code. ... So, now I want to use PHP to generate those same pages except that I don't want to send headers ever, and I need to loop waiting for characters to arrive from the keypad and display pages based on those chars... ...
    (comp.lang.php)
  • Re: PHP wireless
    ... > developing a ecommerce web page using maybe jsp or xml or xhtml. ... PHP isn't browser-dependant, ...
    (comp.lang.php)
  • Re: What does this xslt_process() error message mean?
    ... > Does this mean the XML contains errors, or that the XSL contains errors, ... That the error doesn't occure when parsing with a JSP, ... environments use Xalan as the default parser, where it is Sablotron in PHP. ...
    (alt.php)

Quantcast