Discussion:
Why is Python popular, while Lisp and Scheme aren't?
(too old to reply)
Pascal Costanza
2002-11-12 10:26:45 UTC
Permalink
You mean (funcall #'+ 1 1 1) and (funcall #'* 2 3).
No, (funcall '+ 1 1 1) works as well (as defined by the ANSI specs).
Yes, but identifying functions with the symbols that name them
at run time is generally reckoned bad Lisp style.
You're right, but I wanted to avoid to explain the difference between '
and #'. These examples are only meant to give a first taste of Lisp.


Pascal
--
Pascal Costanza University of Bonn
mailto:costanza at web.de Institute of Computer Science III
http://www.pascalcostanza.de R?merstr. 164, D-53117 Bonn (Germany)
Courageous
2002-11-21 05:01:10 UTC
Permalink
Think all you like. Industry has spoken. Other languages = 10. Lisp = 0.
True, but they spoke before: COBOL, CICS, VSAM, ...
Not, really. The absence of Lisp in the community is largely due to
a _grass roots_ dislike of Lisp itself.

C//
Ian Bicking
2002-11-09 01:34:30 UTC
Permalink
At one time during school I had gotten into Smalltalk, and felt the same
way about it as many do about Lisp -- it was a great language and why
didn't people use it more? I think many of Smalltalk's flaws are
similar to Lisp's flaws (and I still like both languages, but actively
use neither).

In both cases the syntax is novel. Smalltalk's syntax is actually quite
aesthetically pleasing (in comparison to Lisp and most other languages,
even Python), but regardless it doesn't look anything like standard
Algol-style syntaxes. Speed is more of an issue with Smalltalk, but
it's certainly no worse than Python.

But I don't think syntax is the biggest problem with either of these
languages. Neither Lisp nor Smalltalk allows a person to move gradually
between environments. My first experience with Python was using it to
create small scripts. They were learning devices to be sure, but they
were also useful. My similar experiments with Smalltalk were not useful
-- and the only way I could truly be useful in Smalltalk without writing
large and complete applications would be to use a Smalltalk
environment. I even considered actually doing this -- living in a
Smalltalk world, with a Smalltalk browser and email client, storing my
documents in Smalltalk objects, the whole deal. But that would be hard,
and I never actually made that leap. People have made that same leap
with Lisp -- the Lisp Machines of yore.

But that's not going to be mainstream. In a heterogeneous environment
both Lisp and Smalltalk have serious issues. Their style isn't friendly
to outsiders, and even worse their environment usually isn't friendly.
Python might not have as many libraries as Perl, but it has a heck of a
lot -- and best, a lot of libraries that connect to C libraries of
significant functionality.

That's not fair, though -- neither language is fundamentally
isolationist. So maybe the real blame lies with timing. Python came
around when free software/open source was becoming a truly functional.
Python gets a lot from that, and it also happens to get a lot from
having a single implementation. Together, when something is implemented
by one (sharing) person, it is shared among all Python programmers --
not programmers of a specific implementation, nor among everyone who
finds it useful enough to pay for. This community could not have come
to exist fifteen or twenty years ago, when those other languages were
still fresh.

There's other important practical issues. It's easy to share Python
programs and modules. It's easy to manage the modules you get from
others. It's easy to install Python, and while it doesn't start up
instantly, it starts up pretty quick (quicker than Common Lisp or
Smalltalk to be sure). People can script in Python, they can't in big
languages. Scripting is a great way to pull people in, and unlike other
languages (*coughperlcough*) they won't be burned when they try
something of significant size. These are all details, but they are very
important details.

Ian
John Baxter
2002-11-11 16:35:09 UTC
Permalink
In article <3dcf6a25$0$35901$edfadb0f at dread13.news.tele.dk>,
A fascinating read - like
when they invented garbage collection because they didn't have enough
spare bits for reference counting in the IBM 704 machine word ;)
on-a-64-bit-machine-would-McCarthy-have-invented-Python-instead?-ly y'rs,
We might have found out, had IBM ever gotten "Stretch" to work.

