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
Question on using Scheme on Large Projects
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 101 - 125 of 152 - 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
 
Paolo Amoroso  
View profile  
 More options Aug 1 2002, 10:33 am
Newsgroups: comp.lang.lisp
From: Paolo Amoroso <amor...@mclink.it>
Date: Thu, 01 Aug 2002 16:14:03 +0200
Local: Thurs, Aug 1 2002 10:14 am
Subject: Re: Question on using Scheme on Large Projects
On 30 Jul 2002 20:45:27 GMT, Christopher Browne <cbbro...@acm.org> wrote:

>   - CL has CLIM, which I've never seen running, whilst it is common

In case you are interested, have a look at McCLIM, which has been doing a
lot of progress lately.

Paolo
--
EncyCMUCLopedia * Extensive collection of CMU Common Lisp documentation
http://www.paoloamoroso.it/ency/README


 
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.
Stephen J. Bevan  
View profile  
 More options Aug 1 2002, 10:35 am
Newsgroups: comp.lang.lisp
From: step...@dino.dnsalias.com (Stephen J. Bevan)
Date: Thu, 01 Aug 2002 14:35:58 GMT
Local: Thurs, Aug 1 2002 10:35 am
Subject: Re: Question on using Scheme on Large Projects

I agree.  However, that is a separate issue to the one I was addressing.

 
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.
Christopher Browne  
View profile  
 More options Aug 2 2002, 7:04 pm
Newsgroups: comp.lang.lisp
From: Christopher Browne <cbbro...@acm.org>
Date: 2 Aug 2002 23:04:40 GMT
Local: Fri, Aug 2 2002 7:04 pm
Subject: Re: Question on using Scheme on Large Projects
The world rejoiced as Marco Antoniotti <marc...@cs.nyu.edu> wrote:

SICP doesn't comment on continuations, either, so I would not be
particularly inclined to draw many conclusions.

As far as I can see, the purpose of SICP is to use a pretty limited
subset of Scheme to teach about computer science.

A message that rings out pretty clearly is that the fact that so much
can be taught with so few abstractions.  Note that it never mentions
arrays, or "structures/records," either.

Its main commentary on OO is actually fairly cautionary, in a footnote
that warns that OO isn't nearly what it's billed to be.

>>  >> In scheme, objects are just regular functions -- I don't see why you
>>  >> can't create them (or use an already created object system)

>>  MA> Exactly my point.  Move over to Common Lisp, use "an already
>>  MA> created object system" and be done with it.

