Steven D'Aprano [EMAIL PROTECTED] writes:
On Mon, 11 Jun 2007 01:28:09 +0100, Alexander Schmolck wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
On Sat, 09 Jun 2007 22:42:17 +0100, Alexander Schmolck wrote:
As for why tail calls are not optimized out, it was decided that being
able
to
Anders J. Munch [EMAIL PROTECTED] writes:
Like Steven said, tail-call optimisation is not necessary as you can always
hand-optimise it yourself.
Care to demonstrate on some code written in CPS (a compiler or parser, say)?
'as
--
http://mail.python.org/mailman/listinfo/python-list
Alexander Schmolck wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
On Mon, 11 Jun 2007 01:28:09 +0100, Alexander Schmolck wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
Don't keep us in suspense. What do you believe is the true reason?
It's easier to spot that some rationalization is
--- John Nagle [EMAIL PROTECTED] wrote:
There's a real reason. Remember, functions are
dynamically
replaceable. The compiler would have to detect that
the function
doesn't modify or replace itself while recursing for
this optimization
to be valid. Worst case, another thread could
John Nagle wrote:
Josiah Carlson wrote:
[snip]
Constant folding happens regardless of optimization level in current
Pythons.
So really, assert and docstring removals. Eh.
It's hard to optimize Python code well without global analysis.
The problem is that you have to make sure that a
Paul Rubin wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
Not tail calls, in general, no.
Sorry, how does that work? You're suggesting that there is an algorithm
which the compiler could follow to optimize away tail-recursion, but human
beings can't follow the same algorithm?
Now I'm
It's hard to optimize Python code well without global analysis.
The problem is that you have to make sure that a long list of wierd
things, like modifying code or variables via getattr/setattr, aren't
happening before doing significant optimizations. Without that,
you're doomed to a slow
Terry Reedy a écrit :
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
| Terry Reedy wrote:
| In Python, you have a choice of recursion (normal or tail)
[snip Stroud questions]
| I'm afraid Terry is wrong here, at least if he meant that CPython had
| tail recursion
On 2007-06-09, Terry Reedy [EMAIL PROTECTED] wrote:
WaterWalk [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
| I've just read an article Building Robust System by Gerald Jay
| Sussman. The article is here:
|
Diez B. Roggisch wrote:
Regardless of the possibility of speeding it up - why should one want
this? Coding speed is more important than speed of coding in 90%+ of all
cases.
When you have to start buying more servers for the server farm,
it's a real pain. I'm actually facing that
--- John Nagle [EMAIL PROTECTED] wrote:
When you have to start buying more servers for
the server farm,
it's a real pain. I'm actually facing that because
Python's HTML
parsing is so slow.
I have been following this thread for a bit, but
apologies in advance if I didn't read far
| | Terry Reedy wrote:
| | In Python, you have a choice of recursion (normal or tail)
Bruno
| I'm afraid Terry is wrong here, at least if he meant that CPython had
| tail recursion *optimization*.
| Terry Reedy a écrit :
| NO!!!
| I did not mean that or imply that in any way.
Bruno
| I
Antoon Pardon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
| On 2007-06-09, Terry Reedy [EMAIL PROTECTED] wrote:
| For him to imply that Python is anti-flexibility is wrong. Very
wrong..
| He should look in a mirror. See below.
|
| My impression is that python supporters often
In article [EMAIL PROTECTED],
Terry Reedy [EMAIL PROTECTED] wrote:
James Stroud [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
| Terry Reedy wrote:
| In Python, you have a choice of recursion (normal or tail)
|
| Please explain this.
I am working on a paper for Python Papers that
On Jun 10, 6:43 pm, John Nagle [EMAIL PROTECTED] wrote:
Josiah Carlson wrote:
Steven D'Aprano wrote:
On Sat, 09 Jun 2007 22:52:32 +, Josiah Carlson wrote:
the only thing that optimization currently does in Python at present
is to discard docstrings
Python, or at least CPython,
On Jun 9, 12:16 pm, James Stroud [EMAIL PROTECTED] wrote:
Terry Reedy wrote:
In Python, you have a choice of recursion (normal or tail)
Please explain this. I remember reading on this newsgroup that an
advantage of ruby (wrt python) is that ruby has tail recursion, implying
that python does
Steven D'Aprano wrote:
On Sat, 09 Jun 2007 22:52:32 +, Josiah Carlson wrote:
the only thing that optimization
currently does in Python at present is to discard docstrings
Python, or at least CPython, does more optimizations than that. Aside from
run-time optimizations like interned
[EMAIL PROTECTED] wrote:
On Jun 9, 12:16 pm, James Stroud [EMAIL PROTECTED] wrote:
Terry Reedy wrote:
In Python, you have a choice of recursion (normal or tail)
Please explain this. I remember reading on this newsgroup that an
advantage of ruby (wrt python) is that ruby has tail recursion,
Josiah Carlson wrote:
Steven D'Aprano wrote:
On Sat, 09 Jun 2007 22:52:32 +, Josiah Carlson wrote:
the only thing that optimization currently does in Python at present
is to discard docstrings
Python, or at least CPython, does more optimizations than that. Aside
from
run-time
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
| Terry Reedy wrote:
| In Python, you have a choice of recursion (normal or tail)
[snip Stroud questions]
| I'm afraid Terry is wrong here, at least if he meant that CPython had
| tail recursion *optimization*.
NO!!!
I did not mean
--- John Nagle [EMAIL PROTECTED] wrote:
With this, the heavy optimizations are possible.
Strength reduction. Hoisting
common subexpressious out of loops. Hoisting
reference count updates out of
loops. Keeping frequently used variables in
registers. And elimination of
many
Steven D'Aprano [EMAIL PROTECTED] writes:
On Sat, 09 Jun 2007 22:42:17 +0100, Alexander Schmolck wrote:
As for why tail calls are not optimized out, it was decided that being able
to have the stack traces (with variable information, etc.) was more useful
than offering tail call optimization
Steve Howell wrote:
--- John Nagle [EMAIL PROTECTED] wrote:
With this, the heavy optimizations are possible.
Strength reduction. Hoisting
common subexpressious out of loops. Hoisting
reference count updates out of
loops. Keeping frequently used variables in
registers. And elimination of
On Mon, 11 Jun 2007 01:28:09 +0100, Alexander Schmolck wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
On Sat, 09 Jun 2007 22:42:17 +0100, Alexander Schmolck wrote:
As for why tail calls are not optimized out, it was decided that being able
to have the stack traces (with variable
Steven D'Aprano [EMAIL PROTECTED] writes:
Not tail calls, in general, no.
Sorry, how does that work? You're suggesting that there is an algorithm
which the compiler could follow to optimize away tail-recursion, but human
beings can't follow the same algorithm?
Now I'm confused.
The
On Jun 11, 12:43 am, Steve Howell [EMAIL PROTECTED] wrote:
To the extent that some of these optimizations could
be achieved by writing better Python code, it would
nice for optimization tools to have a suggest mode.
Is anyone out there who uses MS Word and doesn't deactivate the
suggest mode
--- Kay Schluehr [EMAIL PROTECTED] wrote:
On Jun 11, 12:43 am, Steve Howell
[EMAIL PROTECTED] wrote:
To the extent that some of these optimizations
could
be achieved by writing better Python code, it
would
nice for optimization tools to have a suggest
mode.
Is anyone out there
En Sat, 09 Jun 2007 02:49:03 -0300, WaterWalk [EMAIL PROTECTED]
escribió:
I've just read an article Building Robust System by Gerald Jay
Sussman. The article is here:
http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf
In it there is a footprint which says:
WaterWalk [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
| I've just read an article Building Robust System by Gerald Jay
| Sussman. The article is here:
|
http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf
|
| In it there is a footprint which says:
|
Terry Reedy wrote:
In Python, you have a choice of recursion (normal or tail)
Please explain this. I remember reading on this newsgroup that an
advantage of ruby (wrt python) is that ruby has tail recursion, implying
that python does not. Does python have fully optimized tail recursion as
In scheme, I believe you just have recursion.
Cousin TJR
I'm a total scheme rookie starting only about 3 days ago
and one of the mechanisms I went looking for was a technique
for iteration
Found in the scheme docs about iteration supplied
via the reduce
Gabriel Genellina wrote:
For what I can
remember of my first love (Physics): if you have a small ball
moving inside a spherical cup, it would be almost crazy to use
cartesian orthogonal coordinates and Newton's laws to solve it -
the obvious way would be to use spherical coordinates and the
On Jun 9, 12:16 pm, James Stroud [EMAIL PROTECTED] wrote:
Terry Reedy wrote:
In Python, you have a choice of recursion (normal or tail)
Please explain this. I remember reading on this newsgroup that an
advantage of ruby (wrt python) is that ruby has tail recursion, implying
that python does
James Stroud [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
| Terry Reedy wrote:
| In Python, you have a choice of recursion (normal or tail)
|
| Please explain this.
I am working on a paper for Python Papers that will. It was inspired by
the question 'why doesn't Python do
Cousin Stanley [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
| In scheme, I believe you just have recursion.
I was referring to the original mimimalist core language developed by Guy
and Sussman and as I remember it being used in the original edition of SICP
(see Wikipedia). I
Bjoern Schliessmann wrote:
Gabriel Genellina wrote:
For what I can
remember of my first love (Physics): if you have a small ball
moving inside a spherical cup, it would be almost crazy to use
cartesian orthogonal coordinates and Newton's laws to solve it -
the obvious way would be to use
James Stroud wrote:
Terry Reedy wrote:
In Python, you have a choice of recursion (normal or tail)
Please explain this. I remember reading on this newsgroup that an
advantage of ruby (wrt python) is that ruby has tail recursion, implying
that python does not. Does python have fully
Josiah Carlson [EMAIL PROTECTED] writes:
James Stroud wrote:
Terry Reedy wrote:
In Python, you have a choice of recursion (normal or tail)
Please explain this. I remember reading on this newsgroup that an advantage
of ruby (wrt python) is that ruby has tail recursion, implying that python
Alexander Schmolck wrote:
Josiah Carlson [EMAIL PROTECTED] writes:
James Stroud wrote:
Terry Reedy wrote:
In Python, you have a choice of recursion (normal or tail)
Please explain this. I remember reading on this newsgroup that an advantage
of ruby (wrt python) is that ruby has tail
On Sat, 09 Jun 2007 22:42:17 +0100, Alexander Schmolck wrote:
As for why tail calls are not optimized out, it was decided that being able
to have the stack traces (with variable information, etc.) was more useful
than offering tail call optimization
I don't buy this.
Do you mean you don't
On Sat, 09 Jun 2007 22:52:32 +, Josiah Carlson wrote:
the only thing that optimization
currently does in Python at present is to discard docstrings
Python, or at least CPython, does more optimizations than that. Aside from
run-time optimizations like interned strings etc., there are a
Kay Schluehr wrote:
On Jun 9, 12:16 pm, James Stroud [EMAIL PROTECTED] wrote:
Terry Reedy wrote:
In Python, you have a choice of recursion (normal or tail)
Please explain this. I remember reading on this newsgroup that an
advantage of ruby (wrt python) is that ruby has tail recursion,
I've just read an article Building Robust System by Gerald Jay
Sussman. The article is here:
http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf
In it there is a footprint which says:
Indeed, one often hears arguments against building exibility into an
engineered sys-
201 - 243 of 243 matches
Mail list logo