Python-like compiled language

Curtis Jensen cjensen at bioeng.ucsd.edu
Mon Dec 11 20:46:03 EST 2000


Alexander Lawhead wrote:
> 
> This may seem like an odd question, but what is the most Python-like
> compiled language? I'm a new programmer and have been learning on Python.
> I'm trying to build some command-line driven programs to do some image
> processing and am trying to find a Python-like compiled language that
> would be faster than Python+NumPy. Ideally I guess I should learn C and
> combine Python + C extensions. For the moment, I'd like to start on a new
> compiled language, preferably one that's oriented towards math/science
> (hopefully with built-in or standard matrix libraries). I've fallen in
> love with Python+NumPy's matrix capabilities and am far more interested in
> a language that comes close in this regard. Object oriented capability is
> not necessary.
> 
> So far, I've been pointed to F, a subset of Fortran 90. Is there anything
> else out there? Wide usage is not necessary, but free availability under
> Linux or WinXX is!
> 
> Thanks,
> 
> Alexander

The closest compiled languege to Python is probaby C/C++. 

If you're looking for speed, your best bet is to use a mathamtical
library (like Numpy).  As was mentioned in a previous post, it's almost
always a small section that is time intensive.  So, you can use Python
for the top layer of whatever you're doing, then call one of the library
routines.  If NumPy isn't fast enough for you, there is LaPack, or
odepack, or rksuite, or Nag, can't think of any others right now.  Most
are Fortran.  Unfortunatley, not all these are free.  I think you can
get LaPack lite for free.  Odepack is free and it's from llnl.  Nag is
NOT free, it is very expensive.  Travis Oliphant has a python-lapack
wrapper (http://oliphant.netpedia.net/).  We have some of Nag wrapped
(email me if you're interested).  Also, I can make a wrapper for odepack
if you need.

Even if you do this, there are other tricks you can do with sparse
matricies, and such things.  The above libraries have functionality for
sparse maticies.  How you set up the memory can be a factor too.  NumPy
will create arrays that are non-continous in memory.  This can affect
performance too. 

In summery, there are a lot of factors when it comes to speed. 
Sometimes it's hard to tell which factors will mater, and which won't.  
Good luck.

-- 
Curtis Jensen
cjensen at bioeng.ucsd.edu
http://www-bioeng.ucsd.edu/~cjensen/
FAX (425) 740-1451



More information about the Python-list mailing list