>> Or use one of the implementations provided by:
>> http://www.cs.indiana.edu/scheme-repository/code.oop.html
>> or
>> http://www.swiss.ai.mit.edu/~jaffer/slib_toc.html
> Sorry.  It ain't in R^nRS, it ain't in Scheme.  If you use one of
> the above you are using your SIDJ. (I know `slib' - a subset of what
> is already in CL - is relatively portable).

If it's in an accepted SRFI, then it's an at least moderately portable
extension.

>> I'm not suggesting you should. I'm just suggesting that saying that
>> you can't use objects is in Scheme is a silly thing to say and
>> untrue. You might not like the object systems, but they do exist.

> I am not questioning the existence of N different object systems in
> your SIDJ.  I am questioning the use of a language that forces you
> to re-implement - unportably - every single bit that you already
> have - portably - in CL.

Entertainingly enough, most of the MOP implementations in use in
Scheme have, as one of the co-authors, one of the co-authors of _The
Art of the Meta Object Protocol_.

There _are_ multiple implementations, much as there are CLOS
implementations that don't conform to MOP.  Many of the object
implementations are based on the same code base, much as many CLOS
implementations are based on PCL.

Is it all joy and perfection?  Things seldom are.  The graphics
options for CL have a tendancy to be painful to make work, too.  No
easy answers...
--
(concatenate 'string "cbbrowne" "@acm.org")
http://www.ntlug.org/~cbbrowne/rdbms.html
"...Deep   Hack  Mode--that  mysterious   and  frightening   state  of
consciousness where Mortal Users fear to tread." -- Matt Welsh


 
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.
Christopher Browne  
View profile  
 More options Aug 2 2002, 7:04 pm
Newsgroups: comp.lang.lisp
From: Christopher Browne <cbbro...@acm.org>
Date: 2 Aug 2002 23:04:43 GMT
Local: Fri, Aug 2 2002 7:04 pm
Subject: Re: Question on using Scheme on Large Projects

But you sure seem to be pointing at it as an example of "all that is
in Scheme."

If anything, it uses a _faint_ subset of Scheme: one that makes R*RS
look _powerful_.  No strings, no macros, no call/cc, no arrays, no
syntax-lists, no, well, "lots of things."

>> It doesn't mention call/cc either, but this is not because the
>> authors of SICP think call/cc is unimportant.

> Sure.  I agree.

--
(reverse (concatenate 'string "gro.gultn@" "enworbbc"))
http://www3.sympatico.ca/cbbrowne/multiplexor.html
Rules of the Evil Overlord #114. "I will never accept a challenge from
the hero." <http://www.eviloverlord.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.
Thomas Bushnell, BSG  
View profile  
 More options Aug 3 2002, 4:30 pm
Newsgroups: comp.lang.lisp
From: tb+use...@becket.net (Thomas Bushnell, BSG)
Date: 03 Aug 2002 13:31:45 -0700
Local: Sat, Aug 3 2002 4:31 pm
Subject: Re: Question on using Scheme on Large Projects

Christopher Browne <cbbro...@acm.org> writes:
> If anything, it uses a _faint_ subset of Scheme: one that makes R*RS
> look _powerful_.  No strings, no macros, no call/cc, no arrays, no
> syntax-lists, no, well, "lots of things."

Indeed!  One of the underlying foundations of CS education at MIT is
that CS education is *not* about teaching languages.

There's a saying there: "Pascal is a useful language for only one
thing: teaching Pascal."  The point of 6.001 is not to teach Scheme,
it's to teach programming.  Scheme is a good language (surely not the
only one, of course) in which the language can get out of the damn way
and the student can learn something about computer programs.


 
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.
Matthias Blume  
View profile  
 More options Aug 15 2002, 8:23 am
Newsgroups: comp.lang.lisp
From: Matthias Blume <matth...@shimizu-blume.com>
Date: 15 Aug 2002 08:05:27 -0400
Local: Thurs, Aug 15 2002 8:05 am
Subject: Re: Question on using Scheme on Large Projects

Sorry, Erann, but I highly doubt that a definition of this phrase good
enough to stand up to the rigor of PL semantics can be found in
Webster's.

The fact is that it is highly unspecified under which conditions
memory "returned" to the allocator via "free" will be dished out again
by a subsequent allocation.  An allocator that makes memory
"avaliable" but then "chooses" to always return fresh memory anyway,
ignoring all that "available" memory returned via "free", would
probably not violate the letter (although perhaps the spirit) of the C
standard.


 
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.
Matthias Blume  
View profile  
 More options Aug 15 2002, 8:23 am
Newsgroups: comp.lang.lisp
From: Matthias Blume <matth...@shimizu-blume.com>
Date: 15 Aug 2002 08:10:08 -0400
Local: Thurs, Aug 15 2002 8:10 am
Subject: Re: Question on using Scheme on Large Projects

Sure.  But this does not mean that the above paragraph says "more than
nothing".  It simply means that the C standard seems to rely on
unwritten assumptions on what would be a "worst possible"
implementation.  In fact, I can think of many things that would make a
C implementation even worse, so just ruling out "worst possible" would
not nail down what "free" has to do.  Or are you saying that the
authors of the C standard generally assume the "best possible C
compiler permitted by the spec"?  I didn't think so.

>  For the same reason, it is unnecessary to mention that a Lisp
> implementation better had a garbage collector.  IIRC, The Definition
> of Standard ML doesn't make that requirement, either.

That is right.  And some ML implementations get away with having (well
almost) no garbage collector.  (They are not the worst either.)

 
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.
Nils Goesche  
View profile  
 More options Aug 15 2002, 10:00 am
Newsgroups: comp.lang.lisp
From: Nils Goesche <car...@cartan.de>
Date: 15 Aug 2002 16:00:47 +0200
Local: Thurs, Aug 15 2002 10:00 am
Subject: Re: Question on using Scheme on Large Projects

That's right.  It does not even try to be a mathematical document with
mathematical rigor as, e.g. the ML definition.  There are lots of
questions about C you could ask that not even the people in comp.std.c
are able to give a definite answer to (or at least agree on one ;-).
It just isn't written for mathematicians who haven't learned that
there are compromises in the real world.  Rather, if the next C
standard was written in DS, I'd expect people other than you or me who
like to read such things to become very upset :-) (And I guess I
wouldn't like it, either.  Mathematically defining this complicated
language would probably be much too wordy).

You can have very long debates about whether an expression like

  p = p->q = NULL;

invokes undefined behavior or not, but C programmers don't really
care, nor do implementors, nor do I: You do something reasonable, with
the standard as a guide.  I'd see at first glance that this expression
is somewhat questionable, so, as a programmer, I'd not use it.  As an
implementor, I'd make it work, anyway.  Debating about whether the
standard explicitly allows or disallows this is a funny recreational
exercise, but not more.  There will always be questions like this
(about C).

> In fact, I can think of many things that would make a C
> implementation even worse, so just ruling out "worst possible" would
> not nail down what "free" has to do.  Or are you saying that the
> authors of the C standard generally assume the "best possible C
> compiler permitted by the spec"?  I didn't think so.

No, but they assume ``something reasonable'', I'd say :-)

> >  For the same reason, it is unnecessary to mention that a Lisp
> > implementation better had a garbage collector.  IIRC, The Definition
> > of Standard ML doesn't make that requirement, either.

> That is right.  And some ML implementations get away with having (well
> almost) no garbage collector.  (They are not the worst either.)

Let's say they're almost lacking :-)

Regards,
--
Nils Goesche
"Don't ask for whom the <CTRL-G> tolls."

PGP key ID 0x42B32FC9


 
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 "Standards and deliberately silly implementation (was Re: Question on using Scheme on Large Projects)" by Michael Sullivan
Michael Sullivan  
View profile  
 More options Aug 15 2002, 10:50 am
Newsgroups: comp.lang.lisp
From: mich...@bcect.com (Michael Sullivan)
Date: Thu, 15 Aug 2002 10:21:35 -0400
Local: Thurs, Aug 15 2002 10:21 am
Subject: Standards and deliberately silly implementation (was Re: Question on using Scheme on Large Projects)

Nils Goesche <car...@cartan.de> wrote:
> You can have very long debates about whether an expression like
>   p = p->q = NULL;
> invokes undefined behavior or not, but C programmers don't really
> care, nor do implementors, nor do I: You do something reasonable, with
> the standard as a guide.  I'd see at first glance that this expression
> is somewhat questionable, so, as a programmer, I'd not use it.  As an
> implementor, I'd make it work, anyway.  Debating about whether the
> standard explicitly allows or disallows this is a funny recreational
> exercise, but not more.  There will always be questions like this
> (about C).

Personally, I have this odd little morbid fantasy about a C compiler
that actually inserts code to dial the red phone any time unquestionably
undefined behavior is invoked.

Michael, "I don't think you should do that, Dave"

--
Michael Sullivan
Business Card Express of CT             Thermographers to the Trade
Cheshire, CT                                      mich...@bcect.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.
Christopher Browne  
View profile  
 More options Aug 15 2002, 12:16 pm
Newsgroups: comp.lang.lisp
From: Christopher Browne <cbbro...@acm.org>
Date: 15 Aug 2002 16:16:28 GMT
Local: Thurs, Aug 15 2002 12:16 pm
Subject: Re: Standards and deliberately silly implementation (was Re: Question on using Scheme on Large Projects)
In an attempt to throw the authorities off his trail, mich...@bcect.com (Michael Sullivan) transmitted:

I always like to point out the "electrodes in somebody's chair"
scenario, myself.

It doesn't have to be a _big_ shock; it doesn't much matter who it is
that _gets_ shocked, whether the programmer, user, some manager, or a
cute furry bunny sitting in a cage.  None are likely to be
particularly palatable.

I normally bring up the scenario in a design meeting, when someone
says "that'll never happen" about some condition that I notice.  

  "OK, if that condition can't happen, then it's OK for me to put code
   in that does absolutely heinous things if it does, right?"

They usually back off, at that point...
--
(concatenate 'string "chris" "@cbbrowne.com")
http://www3.sympatico.ca/cbbrowne/nonrdbms.html
Rules of the Evil Overlord #173. "Although it would provide amusement,
I  will not  confess  to  the hero's  rival  that I  was  the one  who
committed the heinous act for which he blames the hero."
<http://www.eviloverlord.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.
Discussion subject changed to "Question on using Scheme on Large Projects" by Tim Bradshaw
Tim Bradshaw  
View profile  
 More options Aug 15 2002, 5:17 pm
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@cley.com>
Date: 15 Aug 2002 21:56:09 +0100
Local: Thurs, Aug 15 2002 4:56 pm
Subject: Re: Question on using Scheme on Large Projects

* Matthias Blume wrote:
> Or are you saying that the
> authors of the C standard generally assume the "best possible C
> compiler permitted by the spec"?  I didn't think so.

No, however they probably assume that a number of implementations will
appear and the ones that are obviously crappy will either die out or
get better.  Curiously that is what seems to happen in practice, as
anyone who compares, say, gcc, with some of (all of?) the pcc variants
will tell you.

--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.
Erann Gat  
View profile  
 More options Aug 15 2002, 5:56 pm
Newsgroups: comp.lang.lisp
From: g...@jpl.nasa.gov (Erann Gat)
Date: Thu, 15 Aug 2002 14:16:56 -0700
Local: Thurs, Aug 15 2002 5:16 pm
Subject: Re: Question on using Scheme on Large Projects
In article <m365ycfhtk....@hana.shimizu-blume.com>, Matthias Blume

<matth...@shimizu-blume.com> wrote:

[xnip]

> > > Where does it say what it means to be "available for allocation"?

> > In Webster's dictionary, among others.

> Sorry, Erann, but I highly doubt that a definition of this phrase good
> enough to stand up to the rigor of PL semantics can be found in
> Webster's.

Sorry, Matthias, but your doubt is irrelevant.  Whenever you write
anything in English (as the C standard is) the semantics bottom out in the
dictionary.  You may not like it, but that's the way it is.

> The fact is that it is highly unspecified under which conditions
> memory "returned" to the allocator via "free" will be dished out again
> by a subsequent allocation.  An allocator that makes memory
> "avaliable" but then "chooses" to always return fresh memory anyway,
> ignoring all that "available" memory returned via "free", would
> probably not violate the letter (although perhaps the spirit) of the C
> standard.

Unless you have an infinite amount of memory it would violate both the
letter and the spirit, because it would eventually run out of fresh
memory, at which point it would have no choice but to allocate free'd
memory.  If it didn't then that memory would not be "available", in
violation of the standard.

There is nothing in either the letter of the spirit of the standard that
requires the following function to return 1:

int f() {
  void * p1 = malloc(10);
  free(p1);
  void * p2 = malloc(10);
  return p1 == p2;

}

but both the letter and the spirit of the standard require this snippet to
run forever (assuming no multiprocessing):

void f() {
  void *p;
  while (1) {
    p = malloc(10);
    if (!p) return;
    free(p);
  }

}

E.

 
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.
Hartmann Schaffer  
View profile  
 More options Aug 15 2002, 8:59 pm
Newsgroups: comp.lang.lisp
From: h...@heaven.nirvananet (Hartmann Schaffer)
Date: 15 Aug 2002 20:59:10 -0400
Local: Thurs, Aug 15 2002 8:59 pm
Subject: Re: Question on using Scheme on Large Projects
In article <gat-1508021417410...@192.168.1.52>,
        g...@jpl.nasa.gov (Erann Gat) writes:

> ...
> Unless you have an infinite amount of memory it would violate both the
> letter and the spirit, because it would eventually run out of fresh
> memory, at which point it would have no choice but to allocate free'd
> memory.  If it didn't then that memory would not be "available", in
> violation of the standard.

in that case any implementation of malloc/free that doesn't include a
compacting garbage collector violates both the letter and the spirit
of the C standard

> ...
> but both the letter and the spirit of the standard require this snippet to
> run forever (assuming no multiprocessing):

> void f() {
>   void *p;
>   while (1) {
>     p = malloc(10);
>     if (!p) return;
>     free(p);
>   }
> }

now try

void f( ) {
  void *p1, *p2;

  for( ; ; ) {
    p1= malloc(10);
    p2= malloc(15);
    free(p1);
    if(!p) return; }

will run out of memory at a point when almost half the available
memory is still free

hs

--

don't use malice as an explanation when stupidity suffices


 
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 Aug 15 2002, 9:33 pm
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@cley.com>
Date: 16 Aug 2002 02:32:48 +0100
Local: Thurs, Aug 15 2002 9:32 pm
Subject: Re: Question on using Scheme on Large Projects

* Hartmann Schaffer wrote:
> void f( ) {
>   void *p1, *p2;
>   for( ; ; ) {
>     p1= malloc(10);
>     p2= malloc(15);
>     free(p1);
>     if(!p) return; }
> will run out of memory at a point when almost half the available
> memory is still free

If you have an allocator which allocates sequentially, it might, yes
(assuming !p is !p2). If you have an allocator which, for instance,
allocates chunks of 10 or smaller from 0 and ones of 11 or higher from
high memory, this will not be true.  In other words, don't be silly.

--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.
Erann Gat  
View profile  
 More options Aug 15 2002, 9:57 pm
Newsgroups: comp.lang.lisp
From: g...@jpl.nasa.gov (Erann Gat)
Date: Thu, 15 Aug 2002 18:45:16 -0700
Local: Thurs, Aug 15 2002 9:45 pm
Subject: Re: Question on using Scheme on Large Projects
In article <3d5c4...@news.sentex.net>, h...@heaven.nirvananet (Hartmann

Schaffer) wrote:
> In article <gat-1508021417410...@192.168.1.52>,
>         g...@jpl.nasa.gov (Erann Gat) writes:
> > ...
> > Unless you have an infinite amount of memory it would violate both the
> > letter and the spirit, because it would eventually run out of fresh
> > memory, at which point it would have no choice but to allocate free'd
> > memory.  If it didn't then that memory would not be "available", in
> > violation of the standard.

> in that case any implementation of malloc/free that doesn't include a
> compacting garbage collector violates both the letter and the spirit
> of the C standard

[Code snipped]

No.  This is just an oblique way of saying that C suffers from heap
fragmentation, which is not news.  All those freed 10-byte memory blocks
are (or at least should be per the standard) still "available" to fill
requests of size <= 10.

> don't use malice as an explanation when stupidity suffices

OK.

E.


 
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.
Matthias Blume  
View profile  
 More options Aug 16 2002, 12:02 am
Newsgroups: comp.lang.lisp
From: Matthias Blume <matth...@shimizu-blume.com>
Date: 16 Aug 2002 00:02:14 -0400
Local: Fri, Aug 16 2002 12:02 am
Subject: Re: Question on using Scheme on Large Projects

That's the problem with all semantics that are being specified in
English: they are inherently ambiguous.

> > The fact is that it is highly unspecified under which conditions
> > memory "returned" to the allocator via "free" will be dished out again
> > by a subsequent allocation.  An allocator that makes memory
> > "avaliable" but then "chooses" to always return fresh memory anyway,
> > ignoring all that "available" memory returned via "free", would
> > probably not violate the letter (although perhaps the spirit) of the C
> > standard.

> Unless you have an infinite amount of memory it would violate both the
> letter and the spirit, because it would eventually run out of fresh
> memory, at which point it would have no choice but to allocate free'd
> memory.  If it didn't then that memory would not be "available", in
> violation of the standard.

That it false.  "Available" could also mean that there is at least one
allocation/deallocation sequence that causes the memory in question to
be reused for allocation.  But that one sequence does not have to be
any of the ones that your program uses.  In fact, there are many C
programs that will eventually run out of memory using typical
malloc/free implementations even though the malloc request that ends
up failing asks for no more memory than what is currently "available".
In fact, in typical flat address spaces, allocation of n bytes can fail
even though Omega(n^2) bytes are "available". (Work it out!)

> There is nothing in either the letter of the spirit of the standard that
> requires the following function to return 1:

> int f() {
>   void * p1 = malloc(10);
>   free(p1);
>   void * p2 = malloc(10);
>   return p1 == p2;
> }

IIRC, this program is in violation of the standard.

> but both the letter and the spirit of the standard require this snippet to
> run forever (assuming no multiprocessing):
> void f() {
>   void *p;
>   while (1) {
>     p = malloc(10);
>     if (!p) return;
>     free(p);
>   }
> }

> E.

I very highly doubt that the letter of the standard requires this.
(Otherwise, prove it!)

Matthias


 
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.
Matthias Blume  
View profile  
 More options Aug 16 2002, 12:04 am
Newsgroups: comp.lang.lisp
From: Matthias Blume <matth...@shimizu-blume.com>
Date: 16 Aug 2002 00:03:35 -0400
Local: Fri, Aug 16 2002 12:03 am
Subject: Re: Question on using Scheme on Large Projects

But Hartmann's first allocator is certainly a valid one according to
the C standard.  So what's your point?

 
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 Aug 16 2002, 6:34 am
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@cley.com>
Date: 16 Aug 2002 10:19:01 +0100
Local: Fri, Aug 16 2002 5:19 am
Subject: Re: Question on using Scheme on Large Projects

* Matthias Blume wrote:
> But Hartmann's first allocator is certainly a valid one according to
> the C standard.  So what's your point?

He said `... will run out of memory at a point ...' when he should
have said either `... might run out of memory at a point ...' or
`assuming an allocator with the following characteristics ... this
program will run out of memory at a point ...'.  So his statement was
just false as it stood.

I'm beginning to think that cll has been invaded by aliens.  Are you
small and green with aerials on your head?

--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.
Daniel Barlow  
View profile  
 More options Aug 16 2002, 7:14 am
Newsgroups: comp.lang.lisp
From: Daniel Barlow <d...@telent.net>
Date: Fri, 16 Aug 2002 01:20:13 +0100
Local: Thurs, Aug 15 2002 8:20 pm
Subject: Re: Question on using Scheme on Large Projects

Matthias Blume <matth...@shimizu-blume.com> writes:
> by a subsequent allocation.  An allocator that makes memory
> "avaliable" but then "chooses" to always return fresh memory anyway,
> ignoring all that "available" memory returned via "free", would
> probably not violate the letter (although perhaps the spirit) of the C
> standard.

Possibly not even the spirit.  On a machine that supports virtual
memory, we could malloc, free, then malloc again and get what looks
like fresh storage (at a different virtual address) that came from the
same physical bank of chips that we were previously using.  The
program would have no way to tell it wasn't fresh, and we're still not
"leaking memory in free"

For that matter, suppose malloc() calls mmap() and free() calls
munmap().  Chances are that everything you allocate will the same
physical pageful of zeroes anyway until you start wriing to it.  How
do you tell whether this is happening?  Why do you need to?

I am deliberately ignoring the additional fun that can be had here
from considering the effects of a hierarchical memory system (cache,
dram, disk-based vm).  Exercise for the reader ...

-dan

--

  http://ww.telent.net/cliki/ - Link farm for free CL-on-Unix resources


 
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.
Nils Goesche  
View profile  
 More options Aug 16 2002, 10:47 am
Newsgroups: comp.lang.lisp
From: Nils Goesche <car...@cartan.de>
Date: 16 Aug 2002 16:47:14 +0200
Local: Fri, Aug 16 2002 10:47 am
Subject: Re: Question on using Scheme on Large Projects

Yes, that's right.  But it doesn't matter.

> > Unless you have an infinite amount of memory it would violate both the
> > letter and the spirit, because it would eventually run out of fresh
> > memory, at which point it would have no choice but to allocate free'd
> > memory.  If it didn't then that memory would not be "available", in
> > violation of the standard.

> That it false.  "Available" could also mean that there is at least one
> allocation/deallocation sequence that causes the memory in question to
> be reused for allocation.  But that one sequence does not have to be
> any of the ones that your program uses.  In fact, there are many C
> programs that will eventually run out of memory using typical
> malloc/free implementations even though the malloc request that ends
> up failing asks for no more memory than what is currently "available".
> In fact, in typical flat address spaces, allocation of n bytes can fail
> even though Omega(n^2) bytes are "available". (Work it out!)

That's right, too.  But it doesn't matter, either.

> > There is nothing in either the letter of the spirit of the standard that
> > requires the following function to return 1:

> > int f() {
> >   void * p1 = malloc(10);
> >   free(p1);
> >   void * p2 = malloc(10);
> >   return p1 == p2;
> > }

> IIRC, this program is in violation of the standard.

That's right, too, and it does matter :-) In this case, it is pretty
easy to derive from the standard that the behavior of return p1 == p2;
is undefined (although this statement sounds somewhat funny).

> > but both the letter and the spirit of the standard require this snippet to
> > run forever (assuming no multiprocessing):
> > void f() {
> >   void *p;
> >   while (1) {
> >     p = malloc(10);
> >     if (!p) return;
> >     free(p);
> >   }
> > }

> I very highly doubt that the letter of the standard requires this.
> (Otherwise, prove it!)

You're right, it doesn't require it, but it doesn't matter again.

You can't use the standard quotation in question to derive definite
answers like this, that's right.  But that doesn't mean that the
snippet is meaningless.

You remind me of a mathematician reading a physics textbook or paper
with the eyes of a mathematician.  Whenever he sees that some
physicist differentiates a function, his first thought is ``where did
he say this function is differentiable?''.  When the physicist
differentiates again, he asks ``where did he say it was even C^2''?
If the physicist computes the Fourier transform of a function he asks
``Wow, there are a million different spaces with a Fourier transform,
which one is he using?  Jeez, now he is assuming the inverse
transformation can be applied; what a freak.  Is he working in L^2?
Ah, apparently he thinks he can exchange the limes and the integral
sign.  Enough now, I'll write him a letter explaining in all detail
why all of his theories stink, and will make sure to provide him with
counterexamples for /every single step/ he does in this paper!  That
will teach him a lesson!''

Unfortunately, the physicist will not appreciate the helpful letter.
Actually, there is no problem at all with the physicist's
mathematics.  There /is/ a problem with the understanding of our
/mathematician/, who hasn't understood that this physicist is not
doing mathematics but physics.  His /objectives/ are totally
different.  Using mathematics is only a means for him to achieve his
real goal, which is to derive statements about the real world.  Of
course he is aware of the fact that mathematicians can come up with
freaky counterexamples for lots of things, but his pragmatic reply is:

``Jeez, just make some _reasonable assumptions_ about my functions
that rule out your stupid monster examples and try to understand what
I am actually driving at!''

And this is exactly what reasonable mathematicians do who aren't
utterly ignorant w.r.t. physics and the real world in general: They
are aware of the fact that physicists simply aren't interested in
writing mathematical papers.  So, as it is nevertheless interesting
what physicists do mathematically, there is a branch of mathematics
that tries to find those ``reasonable assumptions'' that would render
the physicist's mathematics correct even to our mathematician's eye.
Often, whole new mathematical theories have to be invented to make it
work.  Sometimes, these new theories even prove useful to physicists,
and they'll use them, too, in the future (usually after one or two
generations).

