From: Reini Urban
Subject: Lisp in Perl
Date: 
Message-ID: <3b5bfc1e.1382838756@news.tu-graz.ac.at>
[cc: Brian Ingerson <····@cpan.org>, the inline maintainer]

Just found the Inline::Java perl module 
  http://search.cpan.org/search?module=Inline::Java
which binds Java functions, classes and namespaces to perl.

Now it would be really fine to create Inline::CLISP, Inline::DrScheme or
similar beasts. This would open the lisp world to perl folks. And the
perl modules to lisp folks. (in spirit to kawa, only easier and messier)
It could also speed up perl immensely.

perl also has closures, multiple return values and similar data types,
so it the difference is not that big, only lisp's implementation is
simplier and better, esp. type support and CLOS.

According to this doc
http://search.cpan.org/doc/INGY/Inline-0.42/Inline-API.pod
it seems to be a two days job only.

use Inline Java => <<'END';
      class Foo {
         String data = "data" ;
         static String sdata = "static data" ;


         public Foo() {
            System.out.println("new Foo object being created") ;
         }


         public String get_data(){
            return data ;
         }


         public static get_static_data(){
            return sdata ;
         }


         public void set_data(String d){
            data = d ;
         }
      }
   END


   my $obj = new Foo ;
   print $obj->get_data() . "\n" ;
   $obj->set_data("new data") ;
   print $obj->get_data() . "\n" ;


The output from this program is: 

   new Foo object being created
   data
   new data


Inline::Java created a new namespace called main::Foo and created the
following functions: 

   sub main::Foo::new { ... }
   sub main::Foo::Foo { ... }
   sub main::Foo::get_data { ... }
   sub main::Foo::get_sdata { ... }
   sub main::Foo::set_data { ... }
   sub main::Foo::DESTROY { ... }

-- 
Reini Urban
http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html

From: Peter Van Eynde
Subject: Re: Lisp in Perl
Date: 
Message-ID: <8666ci3ayb.fsf@debian.org>
Fernando <···@wanadoo.es> writes:

> On Mon, 23 Jul 2001 10:58:18 GMT, ······@x-ray.at (Reini Urban) wrote:
> My goodness, these Perl folks are trully amazing...  The only thing we need
> now is the 'Inline Perl for Java', so we can call, from Perl, Java code that
> calls Perl code, that... ;-D

Be afraid. Be very afraid:

http://www.ebb.org/perljvm/
http://sources.redhat.com/ml/kawa/2000/msg00381.html


Groetjes, Peter

-- 
It's logic Jim, but not as we know it. | ········@debian.org
"God, root, what is difference?" - Pitr|
"God is more forgiving." - Dave Aronson| http://cvs2.cons.org/~pvaneynd/
From: Reini Urban
Subject: Re: Lisp in Perl
Date: 
Message-ID: <3b5df928.1513153569@news.tu-graz.ac.at>
Fernando wrote:
>On Mon, 23 Jul 2001 10:58:18 GMT, ······@x-ray.at (Reini Urban) wrote:
>>[cc: Brian Ingerson <····@cpan.org>, the inline maintainer]
>>
>>Just found the Inline::Java perl module 
>>  http://search.cpan.org/search?module=Inline::Java
>>which binds Java functions, classes and namespaces to perl.
>
>My goodness, these Perl folks are trully amazing...  The only thing we need
>now is the 'Inline Perl for Java', so we can call, from Perl, Java code that
>calls Perl code, that... ;-D

don't be so cynical :)
it might help lisp a lot if they eventually "get it".

even python got closures and proper tail-recursion lately with their
Stackless project (which was voted down to replace the old kernel in the
actual 2.1 but maybe in 2.2?) these folks are much better than the perl
folks. but the critical mass is with perl. so...

