
Scheme vs. Python (2011) - ooooak
https://www.cs.berkeley.edu/~bh/proglang.html
======
coldtea
> _How many people reading this are 50 years old? Lisp is 50 years old — and
> for the most part, the lifespan of a programming language is closer to the
> lifespan of a dog than to that of a person. Only one other language
> (Fortran) is that old and still in use. Why has Lisp survived? Not because
> it’s useless. People still use it because you can write working code in Lisp
> way faster than you can in most so-called “practical” languages._

Sorry to burst this bubble, but tons of languages created in the same period
or 10-15 years later are still in use.

Fortran, which he already mentioned. COBOL is still in use (much much more
than any Lisp, just not in shiny new startups). Forth is still used here and
there. C of course which is about 12 years younger but still around 40ish.
Pascal is still used (in far greater numbers than Lisp). Heck, even BASIC
still has tons of fans, either in VB disuise or in the the various commercial
BASIC's around.

With this in mind, Lisp being "50 years old and still in use" is much less
impressive -- since one other 50 year old, and several 40 and 30 year old
languages are still in widespread use. We use lots of 3+ decades old languages
- so, it's not like we only use "new" languages and Lisp is the exception.

~~~
tome
I'd love to know what Pascal's still used for.

~~~
coldtea
Tons of people still use Borlands tools and there are lots of legacy
enterprise apps maintained in them.

In Windows there are also several high profile apps written with Pascal. One
such I remember reading about recently is Fruity Loops, one of the most
popular (though entry level) DAWs.

In the TIOBE rankings (not definitive, but indicative), Pascal has 2 entries
in the top 20, as Delphi/Object Pascal and plain Pascal -- far ahead languages
from all CLs combined, to Clojure, Scheme, Lua, Groovy, Erlang, etc.

------
shadowmint
This course is taught in python now; this post is about 4 years old.