So, saying ``The C standard sucks because it is full of ambiguities
and even relies on something as wishy-washy as natural language.'' not
only means getting on everybody's nerves by stating a triviality
everybody knows, it is neither helpful to anybody nor constructive in
any way.  Yes, if theorists like you find out ways how to write
standards for real-world languages that are less ambigious, without
being as impenetrable for non-mathematicians as the SML definition,
people will gladly accept them.  But if that requires to use totally
different languages whose major design goal is to produce neatly
looking denotational or whatever semantics, people wouldn't be as
happy anymore ;-)

Regards,
--
Nils Goesche
"Don't ask for whom the <CTRL-G> tolls."

PGP key ID 0x42B32FC9


 
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.
Erann Gat  
View profile  
 More options Aug 16 2002, 12:56 pm
Newsgroups: comp.lang.lisp
From: g...@jpl.nasa.gov (Erann Gat)
Date: Fri, 16 Aug 2002 09:20:22 -0700
Local: Fri, Aug 16 2002 12:20 pm
Subject: Re: Question on using Scheme on Large Projects
In article <m3lm77xxh5....@hana.shimizu-blume.com>, Matthias Blume

Perhaps, but asking "where does it say what 'available' means?" is a
rather oblique way of making that point.

Response #1: English specifications are not *inherently* ambiguous since
mathematical specifications can be rendered in English.