in reality I really wanted to do a big e-commerce project with lisp. but
the lack of libs and mature frameworks made me switch to mod_perl and
zope again. what a shame. if I had more time.
-- 
Reini Urban
http://tv.mur.at/film/
From: Thomas F. Burdick
Subject: Re: Lisp in Perl
Date: 
Message-ID: <xcvd76osuaw.fsf@conquest.OCF.Berkeley.EDU>
······@x-ray.at (Reini Urban) writes:

> in reality I really wanted to do a big e-commerce project with lisp. but
> the lack of libs and mature frameworks made me switch to mod_perl and
> zope again. what a shame. if I had more time.

I'm curious, what exactly did you find missing?
From: ········@hex.net
Subject: Re: Lisp in Perl
Date: 
Message-ID: <h5F77.12404$A4.1445659@news20.bellglobal.com>
···@conquest.OCF.Berkeley.EDU (Thomas F. Burdick) writes:
> ······@x-ray.at (Reini Urban) writes:
>> in reality I really wanted to do a big e-commerce project with
>> lisp. but the lack of libs and mature frameworks made me switch to
>> mod_perl and zope again. what a shame. if I had more time.

> I'm curious, what exactly did you find missing?

One of the things I _don't_ see supported in the Lisp frameworks (IMHO
leaps first to mind) is session support akin to the Java HttpSession
class, typically using cookies to track sessions.
-- 
(concatenate 'string "aa454" ·@freenet.carleton.ca")
http://vip.hex.net/~cbbrowne/linux.html
So long and thanks for all the fish.
From: Greg Menke
Subject: Re: Lisp in Perl
Date: 
Message-ID: <m3bsm7c1js.fsf@europa.mindspring.com>
> >···@conquest.OCF.Berkeley.EDU (Thomas F. Burdick) writes:
> >> ······@x-ray.at (Reini Urban) writes:
> >>> in reality I really wanted to do a big e-commerce project with
> >>> lisp. but the lack of libs and mature frameworks made me switch to
> >>> mod_perl and zope again. what a shame. if I had more time.
> >
> >> I'm curious, what exactly did you find missing?
> >
> >One of the things I _don't_ see supported in the Lisp frameworks (IMHO
> >leaps first to mind) is session support akin to the Java HttpSession
> >class, typically using cookies to track sessions.

It would be moderately trivial to arrange cookie-less sessions in
cl-http, one convienent implementation might dispatch into instances
of a session class via a key appended to the URL.  Its not as nice as
a closure, but the design would be straightforward.  I've not tried
cookies in cl-http, but they might achieve the same without all the
URL hacking.

Lisp as a language doesn't get all tangled up with a particular
implementation of http or html, in fact it really doesn't care a bit
about it.  If you want a program to act like a http server or browser,
then you load the appropriate code and use its interface(s).  

If you're missing particular functions built into Lisp, you might look
outside the individual Lisp environments at the many libraries and
packages.

Gregm
From: ········@hex.net
Subject: Re: Lisp in Perl
Date: 
Message-ID: <uoY77.26422$PA1.2774994@news20.bellglobal.com>
Greg Menke <··········@mindspring.com> writes:
> Lisp as a language doesn't get all tangled up with a particular
> implementation of http or html, in fact it really doesn't care a bit
> about it.  If you want a program to act like a http server or
> browser, then you load the appropriate code and use its
> interface(s).

That's actually the _ideal_ way of characterizing the issue; the point
here being that the Java classes provide some objects in the
"HttpSession" class that know how to "do web sessions," so that all
you need do is refer to those objects, with no need to worry about
whether, underneath, it's using:

 a) A cookie [which _is_ a good way of managing sessions; they get
 maligned for all sorts of things, but it seems silly to malign them
 for that which they were explicitly designed...], or

 b) URL rewriting.