Oh look, there's even a past thread about it
[https://news.ycombinator.com/item?id=3491142](https://news.ycombinator.com/item?id=3491142)

------
asgard1024
I think what makes Python unique and successful as a programming language is a
strict pragmatism (rejection of any ideology) and rather conservative choices
in features to add (that is, don't add everything that someone suggest, wait
until we can see it's a good idea and it cannot be readily composed from
existing parts).

Scheme, OTOH, has some ideological choices. The whole notion of programmable
programming language that comes with Lisp tradition (which includes
s-expressions). The emphasis on teaching and small libraries. Attempt to
somewhat model mathematics in numerical tower. These design choices, while
interesting, are going against practicality.

I am big fan of mathematics, Common Lisp, Haskell. There is so much beauty and
elegance. And yet, when I need to get something done quickly, I will just use
Python because it drops the mathematical purity without prejudice, just like a
physicist working on an impossible problem.

~~~
PuercoPop
Python is so ideological it is not even funny. It has a crippled lambda
because Guido couldn't find a syntax he liked for it. It doesn't have tail
call elimination because Guido is under the, mistaken, impression that they
inhibit backtraces. The zen of python spouts explicit is better than implicit
as a marketing slogan to cover up a design wart with Python's lolscope. It
only had local and global scope. Python Scope is still broken[0] btw. But
don't worry, it is not a bug because it is documented. (╯°□°)╯︵ ┻━┻. The only
reason Python passes as a language with good design is because people compare
it to PHP or Javascript.

How is the numerical tower impractical? Having to check for overflow/underflow
after every addition is what is impractical in my book.

> I am big fan of ... Common Lisp ... There is so much beauty and elegance.

Idk where to people get the idea that Common lisp is 'beatiful and elegant'
(in opposition to practical I may add). It is eminently practical. Have you
seen loop and format (which btw Python has adopted with some glaring
_practical_ omissions like list iteration ~{~}.)? The whole anything but nil
is true to allow functions like digit-char-p to return a number instead of t
is another practical design choice. Do you think there is anything elegant in
modifying the readtable? I could go on and on. CL is a practical language
that, apparently due to ESR's nirvana bullshit quote, people who haven't used
it have a misconception about its design.

But back to the point, Scheme's design (ideology if you want) is to play to
pick features that synergize as to allow discard others as they can be
expressed with the previous features/concepts. You don't need iteration, as it
is a special case of recursion. You need iterators, you have map, which is
just a function the user can define, etc. And this is relevant to teaching
computation as it allows the teacher to waste as little time teaching a
language and allows him to focus on CONCEPTS. The amount of scheme knowledge
needed to finish the SICP can be taught in 15 minutes (It doesn't use macros).
All the difficulty lies in the concepts it deals with. Getting the language
out of the way allows to cover a lot of ground, for example in the SICP one
implements a Virtual Machines and a compilers targeting it.

Now if you want to argue that nowadays the student needs to learn how to pipe
software together and has less need for concepts that is another thing
altogether[2], but saying that Python is practical (as opposed to ideological)
and Scheme's 'ideological' choices hampers the students learning is bullshit.

[0]:
[https://bugs.python.org/issue24321#msg244357](https://bugs.python.org/issue24321#msg244357)

[1]:
[https://twitter.com/whitequark/status/604088954816716800](https://twitter.com/whitequark/status/604088954816716800)

[2]: Of which I'd quote Dijkstra: "It is the university responsibility to give
society not what it wants but what it needs."

~~~
asgard1024
> The only reason Python passes as a language with good design

..because ability to compromise _is_ a good design, in a sense.

I kinda agree about the scope though, but I don't think it's a big deal.
Sometimes having a hierarchy is overrated, and two levels of names is good
enough.

But you will find design mistakes in all languages. Every designer errs.
Python doesn't actually have that much warts because the designer is quite
conservative.

> Idk where to people get the idea that Common lisp is 'beatiful and elegant'

Maybe from the paper that introduced Lisp, of which CL is descendant? I am
aware about CL's warts, but these are result of Lisp's success rather than its
original design goals.

> Scheme's design (ideology if you want) is to play to pick features that
> synergize as to allow discard others as they can be expressed with the
> previous features/concepts

I understand. But the reason for that is that people consider it beautiful
when you start from small subset of features. It doesn't however reduce the
need to know the more practical concepts. Like in mathematics. The fact that
we can build everything from set theory doesn't mean we don't need to know
about integrals.

Some universities skip the basics (set theory) and teach only the practical
concepts (integrals). Perfectly fine in my book.

> Now if you want to argue that nowadays the student needs to learn how to
> pipe software together

I have said it on HN before, it depends on your goals. If you're teaching
future programmers/computer scientists, sure, starting from Scheme or even
Lambda calculus is better. Because you can assume people will do the real work
in other languages. But if you teach a general non-programmer audience to
program (like scientists), why not teach them just one language, which they
can use in practice?

------
hayksaakian
I was actually enrolled in the first python version of this course. at that
time it was taught by a google employee and not Brian Harvey (author of the
OP, past professor of this course).

For me personally, the biggest benefit of python was the large amount of
accessible resources online. There were multiple ways to learn something
rather than banging my head against SICP.

Incidentally, writing a scheme interpreter was one of the last projects of the
course.

\----------

EDIT:

More from the OP about this topic

[https://www.cs.berkeley.edu/~bh/61a.html](https://www.cs.berkeley.edu/~bh/61a.html)

------
signa11
couple of quotes from the article:

It's SICP that I want to preserve, not Scheme.

For writing real-world code, what you want is aggressive optimization, and
access to libraries for up-to-the-minute solutions to real-world problems.

and ofcourse, this mindset is _exactly_ right in the context of a course for
teaching programming. as much as we might fantasize about it, computers are
made of metal, not lambda calculus :)

~~~
gus_massa
I know more about Racket (that is very similar to Scheme). The compiler does a
very aggressive optimizations and inlines many of the lambdas. You can write
nice understandable code with lambdas, but under the hood many of them are
removed and the actual running code is similar to the imperative version.

In Haskell there are a lot of abstractions, the compiler is also very
aggressive, but I don't know the details.

Anyway, in the "Computer Language Benchmarks Game", most of the programs in
Haskell and Racket are much faster (> 10x) than Python.
[http://benchmarksgame.alioth.debian.org/u32/compare.php?lang...](http://benchmarksgame.alioth.debian.org/u32/compare.php?lang=ghc&lang2=python3)
[http://benchmarksgame.alioth.debian.org/u32/compare.php?lang...](http://benchmarksgame.alioth.debian.org/u32/compare.php?lang=racket&lang2=python3)

(But I like the saying: There are lies, dammed lies, statistics and
microbenchmarks.)

~~~
igouy
_" After all, facts are facts, and although we may quote one to another with a
chuckle the words of the Wise Statesman, 'Lies--damned lies--and statistics,'
still there are some easy figures the simplest must understand, and the
astutest cannot wriggle out of."_ Leonard Henry Courtney, 1895

Also, those are "toy programs" not "microbenchmarks".

------
strontium_90
There appears to be a website [1] for the self-paced, Scheme version of the
course referenced (61AS) although it doesn't appear to be run as a MOOC
formally. There's also a well-organised site for the scheduled, Python version
[2] .

[1]: [http://www.cs61as.org/](http://www.cs61as.org/)

[2]: [http://cs61a.org/](http://cs61a.org/)

~~~
analognoise
I wish the lecture videos for 61AS were online, but sadly I can't find them. I
think 61AS is done in Racket now, which would make it even more practical.

------
mixmastamyk
> Rossum, the inventor of Python, hates Lisp, but he was dragged kicking and
> screaming to lambda

I'm not sure that's true, anyone have more details? Most people don't like the
parens everywhere with lisp, but otherwise speak of it highly.

Edit: thanks for the links on lambda, read all of them. However, didn't see
anything obvious written about lisp itself.

~~~
tikhonj
"Kicking and screaming", to be fair, is a bit of a literary exaggeration. But
Rossum did not particularly _want_ to add functional features to the language
and only did so at the behest of his users. Lambda as well as
map/filter/reduce were "a significant, early chunk of contributed code", not
something he intended the language to have from the outset[1]. More recently,
he has been trying to deemphasize these features in favor of list
comprehensions.

Moreover, Rossum is opposed to proper tail calls and even recursion in
general[2]. He also doesn't like folds, and generally thinks you should just
express that sort of logic as some sort of loop. (I forget exactly where I
read that opinion, but it could easily have been [1].)

He's a staunchly imperative programmer, and the design of Python shows this
off consistently except for an initial accident of first-class functions and
closures (of a sort)—a design he likes because it enabled other, non-
functional language features like new-style classes.

"Kicking and screaming" might have been an exaggeration, but it captures his
overall attitude towards functional programming pretty well.

[1]: [http://python-history.blogspot.com/2009/04/origins-of-
python...](http://python-history.blogspot.com/2009/04/origins-of-pythons-
functional-features.html)

[2]: [http://neopythonic.blogspot.com/2009/04/tail-recursion-
elimi...](http://neopythonic.blogspot.com/2009/04/tail-recursion-
elimination.html)

~~~
setheron
I just can't understand anyone who is black and white. I like when I have both
tools at my disposal: recursion and iteration.

~~~
hueving
when you have a project concerned with readability, adding new features is a
huge community cost in the long run because it's one more thing you have to
learn to deal with as you go across projects.

One of the wonderful things with python is that you can dig into the code of
most python projects and not have to worry much about completely different
idioms requiring a complete context switch to understand how they work.

He is not really being black and white, he is doing a service by preventing
language bloat ala C++ as much as possible.

~~~
sklogic
This is exactly what makes Python a bad language. Lack of expressive power
results in an unnecessary complexity of the code. It's much easier to
comprehend a short, compact code written in the familiar, domain-specific
idioms rather than digging through convoluted pile of low-level leaky idioms
like loops, list comprehensions, generators, classes, recursion and all that
irrelevant crap.

~~~
afc
Just wanted to add my voice: this matches exactly my perception. I used to
really like Python, but I've come to the conclusion that there's a certain
point in terms of the complexity of a Python program where everything just
blows up and it's next to impossible to keep it from becoming a tangled mess.
This point is reached incredibly soon, something like five classes with some
inheritance, some interface/virtual/abstract class. Ugh. Now I avoid Python as
much as possible, much preferring C++ or Java, which I think work incredibly
better for larger programs.

------
willtim
At Oxford University in the UK, students are taught exclusively Haskell in
their first year - a language designed by a committee of some of the worlds
best computer scientists. An institution that teaches Python under the banner
of computer science, certainly loses prestige in my opinion.

~~~
collyw
I don't know the Haskell ecosystem, but my guess is that Python will have many
more libraries already developed for scientific tasks.

~~~
willtim
For computer science, I doubt it.

~~~
yenda
You can doubt as much as you want it's just a fact. But I'm not saying it's
good either. As much as I like python as a scripting language I don't think
that's it should be use as widely as it is now.

Concerning Haskel it still lacks some pragmatism to solve some pratical
problems such as install and cabal hell.

~~~
willtim
There are countless parsing libraries, compilers and cutting edge research
done in Haskell. My guess is that you are thinking of NumPy and similar
wrappers over older C/Fortran code. A computer scientist would seek to design
something better, perhaps by exploiting algebraic properties not considered by
NumPy. Universities teaching Python is a relatively recent phenomenon, perhaps
to appease industry.

EDIT: cabal came from industry and was based on ideas from the Java, Python,
Ruby communities. The Nix packager better embodies the ideas of Haskell.

------
dschiptsov
What students cannot understand is that after passing the classic CS61A in
Scheme, languages such as Python or Julia could be picked up in a few hours
with occasional consulting of reference manual for particular details. Erlang
in a couple of days.

Well, for Java (a dogmatic religion) one have to be thoroughly brainwashed, so
there is CS61B for that.

------
hayksaakian
Here is a video playlist of the first

Here are video playlists of all the CS courses at berkeley

[http://webcast.berkeley.edu/series.html#c,d,Computer_Science](http://webcast.berkeley.edu/series.html#c,d,Computer_Science)

This is the most recent version of the CS61A course (Spring 2015)

2015 version:

[https://www.youtube.com/view_play_list?p=-XXv-
cvA_iBM29DgZsG...](https://www.youtube.com/view_play_list?p=-XXv-
cvA_iBM29DgZsGaQihJp8lLQn3J)

first python version available online (Fall 2012)

[https://www.youtube.com/view_play_list?p=EC87898FD0A141069E](https://www.youtube.com/view_play_list?p=EC87898FD0A141069E)

This is the last version of CS61 taught by Harvey (Fall 2010)

[https://www.youtube.com/view_play_list?p=EC6D76F0C99A731667](https://www.youtube.com/view_play_list?p=EC6D76F0C99A731667)

------
kriro
It's interesting that the PG article is cited. I've always had mixed feelings
about it.

On the one hand I agree that wanting to use Lisp for a startup is probably a
good indicator of technical strength (yes I'm saying that people that pick
Lisp as their first language are smarter than the average).

On the other hand startup financing is all about the hyper growth potential
and it would seem to me that basing your technology stack on Lisp could be
quite the hinderance. The job market is already tough and finding people with
a deep understanding of Lisp to start working on an (assumed) nontrivial
Codebase isn't easy.

I guess Clojure and "allowing" (or migrating to) Java could be an option? Then
again some hypergrowth startups don't need many developers (WhatsApp)

~~~
foobarian
When they were starting their company there was no Python/Ruby/PHP to choose
over Lisp, and Java wasn't as mature. Lisp was actually quite the RAD choice
at the time.

------
holografix
Can't believe you air heads are seriously comparing Scheme to Python. Scheme
is a nightmare, it's only good for academics who have nothing better to do and
the 1% of your projects where functional programming may actually be
beneficial to what you're trying to do.

------
ssaddi
As a developer, I tend to be now agnostic/indifferent towards programming
languages. Essentially, you can use any programming language to do the job.
The difference lies in developer's comfort zone and libraries. For example, I
prefer C# over VB.Net for ASP.NET/MVC backend. However, for several practical
in-house projects, I've found Excel+VBA far quicker over IIS/ASP.NET project.
So, it all depends on the context, your audience and usability of the project.
We should not let technologies drive our projects, but our business users and
current trend patterns. For example, I'm seeing a lot of JavaScript frameworks
being used to deliver responsive and device-independent web applications, such
as SPA (Single Page Application). Granted, it takes a while to learn a
language's API, but essentially all of them do similar things. The advantages
lies not in them alone, but in the entire framework/suite that it comes with.
We are living in times where knowing programming languages is not as important
as knowing frameworks/libraries. There are heaps of them out there that
require programmer to spend more time on writing integration code to "glue
them" or configuring them. We no longer need to write the low-level mundane
code, but focus on delivering high-quality, rich software applications.

~~~
sklogic
> Essentially, you can use any programming language to do the job.

Of course you can code even in Brainfuck if you want. But the difference in
time and quality would easily be in orders of magnitude.

> Granted, it takes a while to learn a language's API, but essentially all of
> them do similar things.

Uhm, no, not nearly. Languages are far too different, and all of them are very
specialised. There is no such thing as a general-purpose language.

