Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Session state in web applications
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 126 - 150 of 162 - Collapse all  -  Translate all to Translated (View all originals) < Older  Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Kent M Pitman  
View profile  
 More options Jun 12 2001, 1:10 pm
Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: Tue, 12 Jun 2001 17:09:07 GMT
Local: Tues, Jun 12 2001 1:09 pm
Subject: Re: Session state in web applications

Perhaps they (either Java or CORBA or anything else that thinks
serialization can work reliably) take as axiomatic the idea that
serialization does or must work and consider that any data structure
you make that cannot be serialized is the error.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Barry Margolin  
View profile  
 More options Jun 12 2001, 1:31 pm
Newsgroups: comp.lang.lisp
From: Barry Margolin <bar...@genuity.net>
Date: Tue, 12 Jun 2001 17:31:02 GMT
Local: Tues, Jun 12 2001 1:31 pm
Subject: Re: Session state in web applications
In article <sfwn17d7hho....@world.std.com>,
Kent M Pitman  <pit...@world.std.com> wrote:

>Perhaps they (either Java or CORBA or anything else that thinks
>serialization can work reliably) take as axiomatic the idea that
>serialization does or must work and consider that any data structure
>you make that cannot be serialized is the error.

I think this is a likely case for any distributed data architecture.  It's
also pretty common in database architectures.  Rather than worrying about
object identity provided at the language level, data is often
self-identifying; for instance, in a banking application, the object
representing an account will include an account number slot, and a
relational database used to manage the accounts would probably declare this
as a unique index.

A serialization libary could be designed to know which slots in an instance
correspond to the unique index, and it could then automatically intern
objects in a hash table as it serializes them, and look them up when
reading them back in (this would be a good use of weak hash tables -- if
all other local references to the instance have been discarded, it doesn't
matter whether the reader returns a new object, as there's nothing to
compare EQL to).

--
Barry Margolin, bar...@genuity.net
Genuity, Burlington, 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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Jun 12 2001, 2:15 pm
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@tfeb.org>
Date: 12 Jun 2001 19:15:46 +0100
Local: Tues, Jun 12 2001 2:15 pm
Subject: Re: Session state in web applications
Kent M Pitman <pit...@world.std.com> writes:

> Perhaps they (either Java or CORBA or anything else that thinks
> serialization can work reliably) take as axiomatic the idea that
> serialization does or must work and consider that any data structure
> you make that cannot be serialized is the error.

Maybe they are even right, I'm not sure.  A system which does not rely
on object identity can scale to platforms - like shared-nothing
machines - where object identity is hard to maintain.  On the other
hand, at the platform level, shared-memory machines, which can
maintain identity at the this-points-to-that level, have pretty much
demolished non-shared-memory machines, so I guess *someone* cares.

Sometimes I think that Lisp people have a distorted view because we
use a lasnguage which is *so* good at dealing with enormous complex
datastructures, that we've been spoiled.  After all everything is a
string...

--tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Macro-writing in CL" by Kent M Pitman
Kent M Pitman  
View profile  
 More options Jun 12 2001, 2:31 pm
Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: Tue, 12 Jun 2001 18:29:51 GMT
Local: Tues, Jun 12 2001 2:29 pm
Subject: Re: Macro-writing in CL

Ray Blaak <bl...@infomatch.com> writes:
> Yes there is an echo. Sorry. That's what I get for too much speed reading of
> large Usenet feeds.

Heh, no sweat.

> Do you have some pointers discussing the Bawden "syntactic closure" route?

I don't.  Maybe a web search would find something. But I develoepd the
same concept for myself around the same time and never published
anything on it, so I can sketch what *I* meant; I'm pretty sure
Bawden's was similar.  The essential difference between in and
painting was to place the burden on the macro implementor for
"closing" certain terms.