--John (36 bits is SO confining) B.
Bengt Richter
2002-11-11 19:46:37 UTC
Permalink
Post by John Baxter
In article <3dcf6a25$0$35901$edfadb0f at dread13.news.tele.dk>,
A fascinating read - like
when they invented garbage collection because they didn't have enough
spare bits for reference counting in the IBM 704 machine word ;)
on-a-64-bit-machine-would-McCarthy-have-invented-Python-instead?-ly y'rs,
We might have found out, had IBM ever gotten "Stretch" to work.
I thought there was a "Stretch" doing production work at a Navy lab in the 60's.

Regards,
Bengt Richter
Dieter Menszner
2002-11-09 08:07:20 UTC
Permalink
In article <aqhmib$ei8$2 at solaris.cc.vt.edu>,
Python is more like Lisp than most other languages, though. It's
similar semantically.
This makes little sense to me. Even the most basic data structures are
different: Lisp is based around singly linked lists while Python uses
vectors (with efficient random access unlike Lisp lists) and
dictionaries. They are also not especially similar in programming
This is just wrong. To say 'Lisp is based around singly linked'
is similar as saying C is build around the ASCII character set.
Not totally wrong but ...

Common Lisp has built-in all the usual data types including
hash tables.
Chris Humphries
2002-11-10 08:49:33 UTC
Permalink
where are you getting these "normal" definitions from? they
do not exist. probably the closest thing to that being standardized
is man style on *bsd, or the linux kernel coding doc about coding
standards for code (forget the name).

the people have enough of a time just keeping a language standard,
much less the syntax. i use C syntax of openbsd's man style, lisp
syntax that emacs uses, and python syntax i use at work that we
agreed to use.

standards are syntax are generally relative to what scope you are in
when actually coding, not as some universal rule.

-chris
(if (a)
(if (b)
(if (c)
(asdf)
(zzzz)
)
(foo)
)
(bar)
)
(if (a)
(if (b)
(if (c)
(asdf)
(zzzz))
(foo))
(bar))
Would be the normal way to write this.
--
I know, but I personally find the way I wrote it to be easier to read.
You'll also note that I didn't use the normal C coding standard in the C
examples, and instead used the Java/C# standard (Which I prefer).
if (a)
{
asdf;
}
etc.
--
http://mail.python.org/mailman/listinfo/python-list
Erik Max Francis
2002-11-13 23:34:05 UTC
Permalink
I know. But, as I said, Scheme and Lisp are very different languages.
I.e., Scheme is /not/ a good introduction to Lisp (and vice versa),
any more than, say, INTERCAL is a good introduction to Java :-)
Again, that's why I said "Lisp-like languages," not Lisp. After all, if
I were so inclined, I could turn the nitpicking apparatus back onto you:
Which variety of Lisp do you mean when you say Lisp? There are a great
number that are not only "Lisp-like" but actually have the word _Lisp_
in their names.
[What do you mean by "Lisp-like language" anyway? Python seems pretty
Lisp-like to me...]
Languages that look and act like Lisp. One might argue that Logo
qualifies (as a once-removed cousin), but I don't see how you can really
argue that Python looks and acts like Lisp. If Python is Lisp-like then
what isn't?
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/ \ Experience is the name everyone gives to their mistakes.
\__/ Oscar Wilde
WebVal / http://www.alcyone.com/pyos/webval/
URL scanner, maintainer, and validator in Python.
Patrick W
2002-11-21 04:57:31 UTC
Permalink
http://www.tilton-technology.com/cells_top.html
...to Python /precisely/ (a) to swim in a bigger pond (uh, pond with
more fish?) and (2) because there is (I hear) a x-platform GUI,
Several in fact.
TKinter. And it's fun learning a new language, recommended so highly
by a CL worthy such as Norvig.
Not trying to twist your arm but in case you weren't aware of it, Qt
(and PyQt) is just as portable as Tkinter (on platforms that matter)
and has a few advantages (snappier performance, more 'native' look,
more (and IMO, better) widgets, easy integration with opengl, stable
and reliable, distributed under 'free' or commercial licences,
arguably more popular in industry, etc). They guy who maintains PyQt
(the Python bindings to the Qt C++ libraries) does a great job of
keeping up with the latest Qt releases.