Repsonse #2: mathematical specifications are also inherently ambigious.
See David Deutch "The Fabric of Reality" chapter 10.

No it couldn't.  And that's a rather cheeky claim to make when by your own
admission you haven't even bothered to read what the standard (the
dictionary in this case) has to say about it.

> In fact, there are many C
> programs that will eventually run out of memory using typical
> malloc/free implementations even though the malloc request that ends
> up failing asks for no more memory than what is currently "available".
> In fact, in typical flat address spaces, allocation of n bytes can fail
> even though Omega(n^2) bytes are "available". (Work it out!)

You are simply making the observation (again, obliquely) that heaps can
fragment.  So what?  Everyone knows this.

> > There is nothing in either the letter of the spirit of the standard that
> > requires the following function to return 1:

> > int f() {
> >   void * p1 = malloc(10);
> >   free(p1);
> >   void * p2 = malloc(10);
> >   return p1 == p2;
> > }

> IIRC, this program is in violation of the standard.

You know, Matthias, I make it a point to read everything you post to
c.l.l. and c.l.s. because 99% of the time what you have to say is
worthwhile and I learn a lot.  But in this case I am becoming convinced
that you don't really have a point to make here and are just intentionally
being a jerk.  This is legal C++ code, and it takes no great leap of the
imagination to render it into legal C.