In effect, what you want to do "conceptually" is
 (defmacro first (x) `(,#'car ,x))
That is, you want to grab the "meaning" of car and expand into that.
Since this doesn't work for special forms, you would probably really
need something like
 (defmacro first (x &environment env) `(,(meaning-of #'car env) ,x))
In that way,
 (first car) => (#<meaning-of #'car #<macro-env>> car)
and you don't get confusion.  It may feel a lot like painting, but it
does no tree-walking and no invasion of quoted structure. It also means
you could have a mention of meaning-of that was suppressed by quotation
until the right evaluation context.

There are various kinds of syntactic sugar you can put on this, like
having a code-walker that can turn
 `(car ,x)
into
 (list (meaning-of 'car env) x)
But this would again not walk quoted structure becuase it would want to
stop at quoted levels.

Yet another way for it to work is to have
 (defmacro first (x) `(car ,x))
receive as an argument not CAR
in the case of (FIRST CAR),
but instead a gensym or other special-typed object which was opaque
to the macro and which was, in effect, pre-painted.  In that way,
  `(car ,x) => (CAR #:FIRST-ARG-7383)
What this makes difficult is the building of macros that care about the
"shape" of the actual argument; you cannot have a macro system that
receives proxies as args instead of the real arg UNLESS you also have
a function on the proxy that returns the ACTUAL argument also, thus letting
you pierce the veil of abstraction if you want.

So you can see there are about a half-dozen different ways you can implement
this, but the basic idea is to allow programmer-managed resolution of the
name-closing instead of system-managed resolution.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Session state in web applications" by Lieven Marchand
Lieven Marchand  
View profile  
 More options Jun 12 2001, 4:24 pm
Newsgroups: comp.lang.lisp
From: Lieven Marchand <m...@wyrd.be>
Date: 12 Jun 2001 22:14:43 +0200
Local: Tues, Jun 12 2001 4:14 pm
Subject: Re: Session state in web applications

Tim Bradshaw <t...@tfeb.org> writes:
> I've always been terrified by this kind of thing.  Java makes
> serialisation claims, and I really have now idea what it does.  Either
> it does it wrong, or as far as I can see you need to keep something
> like an EQL hashtable of everything-you-have-ever-serialised and use
> that to maintain EQLness on the far side.  Which is expensive.

I think that's exactly what they do. A lot of the work on Java's RMI
came from Modula-3 and in the paper at
http://gatekeeper.dec.com/pub/DEC/SRC/research-reports/abstracts/src-...
you'll find a description of how this works. At page 10 you'll find
the algorithm used to do this serializing (or pickling in Modula-3
terminology). Research report 116 describes the distributed garbage
collection that allows objects to be gc-ed after all references on all
servers are gone.

--
Lieven Marchand <m...@wyrd.be>
Making laws appears to win votes. Enforcing them doesn't.
See Rule One.         Roger Burton West in the monastery.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paolo Amoroso  
View profile  
 More options Jun 13 2001, 6:03 am
Newsgroups: comp.lang.lisp
From: Paolo Amoroso <amor...@mclink.it>
Date: Wed, 13 Jun 2001 11:57:26 +0200
Local: Wed, Jun 13 2001 5:57 am
Subject: Re: Session state in web applications
On Tue, 12 Jun 2001 13:31:03 GMT, Kent M Pitman <pit...@world.std.com>
wrote:

> Anything strikes *me* as hard to serialize because Lisp is a language that
> cares about identity.  Just because you can make a new object doesn't mean

Hasn't Lisp been doing it right all the time with image dumping? :)

Paolo
--
EncyCMUCLopedia * Extensive collection of CMU Common Lisp documentation
http://cvs2.cons.org:8000/cmucl/doc/EncyCMUCLopedia/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Jun 13 2001, 6:19 am
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@tfeb.org>
Date: 13 Jun 2001 11:19:33 +0100
Local: Wed, Jun 13 2001 6:19 am
Subject: Re: Session state in web applications

Paolo Amoroso <amor...@mclink.it> writes:

> Hasn't Lisp been doing it right all the time with image dumping? :)

But image dumping is serialising the whole world, which is just what
you're trying to avoid when serialising a single object.

--tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alain Picard  
View profile  
 More options Jun 13 2001, 7:30 am
Newsgroups: comp.lang.lisp
From: Alain Picard <apic...@optushome.com.au>
Date: Wed, 13 Jun 2001 11:30:39 GMT
Local: Wed, Jun 13 2001 7:30 am
Subject: Re: Session state in web applications

Tim Bradshaw <t...@tfeb.org> writes:
> Kent M Pitman <pit...@world.std.com> writes:

> I suspect - like you perhaps - that object identity is not so much
> relied-on in some other languages.  Perhaps this is because
> object-ownership issues are so bad in a non-GCd language that it's
> less painful to copy things all the time.  Presumably this has
> persisted in java for cultural reasons...

> (a CORBA person is now going to explain how it solves all these
> problems at a stroke, I can feel it...)

I don't know if I'd call myself a "CORBA person", but, FWIW, I've
been using for a couple of years.  My take is CORBA solves this
by not solving it; i.e. you don't actually serialize the object;
you just pass a _reference_ to an object to another process.
But there's still only 1 object¹, in one image, somewhere, on 1
computer, which _is_ the object (the Servant, in CORBA terms).

There's this method is_equivalent (if memory serves right) that
you can call on any 2 corba references which pretty much means
what the lisp EQ means.

Or am I just adding to the confusion?  :-)

¹ Yes, I know that one servant can be made to mimic the identity
  of several corba objects, but that's just a distraction for this
  argument.

--
It would be difficult to construe        Larry Wall, in  article
this as a feature.                       <1995May29.062427.3...@netlabs.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Jun 13 2001, 9:53 am
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@tfeb.org>
Date: 13 Jun 2001 14:53:08 +0100
Local: Wed, Jun 13 2001 9:53 am
Subject: Re: Session state in web applications

Alain Picard <apic...@optushome.com.au> writes:
> I don't know if I'd call myself a "CORBA person", but, FWIW, I've
> been using for a couple of years.  My take is CORBA solves this
> by not solving it; i.e. you don't actually serialize the object;
> you just pass a _reference_ to an object to another process.
> But there's still only 1 object¹, in one image, somewhere, on 1
> computer, which _is_ the object (the Servant, in CORBA terms).

So this is kind of shared-memory at the application level?

--tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kent M Pitman  
View profile  
 More options Jun 13 2001, 10:54 am
Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: Wed, 13 Jun 2001 14:53:57 GMT
Local: Wed, Jun 13 2001 10:53 am
Subject: Re: Session state in web applications

Alain Picard <apic...@optushome.com.au> writes:
> I don't know if I'd call myself a "CORBA person", but, FWIW, I've
> been using for a couple of years.  My take is CORBA solves this
> by not solving it; i.e. you don't actually serialize the object;
> you just pass a _reference_ to an object to another process.
> But there's still only 1 object¹, in one image, somewhere, on 1
> computer, which _is_ the object (the Servant, in CORBA terms).

Good points, but ...

If the original discussion was about how to offload resources from one
machine to another, CORBA doesn't really do that, does it?  The IOR has
a pointer to machine and port and process, or some such, no?
[Disclaimer: I've not used CORBA myself; I just took a several day
seminar in its concepts.  I think I'm conversational in it, but please
do correct any confusions I might be displaying...]

I gather there is a migratable object substrate you can plug into CORBA
but... (1) does this require the server you're trying to free up to handle
forwarding service for this object? and (2) if you migrate the thing from
its normal home, you have to refer to all other CORBA objects it thought
were neighbors as  remote handles, which might need migration, too, right?
(3) And objects which are not addressed by IOR are assumed by "something you
have to arrange for migration of", right?  Which kind of begs the current
question, right?  Not to mention that even if you did migrate it, it might
take as much network traffic to do that (CORBA being pretty network
heavyweight) as it would take to finish out the burdensome pending request
for HTTP service that you were trying to quickly offload... no?

> There's this method is_equivalent (if memory serves right) that
> you can call on any 2 corba references which pretty much means
> what the lisp EQ means.

But CORBA does not forbid machine-native references within the actual
workerbee instance of the agent, right?  So it still is up against the
same question of "can this process migrate" unless it has built its
entire programming framework on corba objects, which I had understood to be
generally thought by CORBA users to be computationally too much overhead
for anyone to do.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Marsden  
View profile  
 More options Jun 13 2001, 1:15 pm
Newsgroups: comp.lang.lisp
From: Eric Marsden <emars...@mail.dotcom.fr>
Date: 13 Jun 2001 19:03:02 +0200
Local: Wed, Jun 13 2001 1:03 pm
Subject: Re: Session state in web applications

>>>>> "tb" == Tim Bradshaw <t...@tfeb.org> writes:
>>>>> "ap" == Alain Picard <apic...@optushome.com.au> writes:

  ap> My take is CORBA solves this by not solving it; i.e. you don't
  ap> actually serialize the object; you just pass a _reference_ to an
  ap> object to another process. But there's still only 1 object¹, in
  ap> one image, somewhere, on 1 computer, which _is_ the object (the
  ap> Servant, in CORBA terms).

  tb> So this is kind of shared-memory at the application level?

at the middleware level, rather. Apart from latency and failure
semantics, the fact that the invoked object is remote rather than
local is transparent to the application level.

--
Eric Marsden                          <URL:http://www.laas.fr/~emarsden/>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Marsden  
View profile  
 More options Jun 13 2001, 1:15 pm
Newsgroups: comp.lang.lisp
From: Eric Marsden <emars...@mail.dotcom.fr>
Date: 13 Jun 2001 19:02:48 +0200
Local: Wed, Jun 13 2001 1:02 pm
Subject: Re: Session state in web applications

>>>>> "kmp" == Kent M Pitman <pit...@world.std.com> writes:

  kmp> If the original discussion was about how to offload resources
  kmp> from one machine to another, CORBA doesn't really do that, does
  kmp> it? The IOR has a pointer to machine and port and process, or
  kmp> some such, no?

you can do simple load balancing at the time a client aquires the IOR,
from a naming or trading service. Once an IOR has been aquired, an
overloaded server can also redirect requests to another machine+port
using a LOCATION_FORWARD message. The tricky bit is the state transfer
between servants, which is done by the programmer (possibly assisted
by the persistent state service).

  kmp> But CORBA does not forbid machine-native references within the
  kmp> actual workerbee instance of the agent, right? So it still is
  kmp> up against the same question of "can this process migrate"

sure, CORBA doesn't magically make object migration transparent; the
degree of explicit programmer support will depend on the programming
language and operating system. In Lisp for example, how do you
serialize network connections? Are threads which were waiting on
semaphores restored correctly?

--
Eric Marsden                          <URL:http://www.laas.fr/~emarsden/>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Jun 13 2001, 1:46 pm
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@tfeb.org>
Date: 13 Jun 2001 18:46:14 +0100
Local: Wed, Jun 13 2001 1:46 pm
Subject: Re: Session state in web applications

Eric Marsden <emars...@mail.dotcom.fr> writes:

> at the middleware level, rather. Apart from latency and failure
> semantics, the fact that the invoked object is remote rather than
> local is transparent to the application level.

Sorry, I meant `application level' as meaning `not OS + hardware'.

--tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alain Picard  
View profile  
 More options Jun 14 2001, 7:17 am
Newsgroups: comp.lang.lisp
From: Alain Picard <apic...@optushome.com.au>
Date: Thu, 14 Jun 2001 11:17:05 GMT
Local: Thurs, Jun 14 2001 7:17 am
Subject: Re: Session state in web applications
Kent M Pitman <pit...@world.std.com> writes:

> If the original discussion was about how to offload resources from one
> machine to another, CORBA doesn't really do that, does it?

To my knowledge, it does not.

> The IOR has
> a pointer to machine and port and process, or some such, no?

Correct.

I think a very common paradigm is that a CORBA object really
reflects some state in a database somewhere.  So in overload
conditions, you might forward the request (as some other poster
mentioned) and the other server would be able to instantiate
a "copy" of the servant which pretends to have (or really has, depending
on your viewpoint) the same identity as the one you were trying
to talk to.

Which just punts on the hard issue: how do you replicate and
load share the database?  (Answer: you let your vendor do it).

To recapitulate: Lisp doesn't do proper serialization (with object
identity) because it's too hard; and CORBA doesn't do it either.
And I suspect, Kent, that your intuition is correct, Java (and Python,
actually) people *think* they do proper serialization because they're
not used to thinking of the identity of objects (the EQness) as lisp
people are.

Maybe "lisp provides EQ", "Java only gives you EQUALP" ?

--
It would be difficult to construe        Larry Wall, in  article
this as a feature.                       <1995May29.062427.3...@netlabs.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kent M Pitman  
View profile  
 More options Jun 14 2001, 8:58 am
Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: Thu, 14 Jun 2001 12:57:54 GMT
Local: Thurs, Jun 14 2001 8:57 am
Subject: Re: Session state in web applications

Alain Picard <apic...@optushome.com.au> writes:
> To recapitulate: Lisp doesn't do proper serialization (with object
> identity) because it's too hard; and CORBA doesn't do it either.
> And I suspect, Kent, that your intuition is correct, Java (and Python,
> actually) people *think* they do proper serialization because they're
> not used to thinking of the identity of objects (the EQness) as lisp
> people are.

> Maybe "lisp provides EQ", "Java only gives you EQUALP" ?

I think it's subtler than that.

Obviously Java passes pointers, even tagged ones, when it does
function call.  It's got EQ.  However, there's probably something in
the pain of type declaring that causes it not to be as densely
interconnected as Lisp is, and this probably results in
correspondingly less work in figuring out what to serialize.  I bet it
causes them to typically hold onto one "big" object with lots of parts
rather than a lot of little objects, so when they seralize it's fewer
things you have to make sure handle a "seralize" message.

It may also be that Java typically results in smaller and less complex
programs than Lisp does, giving up on the larger ones or quietly giving
up on serialization as a core technology of the larger ones.

Getting stats like any of these would be tough.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Macro-writing in CL" by Biep @ http://www.biep.org/
Biep @ http://www.biep.org/  
View profile  
 More options Jun 18 2001, 6:14 am
Newsgroups: comp.lang.lisp
From: "Biep @ http://www.biep.org/" <reply-...@my-web-site.com>
Date: Mon, 18 Jun 2001 12:14:13 +0200
Local: Mon, Jun 18 2001 6:14 am
Subject: Re: Macro-writing in CL
"David Thornley" <thorn...@visi.com> wrote in message

news:13bU6.10022$Dd5.2846360@ruti.visi.com...

> So, if you have an idea for a better way to write macros,
> or a better way to teach how to write macros, please tell us.

No, I think in CL macros should remain the way they are.  Standards should move
slowly, and the last word is definitely not yet out on macro writing.

There are a few changes I would argue for if there had been no standard as yet,
but then who hasn't :-)

The way of teaching that has worked best for me is:
- explain the basics,
- have people write a macro
- write a context in which the macro fails
- discuss.
- repeat the above till macros start being in shape.

I have found this to work better than the other way around (discussing the
pitfalls first).

Of course this does trigger the eternal question: but if Lisp is so much about
"the programmer shouldn't have to care" (as with memory management and the
like), then why do we have to care with all that here?

To which my answer is: research is still ongoing, and until it settles on a
clear plateau, it is no use changing the standard.
(Pointing to a few explorative implementations of different macro systems helps
here.  It helps people get a feeling of the issues that play.)

--
Biep
Reply via http://www.biep.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Biep @ http://www.biep.org/  
View profile  
 More options Jun 18 2001, 6:41 am
Newsgroups: comp.lang.lisp
From: "Biep @ http://www.biep.org/" <reply-...@my-web-site.com>
Date: Mon, 18 Jun 2001 12:40:35 +0200
Local: Mon, Jun 18 2001 6:40 am
Subject: Re: Macro-writing in CL
"Kent M Pitman" <pit...@world.std.com> wrote in message
news:sfwiti6s21e.fsf@world.std.com...
  [About name clashes in macros.]

> It might not be an all-or-none thing, but I think it can't be argued
> that the probabilities of collision are higher.

Yes, it is a difference of degree.
As far as I can fathom, the real problem is what RPG calls the "Worse is better"
vs. "The right thing".

I suppose no-one will seriously disagree with the statement that Scheme is more
in the "The right thing" camp, and CL in the "worse is better" camp.  Even a low
probability is wrong if it can be reduced to zero, and the programmer shouldn't
have to deal with that explicitly, a Schemer would argue.
The probability is pretty low to start with, the CL replies, it is even lower
because we have a second namespace, and to make it still lower we have
introduced a third namespace, packages.  (For a Schemer, these are basically
glorified let constructs, of course, so this is a partial implementation of
lexical scoping for macro variables.)

Oh, and you know this, of course, but probably some others don't: lexical
scoping and hygiene are two separate issues in macrology.

--
Biep
Reply via http://www.biep.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Frode Vatvedt Fjeld  
View profile  
 More options Jun 18 2001, 7:00 am
Newsgroups: comp.lang.lisp
From: Frode Vatvedt Fjeld <fro...@acm.org>
Date: 18 Jun 2001 12:51:10 +0200
Local: Mon, Jun 18 2001 6:51 am
Subject: Re: Macro-writing in CL
"Biep @ http://www.biep.org/" <reply-...@my-web-site.com> writes:

> I suppose no-one will seriously disagree with the statement that
> Scheme is more in the "The right thing" camp, and CL in the "worse
> is better" camp.

I don't think the "worse is better" argument applies here at all.

--
Frode Vatvedt Fjeld


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kent M Pitman  
View profile  
 More options Jun 18 2001, 7:12 am
Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: Mon, 18 Jun 2001 11:10:20 GMT
Local: Mon, Jun 18 2001 7:10 am
Subject: Re: Macro-writing in CL
"Biep @ http://www.biep.org/" <reply-...@my-web-site.com> writes:

> "David Thornley" <thorn...@visi.com> wrote in message
> news:13bU6.10022$Dd5.2846360@ruti.visi.com...
> > So, if you have an idea for a better way to write macros,
> > or a better way to teach how to write macros, please tell us.

> No, I think in CL macros should remain the way they are.  Standards
> should move slowly, and the last word is definitely not yet out on
> macro writing.

> There are a few changes I would argue for if there had been no
> standard as yet, but then who hasn't :-)

Such as?

> The way of teaching that has worked best for me is:
> - explain the basics,
> - have people write a macro
> - write a context in which the macro fails
> - discuss.
> - repeat the above till macros start being in shape.

There is no standard for teaching.

However, as I recall, some work in automated teaching the Open University
agrees with you at least to some extent, for programming in general.
I vaguely recall that they did some tests in how to explain programmer
errors to people.  As I recall, they found that saying "you have a
fencepost error", however nice that feels to an experienced programmer,
left the programmer confused.  I think, if I remember this right, the issue
is that for any new concept a user is struggling to use, the user is not
fluent in the terminology which precisely describes and bounds the issues
of that concept, so appealing to that terminology only begs the questions
they have, and adds little insight.  They found, I believe, that just saying
"Your program fails for the following input: ...", while less abstract, was
more reliably going to cause a lightbulb to go on in the new programmer's
head.

I would add as an aside that this is probably a restatement of the claim by,
I believe, Minsky, which goes something like "you can't learn a thing unless
you almost already know it".  You probably have to have seen the bug in
practice in order to really internalize a name for it.

> I have found this to work better than the other way around (discussing the
> pitfalls first).

Could be.  But this IS a statement about teaching technique, not language
definition, so is not at odds with anything in the language.

The language specification itself is not written to newbies.  It is only
a fortunate accident that as much of it as is readable is readable by newbies.
And while other people may name their books using names like "ANSI Common
Lisp", that doesn't mean they have an ANSI-approved teaching style.

> Of course this does trigger the eternal question: but if Lisp is so
> much about "the programmer shouldn't have to care" (as with memory
> management and the like), then why do we have to care with all that
> here?

I can make no sense of "all that" in this context.

Bernie Greenberg, at the MIT Multics Group, used to teach a course in
Lisp in which he used to always assert "a cons is an object that
cares".  But while programmers might not be supposed to care about GC
and might be supposed to feel warm and fuzzy about conses going around
caring for the things they point to, I don't think it would be
reasonable to generalize it to say "programmers must always care" or
"programmers must never care".

> To which my answer is: research is still ongoing, and until it settles on a
> clear plateau, it is no use changing the standard.

You've spoken only about teaching in this message, yet you have made
frequent use of the term "standard".  I see no relation, either in
practice nor any you've attempted to draw in the text.  I'll stop
short of drawing the perhaps-unwarranted conclusion that you are
confusing the standard with some teaching text or that you think there
can only be one way to teach it or that you think the standard somehow
inhibits the way it can be taught.

Instead I'll just ask: what's your point?

> (Pointing to a few explorative implementations of different macro
> systems helps here.  It helps people get a feeling of the issues
> that play.)

Implementations != languages.

Implementations don't decide languages.

Languages aren't decided on the basis of implementations.

One cannot have an "explorative implementation" of a language.
A language is a fixed thing.

One CAN explore the possibility of using a different language by allowing
an implementor to free him/herself of any concern about implementing any
particular language.

One CAN allow the implementor the freedom to believe it's their right or
responsibility to implement a macro system because someone forgot to.

But I think the truth is that there are several macro systems with pretty
well-defined semantics that each language shops among when choosing which,
if any, they will offer.  We can discuss the features of those in the
abstract, but we cannot discuss the efficacy of those in the abstract;
that is, we need to see how they work in the context of the language
environment where we might deploy them.  Consequently, you can't just point
to an "explorative implementation of a different macro system" unless
it's in an otherwise-CL  base and get really useful data about whether
that system would be good for CL.  The evaluation of what's good for CL should
be done  in the context of other features.

To do otherwise is to say "the arctic gets along fine without mosquitos,
so we should really try that in the rainforests of central america."  
Ecologies don't work that way.  And languages are ecologies.  Linguistic
features do not exist in isolation; they make other language features easier
and harder to get to, they aggravate problems or enhance strengths.  But the
way in which they do this is language/ecology-specific, not general to all
languages and all ecologies.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Biep @ http://www.biep.org/  
View profile  
 More options Jun 18 2001, 7:20 am
Newsgroups: comp.lang.lisp
From: "Biep @ http://www.biep.org/" <reply-...@my-web-site.com>
Date: Mon, 18 Jun 2001 13:19:55 +0200
Local: Mon, Jun 18 2001 7:19 am
Subject: Re: Macro-writing in CL
"Rob Warnock" <r...@rigden.engr.sgi.com> wrote in message

news:9g405e$fu98h$1@fido.engr.sgi.com...

> Schemers bind variable-bind "car" and "list", etc.,
> about as often as CL'ers FLET them -- practically never.

Except, of course, to change the meaning of the primitives (e.g. to install a
tracing version).

> (such as the above-mentioned inlining).

I think to a Schemer, inlining is something the compiler should worry about, and
cutting'n'pasting of code is "writing the same thing twice" -- an absolute no-no
in Scheme.  If you feel tempted to write the same code twice, refactor!

--
Biep
Reply via http://www.biep.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kent M Pitman  
View profile  
 More options Jun 18 2001, 7:24 am
Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: Mon, 18 Jun 2001 11:23:11 GMT
Local: Mon, Jun 18 2001 7:23 am
Subject: Re: Macro-writing in CL

Nope.

To get an independent point of view on this, I approached Jonathan
Rees.  I have known him personally for many years, and know him to be
both a competent CL programmer who understands "the CL way" and a
well-respected and competent Scheme programmer who understands "the
Scheme way".  He's also a stickler for proper programming aesthetics.

Here's the reply I got from him...

- - - - -

It's ridiculous to say that every Scheme programmer must memorize the
names of all Scheme builtins, just so that he can avoid using them for
his own purposes.  A very important goal was to make such memorization
or even knowledge unnecessary -- that's why the ability to redefine or
rebind the builtins is so carefully protected.  I know that I rebind
builtins often, and so does Sussman (he loves to rebind the arithmetic
operators); but I suppose neither of us is particularly "sane", so you
might want to take a broader poll to try to refute the claim about "no
sane Schemer".

Sussman articulated this idea from 1984 or earlier, and it is one
reason he refused to admit non-lexically-scoped macros to the language
-- he really wants to reserve the right to redefine anything at all,
including macros and special operators.  Hygiene solves the macro
redefinition problem, which is why he likes it.

It's unfortunate that the hygiene stuff has had such bad PR and poor
exposition - it and the pattern language both actually work (except
that I've never seen a happy escape syntax for use by macro-defining
macros).  I've recently put my Scheme of Things column on implementing
the hygiene part (not the pattern part) on line, by the way -- see
http://mumble.net/jar/pubs/.  If you combine hygiene with a module
system, you really don't need to keep track of internal details of
anyone else's code such as what names they define or bind.

And using macros for inlining is a big mistake.  You lose the ability
to trace, to easily pass as argument or return as result, and so on.
Scheme 48 has automatic cross-module inlining, so there are other ways
to achieve the same effect.

Scheme without a module system is a pain in the butt -- namespace
isolation is pretty important for building large systems.  I suppose
that you do have to exercise vigilance and write unnatural code if you
want to be able to combine subsystems written by different people (or
the same person at different times) in the same Lisp1 namespace.  I'm
glad I don't live in that world.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kent M Pitman  
View profile  
 More options Jun 18 2001, 7:29 am
Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: Mon, 18 Jun 2001 11:29:26 GMT
Local: Mon, Jun 18 2001 7:29 am
Subject: Re: Macro-writing in CL
"Biep @ http://www.biep.org/" <reply-...@my-web-site.com> writes:

> "Kent M Pitman" <pit...@world.std.com> wrote in message
> news:sfwiti6s21e.fsf@world.std.com...
>   [About name clashes in macros.]
> > It might not be an all-or-none thing, but I think it can't be argued
> > that the probabilities of collision are higher.

> Yes, it is a difference of degree.  As far as I can fathom, the real
> problem is what RPG calls the "Worse is better" vs. "The right
> thing".

Probably.  We mostly get beaten up for being called The Right Thing by
other languages, so it's refreshing to see we sometimes, even if only
relatively, employ the strategy touted to win in practice, rather than
only the one touted to lose in practice, as we are more commonly
accused of. :-)

