Related articles |
---|
What is the future of Compiler ? blertadn@yahoo.com (blerta bishaj) (2006-06-12) |
Re: What is the future of Compiler ? englere_geo@yahoo.com (Eric) (2006-06-15) |
Re: What is the future of Compiler technology? tommy.thorn@gmail.com (Tommy Thorn) (2006-06-19) |
Re: What is the future of Compiler ? oliver@first.in-berlin.de (Oliver Bandel) (2006-06-19) |
Re: What is the future of Compiler technology? oliver@first.in-berlin.de (Oliver Bandel) (2006-06-20) |
Re: What is the future of Compiler ? frido@q-software-solutions.de (Friedrich Dominicus) (2006-06-22) |
Re: What is the future of Compiler technology? tommy.thorn@gmail.com (Tommy Thorn) (2006-07-05) |
Re: What is the future of Compiler technology? torbenm@app-4.diku.dk (2006-07-06) |
Re: What is the future of Compiler technology? oliver@zeigermann.de (Oliver Zeigermann) (2006-07-16) |
Re: What is the future of Compiler technology? Juergen.Kahrs@vr-web.de (=?ISO-8859-1?Q?J=FCrgen_Kahrs?=) (2006-07-16) |
Re: What is the future of Compiler technology? eliotm@pacbell.net (Eliot Miranda) (2006-07-19) |
Re: What is the future of Compiler technology? Colin_Paul_Gloster@ACM.org (Colin Paul Gloster) (2006-07-19) |
Re: What is the future of Compiler technology? pocmatos@gmail.com (Paulo Matos) (2006-07-31) |
Re: What is the future of Compiler technology? gdr@integrable-solutions.net (Gabriel Dos Reis) (2006-07-31) |
[3 later articles] |
From: | torbenm@app-4.diku.dk (=?iso-8859-1?q?Torben_=C6gidius_Mogensen?=) |
Newsgroups: | comp.compilers |
Date: | 6 Jul 2006 07:51:44 -0400 |
Organization: | Department of Computer Science, University of Copenhagen |
References: | 06-06-044 06-06-051 06-06-056 06-06-064 06-07-001 |
Keywords: | OOP |
Posted-Date: | 06 Jul 2006 07:51:44 EDT |
"Tommy Thorn" <tommy.thorn@gmail.com> writes:
> Friedrich Dominicus wrote:
> > And it shows how Microsoft brainwashing works. Have you checked
> > Smalltalk it has full closures from it's beginning,
>
> No. In standard Smalltalk, blocks don't capture free variables.
>
> Scheme, SML, O'Caml, Haskell, etc all had true closures from day one.
It is older than that, but the languages above are good examples of
modern languages with full closures.
You can argue that lambda calculus had full closures before there were
even programmable computers, but since early treatments of lambda
calculus used substitution semantics rather than environment
semantics, this is somewhat debatable. Landin's SECD machine from
1963 implemented lambda calculus with closures, though.
LISP (ca. 1960) was originally intended to be an implementation of the
lambda calculus, but since it used dynamic binding, it did not have
true closures. Some LISP variants had options for static binding
(and, hence, true closures). I remember using a LISP system on the
Univac 1100 that would build true closures with statically bound
variables if you used "LAMDA" instead of "LAMBDA".
Algol 60 used "thunks" for call-by-name, but since these were upwards
closures only, they were not true closures. The same is true for
Pascal's function/procedure parameters.
> I agree, attempts at shoehorning closures into languages originally
> designed without them have never been very successful.
If the language already supports nested scopes and a garbage-collected
heap, adding closures is normally not a big deal semantically, but it
may require a complete reworking of the implementation, as you will
have to heap-allocate local variables that would normally reside on
the stack. To avoid this, people have used all sorts of weird and
often incorrect tricks when adding closures to languages that didn't
have them. Unfortunately, these misguided implementation attempts
sometimes become canonized as the defining semantics of the language.
Torben
Return to the
comp.compilers page.
Search the
comp.compilers archives again.