Re: How do you do this?



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


.



Relevant Pages

  • Re: scheme seems neater
    ... And I have no reason to believe my ... If a language can help amateurs or ... while Scheme continues to mutate. ... the case is that Common Lisp as it stands is actually useful, ...
    (comp.lang.lisp)
  • Re: seperation of function namespace
    ... Yes, but name clashes still happen and idiotic naming ... Because the way the English language graphemically conflates verbs and nouns ... PLT scheme and related publications). ...
    (comp.lang.lisp)
  • Dissecting the electorate
    ... Scheme needs *no* additional modularization ... would be quite a bit more painful to use than the language we ... Now, getting the module system *right* is not necessarily easy, ... from the core semantics and into the library - the C stdio libraries ...
    (comp.lang.scheme)
  • Re: Batch conversion of files
    ... tried writing those other languages in Scheme. ... one would want to do in GIMP is a procedural task. ... cleaner code that would have been written in another language more ... Let's take that simple batch mode script that caused all the fuss to ...
    (comp.graphics.apps.gimp)
  • Re: R6RS mail archives, formal comments, next r6rs draft
    ... R5RS Scheme an excellent language for learning programming and has ... Should Scheme stop at that? ... useful features are not in R6RS. ... Now R6RS is structured into two parts: the language and the standard ...
    (comp.lang.scheme)