> I suppose no-one will seriously disagree with the statement that
> Scheme is more in the "The right thing" camp, and CL in the "worse
> is better" camp.  Even a low probability is wrong if it can be
> reduced to zero, and the programmer shouldn't have to deal with that
> explicitly, a Schemer would argue.

Correctly written CL code has probability zero.  Not near zero.  IF
you follow the appropriate style guidelines, you do not risk a problem.
Period.

I agree there are ways you can use the operators to make trouble for
yourself, but those are just opportunities for tightening what is and
is not legal in a future standard.  (We have the independent problem
that the text of the standard needs not to be changed right now, for
economic reassons, because there is nothing sufficiently wrong with
it.  But it is practically sufficient to say "consult a style guide".)

> The probability is pretty low to start with, the CL replies, it is
> even lower because we have a second namespace, and to make it still
> lower we have introduced a third namespace, packages.  (For a
> Schemer, these are basically glorified let constructs, of course, so
> this is a partial implementation of lexical scoping for macro
> variables.)

The issues is not probilistic.

Probabilities were raised in an unrelated area.

> Oh, and you know this, of course, but probably some others don't: lexical
> scoping and hygiene are two separate issues in macrology.

But lexical scoping + namespacing + correct style is adequate to implement
reliable hygiene.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Biep @ http://www.biep.org/  
View profile  
 More options Jun 18 2001, 8:15 am