Perhaps worth a look if you haven't checked it out already.

http://www.trolltech.com (for info on Qt)
http://www.riverbankcomputing.co.uk/pyqt/index.php (for PyQt)
Kenny Tilton
2002-11-21 16:03:52 UTC
Permalink
Post by Patrick W
Not trying to twist your arm but in case you weren't aware of it, Qt
(and PyQt) is just as portable as Tkinter (on platforms that matter)
Is this a reference to it not being available for the Mac? Tiny share,
yes, but it matters. Kinda like CL. :)
Post by Patrick W
Perhaps worth a look if you haven't checked it out already.
Thx for the lead. I gather the non-commercial Qt is pretty decent? Is
that just licensing/support/add-ons? ie, It is otherwise current with
commercial Qt? (The Qt site wanted my life story before it would take me
to the pricing page. <g>)
--
kenny tilton
clinisys, inc
---------------------------------------------------------------
""Well, I've wrestled with reality for thirty-five years, Doctor,
and I'm happy to state I finally won out over it.""
Elwood P. Dowd
Rocco Moretti
2002-11-09 23:35:33 UTC
Permalink
Python uses infix notation for math. Most humans were brought up to
understand infix.
Because Lisp has a powerful macro system, it is actually possible to
have an infix-macro, which lets you use infix-syntax. And you can
write macros to support all sorts of weird syntax, if you want.
I've heard this argument a number of times, and have never really
bought it. To me it seems equivalent to saying "Because (Brainf*ck/
Intercal/ Unlambda/ Malbourge /etc) are Turing Complete, you can write
any program in them." Sure, you *can*, but why bother?

It's the same reason why using lists and dictionaries are so much
better in Python than in C. Sure, you *could* write your own type and
various accessory methods to do the same thing, but why should you
have to deal with the boilerplate code to make the language do it?

It's doubly hard when beginning Lisp books only teach the prefix
notation - the beginner could change it, but who, thus thouroghly
vexed, has the stamina to wait until chapter 23 to learn how? That's
why the common rebuttal directed toward Lisp critics is that they
don't *really* know the language. Lisp is a powerful language, but you
have to have the patience and the masochism to make it all the way to
chapter 23.

If-I-wasn't-lazy-I-would-be-doing-it-longhand
Dennis Lee Bieber
2002-11-23 01:56:37 UTC
Permalink
Donn Cave fed this fish to the penguins on Friday 22 November 2002
Sure, but that's just the first O in OOP. Objects have attributes,
anyone can penetrate this mystery. The question is, given the initial
statement of a programming problem, like ``turn MIDI data into a
printed score'', where do the objects come from and how do they help?
If your grasp of Python is strongly OO, you'll find answers that you
can explain, but you probably won't be able to explain how you found
them. We don't think by enumerating facts about the tools we use.
Very sloppy requirements -- Are we talking a live MIDI instrument
stream or data file; one instrument track or multiple?

However, the courses/books I have on OO Analysis/Design (regardless of
target programming language) tend to focus on Nouns and Verbs
(noun->object, verb->method, and extending some what,
adjectives->attributes).

turn (verb) MIDI data (noun) into (accessory verb?) a printed
(adjective? or more likely a verb) score (noun).

So from that simple statement we have two objects already:

score

MIDI data

In truth, I would consider the analysis faulty... the primary object
is the NOTE, which has attributes of pitch and duration. Both the
printed score and the MIDI data are equivalent representations of a
stream of notes. There is the next object; the stream -- probably more
familiar as a "track". What does a track have for attributes? Well,
maybe an instrument (or voice), and a list of notes. I'd revise the
definition of score now to include multiple parallel tracks.

So now I have:

SCORE (attribute: track(s), track count)
TRACK (attribute: voice; attribute: note(s))
NOTE (attribute: pitch; attribute: duration)

