Scheme (was: Re: language aesthetics)
Dirk Gerrits
dirk at gerrits.homeip.net
Fri May 16 08:07:15 EDT 2003
Sandy Norton wrote:
> Hi,
>
> I often worry that I've become so 'comfortable' with python that I may
> end turning into a language bigot not appreciating the ideas and
> motivations behind other language designs. As a counter to this, I
> usually take it upon myself to put some effort into learning how other
> languages do it. At times this leads to wonderful and rewarding
> journeys (e.g. haskell), and at other times, I run away screaming back
> to pythonistan (e.g.
> http://www.perl.com/pub/a/2003/04/09/synopsis.html ).
>
> My question is: what other languages 'fit' the common aesthetic (if it
> exists) of a pythonista?
Once I got past my parenthesis-phobia I found Scheme
(http://www.schemers.org/) to be quite elegant.
It's a small Lisp dialect, with a very clear and consistent syntax. It's
language specification is freely available
(http://www.schemers.org/Documents/Standards/R5RS/) and counts a mere 50
pages. Contrast this to ~800 for C++ and ~1100 for CommonLisp for example.
Despite it's small size, Scheme is quite powerful. In this case, less is
more. ;) That the standard library is equally small is a bit unhandy for
any serious programming, but you can turn to commonly provided libraries
and language extensions:
http://www.swiss.ai.mit.edu/~jaffer/SLIB.html
http://srfi.schemers.org/
I think you might say that these are to Scheme what Boost is to C++.
Scheme has built-in support for continuations. I had looked at Stackless
Python continuations and continuations in general before, but I never
understood them until I learned Scheme. With them you can build some
great control structures like generators, microthreads,
'non-determinism', etc. This is not for the faint of heart though. I
fully respect CPython's approach of only providing things you can do
with continuations instead of actual continuations.
A downside to Scheme (or Lisp in general) is that its user community
seems a lot less friendly than Python's. This is partly due to the
multitude of implementations out there I guess. No one seems to agree
with anyone else on the newsgroup posts.
One tip if you are going to look into Scheme: pay attention to
indentation, not parenthesis. But I guess a Pythonista should know this
already. ;)
Regards,
Dirk Gerrits
More information about the Python-list
mailing list