Newsgroups: comp.lang.lisp
From: "Biep @ http://www.biep.org/" <reply-...@my-web-site.com>
Date: Mon, 18 Jun 2001 14:14:26 +0200
Local: Mon, Jun 18 2001 8:14 am
Subject: Re: Macro-writing in CL
Yes, I think that our positions are actually very close, the main perceived
differences being linguistic rather than positional.

I look at a macro from a user point of view, because macros are written for
users.  I am under the impression that when a user calls a macro, <generic
inclusive> he generally has an idea of what the construct means rather than what
it does.  If I call the loop macro, I am telling the macro what it should do
with my data, not how it should transform what I tell it.  (The "telling" being
all the stuff I put in the macro call.)

If I am right in that supposition, what the macro system is providing (source
transformations) is not what people normally use it for (meaning
transformation).  That was the sense in which I used "fighting the system".

I expect it to be rare that a programmer, using (gensym) when writing a macro,
is actually interested in creating a nice fresh symbol.  Most of the time, what
he is really interested in (I presume) is that his variable doesn't clash.
Now luckily you can implement that behaviour in a sufficiently rich code
transformation system, but it is not the same thing, just like implementing a
call stack with local variable values is not the same thing as recursion.  The
one can implement the other, but it is an amount of extra work.

All I said originally was that this was the reason that some code was a bit more
complicated than people might at first thought expect - because you are
implementing things rather than simply using them.

