Using Python for programming algorithms

castironpi castironpi at gmail.com
Sat May 17 20:05:30 EDT 2008


On May 17, 5:32 pm, Vicent Giner <vgi... at gmail.com> wrote:
> Hello.
>
> I am new to Python. It seems a very interesting language to me. Its
> simplicity is very attractive.
>
> However, it is usually said that Python is not a compiled but
> interpreted programming language —I mean, it is not like C, in that
> sense.
>
> I am working on my PhD Thesis, which is about Operations Research,
> heuristic algorithms, etc., and I am considering the possibility of
> programming all my algorithms in Python.
>
> The usual alternative is C, but I like Python more.
>
> The main drawbacks I see to using Python are these:
>
> * As far as I understand, the fact that Python is not a compiled
> language makes it slower than C, when performing huge amounts of
> computations within an algorithm or program.
>
> * I don't know how likely it is to find libraries in Python related to
> my research field.
>
> * I know Python is a "serious" and mature programming language, of
> course. But I do not know if it is seen as "just funny" in a research
> context. Is Python considered as a good programming language for
> implementing Operations Research algorithms, such as heuristics and
> other soft-computing algorithms?
>
> Maybe this is not the right forum, but maybe you can give me some
> hints or tips...
>
> Thank you in advance.

You're hearing from 'impossible and useless'-- neither operations.

'Stacks' are pretty important to Python (there is a Stackless Python,
I understand), which makes persistence a little more handy.  It's
still a computer and still a language.  You may be asking how well its
best speakers know, and look at that, I can't tell you.  Some of the
fundamentals of Python may be unexplored to date, as its from the 90s,
and stacks are elements.

I, for one, will assume you're interested in control operations, which
yes Python has, and control is important.  The standard library is a
good size to me (I wouldn't go doubling).  There's a ready graphics
module.  There are code-primitive literals, including lists -and- a
tuple.  I think you're looking for the selling points of dynamic
assignment (a.barproperty= 'unheardof'), typefreeness (a= [2,'bcd']),
dynamic execution (exec('print 2'), which promotes a possibility of
self-referentiality), type-aware function pointers, variable-length
procedure arguments, and platform independence.

I think you just asked at the right time.  Yes that's an impressive
list.

There is one catch to Python, of the importance of which of the powers
that be, I am unaware.  But I do know what you are liable to find on
the newsgroup.  Now, with thousands of dollars of institution time on
the money, what control?  I will be tentatively assuming that you are
not covertly comparing other languages.  I don't think you'll like it
if you're unwise.



More information about the Python-list mailing list