Re: Sacla loop: a new loop implementation
From: Gareth McCaughan (gareth.mccaughan_at_pobox.com)
Date: 10/19/04
- Next message: William D Clinger: "Re: Avoiding work in closures?"
- Previous message: jayessay: "Re: Sacla loop: a new loop implementation"
- In reply to: Antonio Menezes Leitao: "Re: Sacla loop: a new loop implementation"
- Next in thread: Antonio Menezes Leitao: "Re: Sacla loop: a new loop implementation"
- Reply: Antonio Menezes Leitao: "Re: Sacla loop: a new loop implementation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 18 Oct 2004 22:48:20 GMT
Antonio Menezes Leitao wrote:
> You are forgetting a fundamental issue. Macro expansion is a
> compile-time operation. If you create a Lisp that allows macros that
> require type information to compute the expansion then that
> information must be produced at compile time. And if you can produce
> useful type information at compile time, then you are working with a
> statically typed language. That's as simple as that.
Why on earth do you believe that "if you can produce useful
type information at compile time, then you are working with
a statically typed language"? That seems to me to be obviously,
ludicrously, false, unless you define some of those terms in
a non-standard way that makes your point uninteresting.
I claim:
- A language in which it is never necessary to issue
explicit type declarations, and in which it is commonplace
for variables to have values of multiple different types,
is not a "statically typed language".
- Such a language may, none the less, have a compiler that
can often deduce useful information about what types some
variables (or other expressions) can have.
- It still isn't a "statically typed language".
- If it has such a compiler, then there's no obvious reason
why that compiler shouldn't (when it can) provide type
information to whatever macro-expansion facility it uses.
- It still isn't a "statically typed language".
I think you do in fact appreciate this, because you said:
> Of course, if you say that you are willing to accept that your macros
> might need to expand without useful type information available, I
> seriously doubt that they will be any useful. And if your macros
> _demand_ useful type information then you will have to declare type
> information on the code that uses them.
Now, obviously you're an authority on the question of what
things you "seriously doubt". But if, as you say, you
seriously doubt that it's possible for compile-time (or,
more exactly, macro-expansion-time) type information to
be useful when it isn't always available, then *I* seriously
doubt that you've thought it through properly.
A good CL compiler (CMU CL, say) can do a *lot* of type
inference. Sometimes it can work out a lot about what type
something has, sometimes not. What it's able to work out
is enough to let it produce some very decent code, even
without explicit type declarations.
So we have an example of a system where not-always-available
type information is helpful. Why do you "seriously doubt"
that there might be other examples?
*
You've used the term "statically typed language" a lot,
and you've defined it in terms that are ambiguous because
a crucial quantifier is missing. Could you please say
which of the following (if any) is your definition?
1 "A language in which type information is always
available at compile time"
2 "A language in which type information is usually
available at compile time"
3 "A language in which type information is often
available at compile time"
4 "A language in which type information is sometimes
available at compile time, no matter how rarely"
Thanks.
-- Gareth McCaughan .sig under construc
- Next message: William D Clinger: "Re: Avoiding work in closures?"
- Previous message: jayessay: "Re: Sacla loop: a new loop implementation"
- In reply to: Antonio Menezes Leitao: "Re: Sacla loop: a new loop implementation"
- Next in thread: Antonio Menezes Leitao: "Re: Sacla loop: a new loop implementation"
- Reply: Antonio Menezes Leitao: "Re: Sacla loop: a new loop implementation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|