This is of course no problem at all, because you can easily load a package with
tools that do this for you, so there we agree as well.  (My computer speaking
iX86 binary is no problem either, because I can install and run this nice CL -
life still has its rewards :-)

Se below for some replies to remarks of you.

--
Biep
Reply via http://www.biep.org

"Pierre R. Mai" <p...@acm.org> wrote in message
news:87elstsmkz.fsf@orion.bln.pmsf.de...

> Which is why I was surprised by your assertion that writing macros
> involves a lot of "fighting the system", which I take to mean that you
> have to circumvent _restrictions_ in the system to reach your goals.

O.K.  I hope I cleared that up

> If your claim were to be that the macro system itself provides too
> little guidance and support to the writer of "simple" syntactical
> convenience macros, I'd actually quite possibly agree.

It must be something with my English, because it feels as if everybody in this
newsgroup thinks I have some claim that something or other with CL is wrong.
Maybe standardising some simple safe system is useful, I am not sure.
I am always scary of adding something to a standard - it is quite hard to get
rid of later on.

> It is not a kludge, it is a lower-level tool, a building-block out of
> which the higher-level tool will be built.

O.K., I used "kludge" in the meaning of "parts that don't quite match at the
place where they meet" - the use vs. implementation discrepancy again.

> And since "problems" only occur when you break that contract, which
> requires direct action from you, this is a completely stable
> situation.  When you override the definition of #'cl:list, you have to
> expect the consequences.