No methods listed yet... I suspect the easy ones would be:

SCORE: add new track; delete track
TRACK: add note; delete note; set voice
NOTE: set(pitch, duration); get(pitch, duration)

Little more analysis would probably give me an object for MIDI stream,
and an object for Music printer.

The MIDI stream object would have methods for GetEvent, SendEvent.

The Music printer would have attributes for staves/page, notes/bar,
etc. Methods for getting/setting those parameters, and for feeding
voice/track and note information.

The main processing would be a loop getting events from the MIDI
stream and parsing them into needed score, score.track,
score.track.note methods. At end (of file, or some manual interrupt for
live streams) run a loop over the score object retrieving the notes and
feeding them to the printer object.


Now, this is a very sloppy analysis -- what do you expect for a 20
minute effort (the OOA/OOD classes ran some 40 hours each, and seldom
got more detailed than a calculator or ATM/bank/user configuration).
So the first challenge may be to learn to think in Python, but then
you need to learn to think beyond it.
Whereas I prefer to "think in" the abstract, and /then/ apply
transforms to map the abstract constructs to the target language.
--
============================================================== <
wlfraed at ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wulfraed at dm.net | Bestiaria Support Staff <
============================================================== <
Bestiaria Home Page: http://www.beastie.dm.net/ <
Home Page: http://www.dm.net/~wulfraed/ <
Michael Hudson
2002-11-21 14:00:02 UTC
Permalink
I thought that this is a python list where every kind of language
related question can be posed. But this thread in my opinion is
getting out of range.
It's hard to stop people posting to a thread they're interested in.

This thread is pretty on topic compared to some -- we haven't had any
discussions about esperanto or trans-finite cardinals or what sort of
water pasta is best cooked in. python-list tends to go in for wildly
off-topic threads. I don't mind, because they're usually pretty
interesting.
Besides, I really think that this is a very friendly list, but right now, I'm
getting more emails about this thread than really relevant mails for a newbie!
This however suggests you need a better way of reading this list.
Having all of the traffic for this list slam into one's inbox would be
pretty bad, I imagine.

The best way to read it, IMHO, is as a newsgroup. If your
organization or ISP has a news server, just point your news client at
it and ask for comp.lang.python. Same content as the list, but news
readers usually have convenient interfaces for "I don't want to see
this thread" and such. If you don't have easy access to a news
server, but do have internet access, you can point your news reader at
"news.gmane.org" and ask for (I think) gmane.comp.python.general.

If your stuck getting it as email, you want to persuade something in
the email delivery chain to divert messages with the header:

List-Id: General discussion list for the Python programming language <python-list.python.org>

to a special python-list mailbox. From headers, you seem to be using
Lotus Notes (could be wrong), in which case you have my pity, and I
can't help you with this bit.

Hope that helped!

Cheers,
M.
--
First of all, email me your AOL password as a security measure. You
may find that won't be able to connect to the 'net for a while. This
is normal. The next thing to do is turn your computer upside down
and shake it to reboot it. -- Darren Tucker, asr
Matt Gerrans
2002-11-22 07:58:33 UTC
Permalink
I disagree. I've learned a number of languages and Python was by far the
fastest. This was probably due to the fact that it is not just easy to
learn, but also fun. Also, the aid of the interactive prompt facilitates
quick learning immensly. An intelligent and motivated person should be able
to zip through "Learning Python" in two or three weeks to get a start and be
quite proficient in just a few months practice.

Of course, after a few years when you go back and look at the early stuff
you wrote when you first learned it, you will find cleaner and more
idiomatic ways of doing some things, but this phenomenon is by no means
unique to Python.
Jens Axel Søgaard
2002-11-13 20:48:54 UTC
Permalink
"Jens Axel S?gaard" <usenet at soegaard.net> wrote in message
Beating
http://www.htdp.org
Thanks. I'll learn a few things from this. However, apropos to the
thread topic, I am somewhat flabbergasted that anyone could think that
Scheme's
(sort (cons 1297.04 (cons 20000.00 (cons -505.25 empty))))
(cons 20000.00 (cons 1297.04 (cons -505.25 empty)))
(section 12.2) is a sensible list notation to inflict on anyone, let
alone newcomers,
This is in the beginning of the book. Later you will learn to write
(list 1 2 3) or '(1 2 3).

