Abelson and Python

B

bearophileHUGS

While studying the SICP video lectures I have to twist my mind some to
completely understand the lessons. I implement the programs shown there
in both Python and Scheme, and I find the Python implementations
simpler to write (but it's not a fair comparison because I know very
little Scheme still).

Now some things are changing:
http://lambda-the-ultimate.org/node/1840
The MIT is going to change its curriculum structure that was famous for teaching Scheme in introductory courses. One force behind the reform is no one else than Harold Abelson, famous for his marvelous Scheme opus SICP.<
The first four weeks of C1 will be a lot like the first four weeks of 6.001, Abelson said. The difference is that programming will be done in Python and not Scheme.<


Someone is translating the SIPC programs in Python too:
http://www.codepoetics.com/wiki/index.php?title=Topics:SICP_in_other_languages#Python

With slides and code from lectures:
http://courses.csail.mit.edu/6.01/
http://courses.csail.mit.edu/6.01/fall06/calendar.html

I like Scheme a bit too, but I consider this is a small victory for
Python :)

Bye,
bearophile
 
M

mensanator

While studying the SICP video lectures I have to twist my mind some to
completely understand the lessons. I implement the programs shown there
in both Python and Scheme, and I find the Python implementations
simpler to write (but it's not a fair comparison because I know very
little Scheme still).

Now some things are changing:
http://lambda-the-ultimate.org/node/1840



Someone is translating the SIPC programs in Python too:
http://www.codepoetics.com/wiki/index.php?title=Topics:SICP_in_other_languages#Python

With slides and code from lectures:
http://courses.csail.mit.edu/6.01/
http://courses.csail.mit.edu/6.01/fall06/calendar.html

I like Scheme a bit too, but I consider this is a small victory for
Python :)

No surprise to anyone who's ever tried to use MIT Scheme.
 
B

bearophileHUGS

(e-mail address removed):
No surprise to anyone who's ever tried to use MIT Scheme.

Be careful, such assertions are often flamebait.

I am using DrPython (I think they were using it at MIT too lately), and
it is very very good IDE, it produces executables on the fly, it has a
visual debugger with some nice graphical things, it manages graphics,
and it has something that I have never seen in Python: it manages a
hierarchy of simpler Scheme languages, useful to learn for students.
Probably something similar may be useful to learn Python too (such
stripped down Python versions can forbid things like def foo(x=[]):
....). I am appreciating Scheme a bit because of such very good editor
that makes things possible for newbies of the language too.

Bye,
bearophile
 
M

mensanator

(e-mail address removed):

Be careful, such assertions are often flamebait.

Well, yeah, it's a warning to everyone to not
bother with the MIT implementation of Scheme which
is completely worthless.
I am using DrPython

Haven't heard of that one, although I've got DrScheme.
(I think they were using it at MIT too lately),

That's no surprise since the MIT implementation
of Scheme is worthless.
and
it is very very good IDE, it produces executables on the fly, it has a
visual debugger with some nice graphical things, it manages graphics,
and it has something that I have never seen in Python: it manages a
hierarchy of simpler Scheme languages, useful to learn for students.
Probably something similar may be useful to learn Python too (such
stripped down Python versions can forbid things like def foo(x=[]):
...).

I find that hierarchy extremely annoying. I don't see the need for it.
I never use OOP in Python yet there's no need for me to have a
stripped down version, I just don't use it.
I am appreciating Scheme a bit because of such very good editor
that makes things possible for newbies of the language too.

But those are implementation details, which you can't avoid.
A bad implementation spoils a language even if the language itself
is fabulous.
 
B

bearophileHUGS

(e-mail address removed):
Haven't heard of that one, although I've got DrScheme.

Right, sorry, I meant that one :)

I find that hierarchy extremely annoying. I don't see the need for it.
I never use OOP in Python yet there's no need for me to have a
stripped down version, I just don't use it.

But Python too contains some things that can bite a newbie of the
language. (BTW, in some situations I too have had to access to the full
Scheme language, so you may be partially right).

But those are implementation details, which you can't avoid.
A bad implementation spoils a language even if the language itself
is fabulous.

And a good implementation like DrScheme makes the Scheme language
usable too :)

Bye,
bearophile
 
M

markscottwright

While studying the SICP video lectures I have to twist my mind some to
completely understand the lessons. I implement the programs shown there
in both Python and Scheme, and I find the Python implementations
simpler to write (but it's not a fair comparison because I know very
little Scheme still).

Now some things are changing:
http://lambda-the-ultimate.org/node/1840

I am shocked by this. I love Python as much as the next guy, but I
just don't see how SICP can be done in Python. Chapters 1-3, sure.
But chapter 4 has you writing a Scheme interpreter in Scheme, and
chapter 5 has you writing a Scheme compiler in Scheme. I don't see how
that can be done in Python - certainly not in one chapter of a
textbook. Am I to believe that students will be writing a Python
metacircular evaluator? If it were that easy, the PyPy guys would be
done by now.
 
B

bearophileHUGS

markscottwright:
I love Python as much as the next guy, but I
just don't see how SICP can be done in Python.

The contents of the course are probably different, they work on
robotics...

Bye,
bearophile
 
P

Paddy

While studying the SICP video lectures I have to twist my mind some to
completely understand the lessons. I implement the programs shown there
in both Python and Scheme, and I find the Python implementations
simpler to write (but it's not a fair comparison because I know very
little Scheme still).

Now some things are changing:
http://lambda-the-ultimate.org/node/1840