> I very highly doubt that the letter of the standard requires this.
> (Otherwise, prove it!)

It's an informal standard so I can't "prove" anything about it in the way
that you probably mean here.  But again, your doubt is irrelevant.  The
way you "prove" this is to write a malloc/free implementation that doesn't
have this property and see if people accept it.  The semantics of informal
standards (like natural language) are determined by consensus.  Within the
community of C programmers there is consensus on this point.  I can't
prove this, but if you go talk to C programmers (and I mean C programmers,
not wise-guy ML programmers who just happen to know C) you will find that
it is so.

BTW, there's a fine illustration of the slipperiness of even formal
standards in a recent thread on c.l.s. that you yourself were involved in
regarding the semantics of (call/cc (lambda (c) (0 (c 1)))).  The formal
semantics say unambiguously (once you go through the considerable trouble
to work it out) that the value of this expression in Scheme is 1.
Nonetheless, many Scheme implementations signal an error.  The debate over
which of these behaviors is "correct" raged on for weeks and was never
resolved.

E.


 
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 Aug 16 2002, 1:14 pm
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@cley.com>
Date: 16 Aug 2002 18:13:13 +0100
Local: Fri, Aug 16 2002 1:13 pm
Subject: Re: Question on using Scheme on Large Projects

* Nils Goesche wrote:
> Unfortunately, the physicist will not appreciate the helpful letter.
> Actually, there is no problem at all with the physicist's
> mathematics.  There /is/ a problem with the understanding of our
> /mathematician/, who hasn't understood that this physicist is not
> doing mathematics but physics.  His /objectives/ are totally
> different.  Using mathematics is only a means for him to achieve his
> real goal, which is to derive statements about the real world.  Of
> course he is aware of the fact that mathematicians can come up with
> freaky counterexamples for lots of things, but his pragmatic reply is:
> ``Jeez, just make some _reasonable assumptions_ about my functions
> that rule out your stupid monster examples and try to understand what
> I am actually driving at!''