People sometimes manage web sessions by having hidden FORM fields, but
that's icky for just too many reasons to go into...
-- 
(reverse (concatenate 'string ········@" "enworbbc"))
http://www.ntlug.org/~cbbrowne/unix.html
Rules of the Evil Overlord #229. "If I have several diabolical schemes
to destroy the hero,  I will set all of them in  motion at once rather
than wait for them to fail and launch them successively."
<http://www.eviloverlord.com/>
From: ········@hex.net
Subject: Re: Lisp in Perl
Date: 
Message-ID: <4qZ77.26470$PA1.2799283@news20.bellglobal.com>
Fernando <···@wanadoo.es> writes:
> On Wed, 25 Jul 2001 19:28:13 GMT, ········@hex.net wrote:
>>···@conquest.OCF.Berkeley.EDU (Thomas F. Burdick) writes:
>>> ······@x-ray.at (Reini Urban) writes:
>>>> in reality I really wanted to do a big e-commerce project with
>>>> lisp. but the lack of libs and mature frameworks made me switch
>>>> to mod_perl and zope again. what a shame. if I had more time.

>>> I'm curious, what exactly did you find missing?

>>One of the things I _don't_ see supported in the Lisp frameworks
>>(IMHO leaps first to mind) is session support akin to the Java
>>HttpSession class, typically using cookies to track sessions.

> What about the trick that Paul Graham used (closures)?

I see it vaguely described in a presentation; that leaps out at me as
something "done by hand" as opposed to falling into the "libs and
mature frameworks" category.  

It's probably mature enough within the ViaWeb application, by now, but
that's of little help to me...
-- 
(reverse (concatenate 'string ····················@" "454aa"))
http://vip.hex.net/~cbbrowne/lsf.html
Rules of the Evil Overlord #122.  "The gun turrets on my fortress will
not  rotate enough  so that  they may  direct fire  inward or  at each
other. <http://www.eviloverlord.com/>
From: Barry Margolin
Subject: Re: Lisp in Perl
Date: 
Message-ID: <tlC97.15$TO3.98@burlma1-snr2>
In article <·······················@news20.bellglobal.com>,
 <········@hex.net> wrote:
>I see it vaguely described in a presentation; that leaps out at me as
>something "done by hand" as opposed to falling into the "libs and
>mature frameworks" category.  

Another poster mentioned not wanting Lisp to achieve "critical mass", since
that usually means lots of inferior programmers are using it.
Unfortunately, one problem with being a language for a small niche is that
there isn't as much supporting infrastructure.  While Perl originally
gained popularity because it made it easy to do quick-n-dirty hacks (it's
essentially a cross between C and shell scripting, with the pros and cons
of both), the CPAN library of modules is what has caused its use to grow
drastically.

It's a chicken-and-egg problem: programmers want a language with a large
library of reusable code, but that requires lots of programmers submitting
such code.  Perl achieved this because it was relatively painless for
C/shell programmers to switch to Perl and then start submitting entries,
whereas the rampup effort for Lisp to do the same would be quite
considerable.

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Reini Urban
Subject: Re: Lisp in Perl
Date: 
Message-ID: <3b66c087.87649763@news.tu-graz.ac.at>
Fernando wrote:
>What about the trick that Paul Graham used (closures)?

his closure trick uses a kind of formvar, which an index into a hash.
this hash evaluates at runtime in the new callers context. this was
needed for the GUI builder only.
most other better script language can do the same nowadays, but there
exist easier solutions.

Typically sessions need only a SID into a global hash (or external DB)
and a serializing function to store any data into this hash. then also a
cleanup for expired sessions.

This SID must be protected somehow to disallow changes at the client
side. It is very easy to change formvars or cookies. People try to break
into foreign baskets every day.
How the SID is transported (url, formvar, cookie) is not so important
than the security concerns. See the apache dragon book for details.
Like this if I remember it correctly: A SID consists of an
autoincremented int and various client specific pieces like
auth_username (optional), browser type (if available) and IP, crypted,
md5'ed and checked at the server, which needs only the int then.

lisp web frameworks don't offer that yet. (or did I miss it?)
marc battanyi's sid impl gave me this e.g.
https://www.fractalconcept.com/asp/sdataQ0jYZGrK$rxWDM__/sdataQonrZFvXCs3qnNcICX__
(note: /sdata twice)
-- 
Reini Urban
http://tv.mur.at/film/
From: Marc Battyani
Subject: Re: Lisp in Perl
Date: 
Message-ID: <87E5EA20F8FC9F7C.060377080A2C63F5.CA68C8DFA601979C@lp.airnews.net>
"Reini Urban" <······@x-ray.at> wrote in message
······················@news.tu-graz.ac.at...
> Fernando wrote:
> >What about the trick that Paul Graham used (closures)?
>
> his closure trick uses a kind of formvar, which an index into a hash.
> this hash evaluates at runtime in the new callers context. this was
> needed for the GUI builder only.
> most other better script language can do the same nowadays, but there
> exist easier solutions.
>
> Typically sessions need only a SID into a global hash (or external DB)
> and a serializing function to store any data into this hash. then also a
> cleanup for expired sessions.
>
> This SID must be protected somehow to disallow changes at the client
> side. It is very easy to change formvars or cookies. People try to break
> into foreign baskets every day.
> How the SID is transported (url, formvar, cookie) is not so important
> than the security concerns. See the apache dragon book for details.
> Like this if I remember it correctly: A SID consists of an
> autoincremented int and various client specific pieces like
> auth_username (optional), browser type (if available) and IP, crypted,
> md5'ed and checked at the server, which needs only the int then.
>
> lisp web frameworks don't offer that yet. (or did I miss it?)
> marc battanyi's sid impl gave me this e.g.
>
https://www.fractalconcept.com/asp/sdataQ0jYZGrK$rxWDM__/sdataQonrZFvXCs3qnN
cICX__
> (note: /sdata twice)

The sdata parts are crypted property lists.
(interface:decode-session-url
"https://www.fractalconcept.com/asp/sdataQ0jYZGrK$rxWDM__/sdataQonrZFvXCs3qn
NcICX__")
=> (:page "web-products" :session "loc9zjQQ")

The session ID is a random string, If I need a really bullet-proof session
ID, I can use the SSL session ID that is given by mod_lisp.

Marc
From: Reini Urban
Subject: Re: Lisp in Perl
Date: 
Message-ID: <9k13jt$89a$1@fstgss02.tu-graz.ac.at>
Thomas F. Burdick <···@conquest.ocf.berkeley.edu> wrote:
: ······@x-ray.at (Reini Urban) writes:

:> in reality I really wanted to do a big e-commerce project with lisp. but
:> the lack of libs and mature frameworks made me switch to mod_perl and
:> zope again. what a shame. if I had more time.

: I'm curious, what exactly did you find missing?

A lot: 

First the basics which are covered by cl-httpd and aserve only partially.
I also had to consider web hosting, and these tools need a lot of space (for
which I have to pay) and maintainance compared to mod_perl/php/zope which
are normally supported out of the box. security for multiple users on such
vhost farms is a big problem for php (no setuid) and mod_perl (not easy to
setup setuid), but not for zope (mature), and the lisp solutions
(standalone).

second the sheer mass of modules which I can use with mod_perl or zope out
of the box.

third the tested and mature franework to do web development. looking at zope
here: mod_perl based frameworks (mason, axkit, embperl) are not comparable
to zope. for php there are two such frameworks in development, binary cloud
and ariadne which look promising, but still need a year or so.

debugging is a good point for lisp compared to zope or even more to
mod_perl or php, where it is a nighmare.

I'd need a login manager class (cookie based | HTTP_AUTH | LDAP | NT |
self-made), session support (hidden input | url rewriting | server
supported), a lot of convenience classes for presentation and logic (which
are easy with lisp macros and the lisp way of on-the fly html generation)
good i18n support (ouch), S-MIME, SSL. Optionally mp3, COM, java and more.
The collaborative zope environment is a plus for hiring non-local
co-developers and designers.

SSL and more comes for free with mod_lisp or similar to nick levin's cgi
approach (fast-index.com) based on apache. also mod_proxy, url-rewriting,
mod_backhand and so on. but there's still a lot missing.

I know, it's all very trivial to write in lisp, but I in my very limited
timeframe I couldn't afford to invest in this, so I choose zope/python,
which is free, mature and easy to work with.

My last point are the XML based development tools. layout designers, with
which I have to deal with, typically use dreamweaver/golive/frontpage.  I
can create my logic with Zope Page Templates, kind of lisp macros, but use
a consistent XML syntax, so the designers cannot destroy the logic behind. I
cannot persuade them to switch over to emacs to handle the lisp based html
syntax, which would be more consistent and easier to work with for me.  
What a mess this XML is! And you all know what a HTML mess typical
sitebuilders produce. Converting such beasts to XHTML, seperating into
modules, encoding the logic into this mess and giving it back to the
"designer". hmm.

For a 6 months timeframe lisp would be perfect, but with zope I can design
and ship an ebay like portal in one month. I saw the very good ACL/CL-HTTPD
based sitebuilders used in various cities (city of new york parking
management?). cannot remember the url's right now. these are my dream, but
expensive.
-- 
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
From: Christophe Rhodes
Subject: Re: Lisp in Perl
Date: 
Message-ID: <sq66ch2qmf.fsf@lambda.jesus.cam.ac.uk>
······@x-ray.at (Reini Urban) writes:

> Fernando wrote:
> >My goodness, these Perl folks are trully amazing...  The only thing we need
> >now is the 'Inline Perl for Java', so we can call, from Perl, Java code that
> >calls Perl code, that... ;-D
> 
> don't be so cynical :)
> it might help lisp a lot if they eventually "get it".

It might. Then again, I personally wouldn't say that this is the best
possible use of time in improving lisp's facilities to do stuff; since
we have the benefit of a language that is robust, it seems a shame to
go out of our way to use it in a way that can't be...
 
> even python got closures and proper tail-recursion lately with their
> Stackless project (which was voted down to replace the old kernel in the
> actual 2.1 but maybe in 2.2?) these folks are much better than the perl
> folks. but the critical mass is with perl. so...

Critical mass, shmitical mass. Since lisp is so much more efficient,
surely the relatively smaller lisp community can achieve the same or
better than the Perl one? :-)

> in reality I really wanted to do a big e-commerce project with lisp. but
> the lack of libs and mature frameworks made me switch to mod_perl and
> zope again. what a shame. if I had more time.

Since behind this is probably `I was unwilling to pay a vendor to help
me implement my solution', do please consider becoming an active
member of the various community projects that seem to be out there
begging for volunteer effort...

Cheers,

Christophe
-- 
Jesus College, Cambridge, CB5 8BL                           +44 1223 510 299
http://www-jcsu.jesus.cam.ac.uk/~csr21/                  (defun pling-dollar 
(str schar arg) (first (last +))) (make-dispatch-macro-character #\! t)
(set-dispatch-macro-character #\! #\$ #'pling-dollar)
From: Arseny Slobodjuck
Subject: Re: Lisp in Perl
Date: 
Message-ID: <3b5ec4c5.1645446@news.vtc.ru>
On Tue, 24 Jul 2001 22:44:12 GMT, ······@x-ray.at (Reini Urban) wrote:

>>>Just found the Inline::Java perl module 
>>>  http://search.cpan.org/search?module=Inline::Java
>>>which binds Java functions, classes and namespaces to perl.
>>
>>My goodness, these Perl folks are trully amazing...  The only thing we need
>>now is the 'Inline Perl for Java', so we can call, from Perl, Java code that
>>calls Perl code, that... ;-D
>
>don't be so cynical :)
>it might help lisp a lot if they eventually "get it".
This is the road to hell... I often hear here a voices desiring a Lisp
become more popular, more than C++ or Perl or... Don't you think that
popularity may be dangerous for language purity and design ? Popular
things are not always the best things. Actually they always not the
best things. Let Lisp remains the language of code experts, not the
mass language.