There is a *very* good explanation. Read on.

[For the Pythonians that does not know Scheme.
Note that the Scheme-list called a linked list in som other
languages. A python list is called a vector in stead.]

But why? HTDP uses DrScheme. In DrScheme there are several teaching
language levels. Ranging from beginner, intermediary, advanced. Then
one is ready to use Pretty Big Scheme.

The language levels enables DrScheme to provide the user with error
messages that the student understands. In most languages a simple
syntax error can provoke an error message using concepts the beginner
does not yet understand. DrScheme has the most beginner-friendly error
messages I have ever seen.

Back to the issue, whether to write (cons 1 (cons 2 empty)) or (list 1 2).
This choice is made to learn the beginner the representation of a list.

What is a list of numbers? A list of numbers is either empty, or constructed
by the first number of the list followed by the rest of the list.

Thus a list-of-numbers is either
empty
or
(cons a-number a-list).

Examples of lists:
empty
(cons 1 empty)
(cons 2 (cons 1 empty))
Examples of first and rest:
(first (cons 2 (cons 1 empty))) = 2
(rest (cons 2 (cons 1 empty))) = (cons 1 empty))


This is important! If you know this we kan write follow the design recipe
for developing list processing function to make functions that handle list
automatically (i.e. without thinking too much).

Let make a function that counts the number of elements in a list
(don't worry it's already in Scheme - it's just an example)

(define (length a-list)
(cond
[(empty? a-list) 0]
[(cons? a-list) (+ 1 (length (rest a-list)))]))

In prose this says,
if a-list is empty, then the length of the list is 0,
if the list is cons-tructed then the length is 1 (there is a first
element) plus the length of the rest of the list.

If in constrast you learned to make lists like
'(1 2 3) which gets printed as (1 2 3),
then you wouldn't know how to make list processing functions.

When you master how to make the functions, it is ok to learn
the notational short cuts.


In more general terms: in the teaching languages values
are printed in the same notation that are used to construct them.
For example: "Hello world" gets printed as "Hello world". This a good
thing for beginners - they are less likely to get confused by the internal
and the printed representation of the various datatypes.

If you haven't looked at the tour, then take a look at
which shows that bitmaps are a builtin datatype, which can be
put directly in the editor:
http://www.drscheme.org/tour/202/tour-Z-H-5.html

Another beginner friendly thing is the Stepper, which alows you
to execute your programs in small steps also backwards!
http://www.drscheme.org/tour/202/tour-Z-H-8.html

Finally there are builtin support for XML for making homepages:
http://www.drscheme.org/tour/202/tour-Z-H-11.html

Have fun,
--
Jens Axel S?gaard
Michael Hudson
2002-11-26 10:30:39 UTC
Permalink
|> 'lazy'.
|But I think in technical pointy-eared CS speak, 'lazy' has a technical
|meaning that differs slightly from what Haskell does.
|I used to know the difference, but I've forgotten; something like lazy
|means you evaluate a subexpression *each* time its value is used?
|Haskell doesn't do that.
There might well be a difference between "non-strict" and "lazy" that I
am unaware of. I know these things only casually, not in a pointy-eared
CS way.
But for a pure functional language to evaluate a subexpression each
time its value is used is just plain foolish. Since you know--by
definition once state is removed--that a subexpression will always
evaluate to the same thing, deciding never to cache that value is
pointless. I kinda suspect that whatever "lazy" really means precisely,
it isn't "burns cycles needlessly" :-).
Yeah, I kinda thought that.

I went and looked it up in the foldoc. Turns out a function `func' is
"non strict" if

func bottom

is something other than bottom. To quote the foldoc, "lazy
evaluation" is a _reduction strategy_ combinining normal order
evaluation with updating.

So it's a bit absurd to describe a language as non-strict, except to
mean that it is possible to write non strict functions in the
language. Lazy evaluation is a way of arranging that to be possible.
I don't know if Haskell98 mandates lazy evaluation.

Cheers,
M.
--
The PROPER way to handle HTML postings is to cancel the article,
then hire a hitman to kill the poster, his wife and kids, and fuck
his dog and smash his computer into little bits. Anything more is
just extremism. -- Paul Tomblin, asr
Pascal Costanza
2002-11-26 15:17:27 UTC
Permalink
So what I have in mind is not only a way to make use of Common Lisp
libraries from Python. I am pretty sure that this is already possible.
I
rather think that implementing Python in Common Lisp has several
advantages beyond mere reuse options. Here are some ideas.
Do you know of anyone working on that right now? (Python in Lisp, not
Lisp libraries for Python)
No, I am not aware of any such project. (But, of course, there might be
one.) I would consider doing it if I had more time. ;)


Pascal
--
Pascal Costanza University of Bonn
mailto:costanza at web.de Institute of Computer Science III
http://www.pascalcostanza.de R?merstr. 164, D-53117 Bonn (Germany)
maney
2002-11-13 22:59:32 UTC
Permalink
come up with it. Isn't there a pithy quote along the lines of
"constraints spark creativity"?
Form is liberating? Though a slightly mangled old saw like "desperation is
the mother of invention" seems more like what you're looking for. :-)
The only biggy for me is the lack of Lisp style (with-... ) macros;
def
You got cutoff here, or the article got truncated on its way. Want to try
again? I expect I'd enjoy seeing what you were going to say.
Jens Axel Søgaard
2002-11-11 15:27:01 UTC
Permalink
anton at vredegoor.doge.nl (Anton Vredegoor) wrote in message
Wouldn't it be possible to write a macro for Lisp so that it uses
newlines and indentation instead of parens?
Yes, it's been done before.
http://www-cgi.cs.cmu.edu/afs/cs/project/ai-
repository/ai/lang/lisp/code/syntax/0.html Nobody really cared about
the efforts though. Right now, PLT is trying to do something similar
by including tools to let you embed and design new grammars more
easily. The 200 versions come with their example Algol-60
implementation.
;-)

That is not the purpose at all. The purpose is to show how easy it is to
use the PLT (DrScheme) to write parsers/interpreters/compilers. That and
to show off the superb module system.

I guess the choice fell on Algol 60 because it were a significant programming
language that influenced a lot of languages. It's "the mother of all lexically scoped
bloak languages".

--
Jens Axel S?gaard
Martti Halminen
2002-11-09 19:21:28 UTC
Permalink
The only thing that could make me at all comfortable with using Lisp
would be if I had an editor that would color-highlight not keywords or
strings, as color-highlighting usually goes, but levels of parenthesis
(a (b (c (d e))))
I wonder why you aren't writing
(a
(b
(c
(d e)
)
)
)
A lisp programmer would write it like this:

(a
(b
(c
(d e))))

or the original: (a (b (c (d e)))) if using so short names and no
control structures causing special indentation.
The issue with 'Python being easier to read than Lisp,' IMHO, is mainly that
Python FORCES you to use indentation, whereas Lisp does not.
Since Lisp does not force you to write readable code, you have to force
yourself to use indentation.
For a beginner it might be forcing, for the professionals it is a major
tool. Not using the canonical indentation style is a sure sign of a
newbie in comp.lang.lisp.
But I don't see a bunch of C programmers typing
if (a) { if (b) { if (c) { asdf; } else { zzzz; }} else { foo; }} else
{bar;}
like a Lisp coder might type
(if (a) (if (b) (if (c) (asdf) (zzzz)) (foo)) (bar))
(if (a)
(if (b)
(if (c)
(asdf)
(zzzz)
)
(foo)
)
(bar)
)
(if (a)
(if (b)
(if (c)
(asdf)
(zzzz))
(foo))
(bar))

Would be the normal way to write this.

--

Continue reading on narkive:
Loading...