This is one of the best articles I've read in cll for a long time.
Sometimes even threads as dire as this one will result in gems like
this: thanks.  

Everyone who cares about programming should understand the culture
that drives physics, and why it is so brilliantly successful.  C and
Common Lisp are both languages defined the physics way, and it's a
*good* way of defining language.  Of course it's not the only way (no
one claims it is), but the formal semantics way of defining languages
is *definitely* not the only way, despite what it's adherents might
think, and it's also not empirically a very successful way.

There's a story about theoretical physicists, who can be read here as
almost-mathematicians:

    A theoretical physicist was asked to compute the stability of an
    ordinary, four-legged table.  He rapidly arrived at preliminary
    results concerning the stability of zero- and one-legged tables,
    and of those with an infinite number of legs.  He spent the rest
    of his life trying to arrive at a general result for the stability
    of a table with an arbitrary, finite number of legs.

    (of course, the mathematician would have been stressing about
    whether the infinite number of legs was countable or not.)

--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.
Erik Naggum  
View profile  
 More options Aug 16 2002, 1:29 pm
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 16 Aug 2002 17:29:05 +0000
Local: Fri, Aug 16 2002 1:29 pm
Subject: Re: Question on using Scheme on Large Projects
* Matthias Blume
| That's the problem with all semantics that are being specified in
| English: they are inherently ambiguous.

  No, that is not the problem.  If they were /inherently/ ambiguous, that
  would imply that the writer meant several things at the same time.  Such is
  normally not the case with specifications, which are neither poetry nor
  puns.  That only one things is meant is pretty darn obvious.  Therefore, the
  ambiguity is found in the reader's intent to find it.

  What we cannot do, is write such that nobody, given enough energy, could not
  find that it could also mean something other than what you intended.  Some
  people on news make this a sport, thinking that it shows their intellectual
  prowess to first find the intended meaning and then hunt for a second
  meaning that would be idiotic to hold, in order to pretend that this is the
  writer's fault.  Be advised that you are up against one such semantic game
  artist.