Oh, with my CL mindset this is obvious.  But with my general Lisp mindset,
having such a contractual restriction in the first place is not completely
obvious.
But again: I definitely don't propose any change in the CL standard.  Maybe I am
sounding paranoid, but I have said this maybe about ten times now, and still at
times people seem to think I am proposing changes, or simply attacking CL, or
telling people to use another language.

> Not at all.  Fighting the system means having to work around
> restrictions in the system, in order to achieve the results intended.

Oh, that is a difference in semantics then.  For me it means "applying energy to
go one way whereas the natural inclination of the system would move me in
another way.  As in "fighting the Nazi army", or "fighting the current".  The
energy here being the explicit (gensym)s, etc.
Sorry for the misconception.

> BTW I don't think that your description of what the macro writer wants
> to is clearly defined.  The moment words like "MEAN" etc. crop up in a
> definition of what a system should enable, we enter the land of DWIM
> it seems to me.

I hope I did a bit better above.  "Mean" as in operational semantics of the
resulting program, "say" as in source transformation.

I kind of liked DWIM, by the way, even though it had a nasty habit of forgetting
a mistake just before I remade it..  :-(


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Biep @ http://www.biep.org/  
View profile  
 More options Jun 18 2001, 9:04 am
Newsgroups: comp.lang.lisp
From: "Biep @ http://www.biep.org/" <reply-...@my-web-site.com>
Date: Mon, 18 Jun 2001 15:02:53 +0200
Local: Mon, Jun 18 2001 9:02 am
Subject: Re: Macro-writing in CL
"Wade Humeniuk" <humen...@cadvision.com> wrote in message

news:9fua6j$sjo$1@news3.cadvision.com...

> You like it that Biep is starting to insult Erik
> and in an attempt to get him going?

On the contrary.  I made a mistake in replying to him (and probably now in
replying about him).  I spent a tedious discussion trying to find out how he
associates meanings with words and expressions, and besides long off-topic
ramblings all I got was ricochet name calling (Instead of saying "you are
retarded", saying "anybody who does that is retarded"  when he thinks I do
that).

In comp.org.lisp-users someone asked about Lisp versions, and (in line with the
FAQ of the ALU, whose group it is as far as I know), I mentioned CL and Scheme.
Erik took me to task for mentioning Scheme (for some reason this article has
dropped out of the thread on Google).  Here is the ensuing conversation:
http://groups.google.com/groups?hl=nl&lr=&newwindow=1&safe=off&ic=1&t...
34014a8,35.

While he made it abundantly clear that he does not consider Scheme a Lisp (in
the given context), I still don't know what grounds he uses in determining what
I (or the ALU, or the person asking the original question) should mean when
saying "a Lisp".

So I decided to ignore him - I love debating issues, but debating with someone
who can only deal with the person, and gets nervous when he doesn't know WHO it
was who said something simply doesn't interest me.

Kill files are a useful feature after all :-)

