Re: How do you do this?
- From: Ray Dillinger <bear@xxxxxxxxx>
- Date: Fri, 25 Apr 2008 01:19:23 -0700
Anton van Straaten wrote:
All of this is an argument for not compromising the tractability of
lexical variables by making them dynamically accessible by default.
However, since the feature can be useful occasionally, Scheme
implementations tend to provide the capability in various ways.
Optional first-class namespaces, as provided e.g. by PLT Scheme, are a
good way to do it.
There is a language-design issue here.
You can make programming languages where things that are hard
to reason about are inexpressible (like Haskell). This is a bit
like the efforts of early philosophers to create human languages
where lies were inexpressible or ungrammatical - a nice ideal, but
never resulted in any practical language with native speakers.
You can make programming languages where things that are hard to
reason about are essential for getting anything done (like C).
Or you can strive for an ideal where things that are hard to
reason about are usually unnecessary - but available (like
Scheme).
There is not much difference in effort writing Haskell or writing
scheme without exclamation points. You really can do side-effect-
free programming in Scheme, and it isn't all that hard. Having
done so you have programs you can reason about just as easily as
programs written in Haskell.
There is also not much more effort involved in writing scheme
programs consisting exclusively of expressions whose result types
can be statically proven than there is writing code in a statically
typed language, and there are a couple of static type checkers for
Scheme to help you do that (nobody much uses them, but they exist).
And having done so you have programs whose types are as easy to
reason about as the types in programs written in a statically typed
language. If you're using a system that does its own type checking
in the compilation phase (like Stalin), you also get the benefit of
runtime code with no typechecks, just as you would with a statically
typed language.
People forget that it is programs, and not languages, which have the
properties such as static types or freedom from side effects, that
make them easy to reason about. Because Scheme is a well-designed
language, you can write useful programs having those properties in
scheme. The fact that you can also write programs *NOT* having
those properties in scheme is irrelevant; It means you can't
use the language itself as a proof of the properties, but it doesn't
mean the properties are absent from individual programs.
Bear
.
- Follow-Ups:
- Re: How do you do this?
- From: Anton van Straaten
- Re: How do you do this?
- From: Pertti Kellomäki
- Re: How do you do this?
- References:
- How do you do this?
- From: rocco . rossi
- Re: How do you do this?
- From: rocco . rossi
- Re: How do you do this?
- From: Anton van Straaten
- How do you do this?
- Prev by Date: Re: ANN: irregex - portable and efficient regular expressions for scheme
- Next by Date: Re: How do you do this?
- Previous by thread: Re: How do you do this?
- Next by thread: Re: How do you do this?
- Index(es):
Relevant Pages
|