--
Erik Naggum, Oslo, Norway

Act from reason, and failure makes you rethink and study harder.
Act from faith, and failure makes you blame someone and push harder.


 
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 Aug 16 2002, 1:32 pm
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@cley.com>
Date: 16 Aug 2002 18:27:10 +0100
Local: Fri, Aug 16 2002 1:27 pm
Subject: Re: Question on using Scheme on Large Projects

* Nils Goesche wrote:
> Unfortunately, the physicist will not appreciate the helpful letter.
> Actually, there is no problem at all with the physicist's
> mathematics.  There /is/ a problem with the understanding of our
> /mathematician/, who hasn't understood that this physicist is not
> doing mathematics but physics.  His /objectives/ are totally
> different.  Using mathematics is only a means for him to achieve his
> real goal, which is to derive statements about the real world.  Of
> course he is aware of the fact that mathematicians can come up with
> freaky counterexamples for lots of things, but his pragmatic reply is:
> ``Jeez, just make some _reasonable assumptions_ about my functions
> that rule out your stupid monster examples and try to understand what
> I am actually driving at!''

This is one of the best articles I've read in cll for a long time.
Sometimes even threads as dire as this one will result in gems like
this: thanks.  

Everyone who cares about programming should understand the culture
that drives physics, and why it is so brilliantly successful.  C and
Common Lisp are both languages defined the physics way, and it's a
*good* way of defining language.  Of course it's not the only way (no
one claims it is), but the formal semantics way of defining languages
is *definitely* not the only way, despite what its adherents might
think, and it's also not empirically a very successful way.

There's a story about theoretical physicists, who can be read here as
almost-mathematicians:

    A theoretical physicist was asked to compute the stability of an
    ordinary, four-legged table.  He rapidly arrived at preliminary
    results concerning the stability of zero- and one-legged tables,
    and of those with an infinite number of legs.  He spent the rest
    of his life trying to arrive at a general result for the stability
    of a table with an arbitrary, finite number of legs.

    (of course, the mathematician would have been stressing about
    whether the infinite number of legs was countable or not.)

--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.
Nils Goesche  
View profile  
 More options Aug 16 2002, 3:29 pm
Newsgroups: comp.lang.lisp
From: Nils Goesche <car...@cartan.de>
Date: 16 Aug 2002 21:29:55 +0200
Local: Fri, Aug 16 2002 3:29 pm
Subject: Re: Question on using Scheme on Large Projects

Sorry, but the point here is that you are evaluating p1 after calling
free on it.  This is not allowed, and yes, it's strange :-)

Regards,
--
Nils Goesche
"Don't ask for whom the <CTRL-G> tolls."

PGP key ID 0x42B32FC9


 
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 101 - 125 of 152 < Older  Newer >
« Back to Discussions « Newer topic     Older topic »