--
Biep
Reply via http://www.biep.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Biep @ http://www.biep.org/  
View profile  
 More options Jun 18 2001, 9:36 am
Newsgroups: comp.lang.lisp
From: "Biep @ http://www.biep.org/" <reply-...@my-web-site.com>
Date: Mon, 18 Jun 2001 15:35:24 +0200
Local: Mon, Jun 18 2001 9:35 am
Subject: Re: Macro-writing in CL
Kent, I know that you have disclaimed at some point that you don't read threads,
but in this case the relevant part of the thread is still in YOUR post even :-)

Mr. Thornley asked a double question
(1) If I have an idea for a better way to write macros, please tell us
--> To which my answer was:
    No, I think in CL macros should remain the way they are.
(2) If I have an idea for a better way to teach how to write macros, please tell
us
--> To which my answer was a short explanation of how I tend to teach CL macro
writing.

The two parts are different issues, addressing different parts of the double
question.
--
Biep
Reply via http://www.biep.org

"Kent M Pitman" <pit...@world.std.com> wrote in message
news:sfwg0cyt55v.fsf@world.std.com...

> "Biep @ http://www.biep.org/" <reply-...@my-web-site.com> writes:

> > "David Thornley" <thorn...@visi.com> wrote in message
> > news:13bU6.10022$Dd5.2846360@ruti.visi.com...
> > > So, if you have an idea for a better way to write macros,
> > > or a better way to teach how to write macros, please tell us.