Someone is translating the SIPC programs in Python too:
http://www.codepoetics.com/wiki/index.php?title=Topics:SICP_in_other_languages#Python

With slides and code from lectures:
http://courses.csail.mit.edu/6.01/
http://courses.csail.mit.edu/6.01/fall06/calendar.html

I like Scheme a bit too, but I consider this is a small victory for
Python :)

Bye,
bearophile

Hi Bearophile.
(Is your name pronounced Beer-owe-file, or Bear-oh-fi-lee, just
wondered :) ?

I too have heard about the MIT course changing to Python elsewhere and
wanted to know why it was talked about so much? I'm from England, I
know that MIT is a very prestigious university, but if Cambridge
changed a course, or better still, The Open University changed a
similar course to Python, I think I'd be hard pressed to hear about it.
Is the MIT course syndicated to Universities around America or
something?

Cheers, Paddy.
 
M

mensanator

Paddy said:
Hi Bearophile.
(Is your name pronounced Beer-owe-file, or Bear-oh-fi-lee, just
wondered :) ?

I too have heard about the MIT course changing to Python elsewhere and
wanted to know why it was talked about so much?

Scheme was invented at MIT. If Scheme is as fabulous as its adherents
claim, why would the institution that invented it drop it?

To me, the answer is obvious, but probably not to the press.
 
B

bearophileHUGS

Paddy:
Is the MIT course syndicated to Universities around America or something?
(Is your name pronounced Beer-owe-file, or Bear-oh-fi-lee,

I don't know.

I too have heard about the MIT course changing to Python elsewhere and
wanted to know why it was talked about so much?

I don't know why others have talked so much about it, I have posted the
links here because those CS courses were very good, and probably
originally they seemed more like science finction. The most important
link I have shown is among the last ones, to the slides of the
lectures, that can probably be used to learn some other CS.

Bye,
bearophile
 
F

Fredrik Lundh

markscottwright said:
> If it were that easy, the PyPy guys would be done by now.

if the PyPy guys had focused on writing a Python interpreter in Python,
they'd been done by now.

</F>
 
M

markscottwright

Fredrik said:
if the PyPy guys had focused on writing a Python interpreter in Python,
they'd been done by now.

</F>

Isn't that the point of PyPy? It's what their mission statement says
(http://codespeak.net/pypy/dist/pypy/doc/architecture.html#mission-statement):

"PyPy is an implementation of the Python programming language written
in Python itself, flexible and easy to experiment with."

This is something that is amazingly easy to do in scheme, since the
language is so simple, but is typically pretty difficult to do in other
languages. I remember being blown away by how much I knew after
reaching the end of SICP - I wanted to go out and write my own scheme
compiler (and given the proliferation of scheme implementations, a lot
of other people must have felt the same way). I don't remember getting
to the end of a book on python and thinking, "that's easy. I could do
that!"

That said, I see now that the course we're talking about isn't the same
as the old 6.001 course, and presumably has different pedagogical goals.
 
S

Scott David Daniels

markscottwright said:
Isn't that the point of PyPy? It's what their mission statement says
(http://codespeak.net/pypy/dist/pypy/doc/architecture.html#mission-statement):

"PyPy is an implementation of the Python programming language written
in Python itself, flexible and easy to experiment with."

This is something that is amazingly easy to do in scheme, since the
language is so simple, but is typically pretty difficult to do in other
languages....

That said, I see now that the course we're talking about isn't the same
as the old 6.001 course, and presumably has different pedagogical goals.
There are a more than a few library functions in the Python code that
are written in C in CPython. Not only is PyPy trying to get the
_entire_ Python system into Python, it is trying to do so in a
friendly-to-translation-in-a-statically-typed-language way.

Besides, if you can freely use "eval" and "exec", how hard is a pure
python language interpreter?

--Scott David Daniels
(e-mail address removed)
 
C

cfbolz

Fredrik said:
if the PyPy guys had focused on writing a Python interpreter in Python,
they'd been done by now.

</F>

The "Python interpreter in Python" part of PyPy _is_ done. Since quite
a while even (something like July 2005) compilation to C works, and the
interpreter was more or less finished since quite a while before that.
There were some things missing at that point but interpretation of
Python code that didn't use any fancy builtin modules worked.

Cheers,

Carl Friedrich Bolz
 
C

Chris Mellon

There are a more than a few library functions in the Python code that
are written in C in CPython. Not only is PyPy trying to get the
_entire_ Python system into Python, it is trying to do so in a
friendly-to-translation-in-a-statically-typed-language way.

Besides, if you can freely use "eval" and "exec", how hard is a pure
python language interpreter?

It's pretty trivial, and thats why I've always been unimpressed by
"implemente a <x> language interpreter in <y> lines" type statements.
It's a cute toy but what's the real learning opportunity there?

Now, writing a compiler/interpreter from the ground up is a more
valuable experience, but does it really matter if the language is the
same one you wrote the compiler in? It gets harder the more
complicated the syntax and semantics of the language are, but, say,
python 1.0 would probably be a suitable goal for coursework.
 
F

Fredrik Lundh

Chris Mellon wrote;
Now, writing a compiler/interpreter from the ground up is a more
valuable experience, but does it really matter if the language is the
same one you wrote the compiler in? It gets harder the more
complicated the syntax and semantics of the language are, but, say,
python 1.0 would probably be a suitable goal for coursework.

I'd pick mini-python plus basic classes:

http://hetland.org/python/mini-python.php

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top