Working around a lack of 'goto' in python

leeg leeg at teaching.physics.ox.ac.uk.valid
Wed Mar 10 09:46:41 EST 2004


Stephen Horne wrote:

> On Tue, 09 Mar 2004 01:34:06 +0000, leeg
> <leeg at teaching.physics.ox.ac.uk.valid> wrote:
> 
>>Y2KYZFR1 wrote:
>>
>><snip GOTO>
>>> 
>>> No stay away from computers until you understand how and why this is.
>>
>>*points at the Linux kernel source*
> 
> Examples of use are not proof that such use is a good thing.
> 
> More relevant here, kernal programming is not the kind of job that
> Python is designed for. What is justifiable in kernal programming is
> not necessarily justifiable for the kinds of applications that are
> written in Python. On similar principles, whats justifiable in the
> Python source code is not necessarily justifiable in, errrm, Python
> source code :-)
> 

Y2kyzfr1's statement was that GOTO is a bad thing and should never be used,
which is not a discussion of the lack or otherwise of a particular
statement in the Python language.  I agree that an example is not a good
advocation.  However in the case of the kernel source, if thousands of
people have looked at the code and not come up with a better way to do
whatever is done without a goto, then the goto method must have at least
*some* merit :-).

On the subject of kernel hacking and Python, why can't kernel programming be
considered in Python?  Because the reference implementation of the language
is interpreted[1], and interpreted slowly?  That's the case with Java too;
however people have written Java machines in software and in hardware that
are plenty fast enough to write whole operating systems in, and have goen
on to write whole operating systems in them.  The same could in principle
be done with Python, and Python is a language in which one could
principally write a whole operating system.  So why should that be
irrelevant in a discussion of Python?

[1]"Byte compilation" is a jargontastic way of saying tokenised, then
interpreted.
-- 
Graham Lee
I am leeg, for we are many
"An upsettingly large part of academia right now seems to be working on
bringing Java into the 1980s." - Avi Bryant
http://users.ox.ac.uk/~wadh1342




More information about the Python-list mailing list