> > No, I think in CL macros should remain the way they are.  Standards
> > should move slowly, and the last word is definitely not yet out on
> > macro writing.

> > There are a few changes I would argue for if there had been no
> > standard as yet, but then who hasn't :-)

> Such as?

I would argue for scoping rules within macros and outside of macros that are as
alike as possible, i.e. lexical scope as the default, but with the possibility
of special declarations.  This of course raises some name-space issues (special
variables having their own namespace outside of macros, whereas - in a
simplistic form of this proposal - special macro symbols would match lexical
items in other namespaces, but I am not going to start a discussion of that.  I
have already burned my fingers enough simply answering a question that I am not
going into a serious discussion of what I might have proposed if..

> There is no standard for teaching.

No, obviously..  Did anyone suggest there is one?
Sorry, I cannot connect this remark to anything else in a meaningful way..

> > I have found this to work better than the other way around (discussing the
> > pitfalls first).

> Could be.  But this IS a statement about teaching technique, not language
> definition, so is not at odds with anything in the language.

Indeed. See above.

> The language specification itself is not written to newbies.  [etc.]

I suppose the remainder of your message is a result of the misunderstanding I
tried to clear up above, so I'll refrain from commenting on it.  If I am wrong,
I'll no doubt hear it..  :-)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 126 - 150 of 162 < Older  Newer >
« Back to Discussions « Newer topic     Older topic »