Re: Python in a desktop environment

2007-03-13 Thread krishnakant Mane
I have coded some complex programs in python in the recent past.
I find it very robust and also not very slow (as is depicted by the
starter of this thread )  I use wxpython on the gui side and testify
that it is indeed very suitable for huge gui apps.
may be pyqt is good enough too and I believe so.
I don't find there is any reason to go stay in a hut when you have a
banglo to stay.
may be c++ gives you more control on pointers etc but what if you just
forgot to use that control properly?  afterall we are all humans.
so python is really good for speed as well as robustness if you can
understand the meaning of it.  and I wont want to again give the
meaning of the word because some one has already done it.
regards.
Krishnakant.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-13 Thread Bruno Desthuilliers
David Cramer a écrit :
 On Mar 12, 9:56 am, Bruno Desthuilliers bruno.
 [EMAIL PROTECTED] wrote:
 Diez B. Roggisch a écrit :

 Bruno Desthuilliers wrote:
 Grant Edwards a écrit :
 (snip)
 Python is _far_ more robust than C++.
 I wouldn't say so - robustness is a quality of a program, not of a
 language !-)
 Nope. Dealing with dangling references and double frees, complex
 copy-semantics that change only by a feeble character or via overloaded and
 thus hard to comprehend assignment operators are all properties of C++,
 Indeed

 and
 tremendously afflict robustness IMHO.
 robustness of programs written with this language, yes.

 NB : I'm afraid the smiley got lost somewhere between screen and
 readers, so here comes another one !-)
 
 Everyone seems to have misunderstood what I want.

Possibly.

 I'm a Python
 developer, I don't give a rats ass about what people say about C#,
 Python, or c++, they all have their uses. My main reasoning for
 considering C++ as the backend is some things (reading memory for
 example) are much easier to do in C++ than in Python,

Depends. But anyway nothing prevents you from having a few functions in 
a C extension for this part...

 and we already
 have a lot written in C++.
 
 The argument about robustness, has nothing to do with how nicely
 formatted the language is, or how great the tracebacks are,

Certainly not. It has to do with readability (which helps spotting 
obvious bugs), simplicity (which helps understanding the whole damn 
thing), and automatic memory management (which really makes a 
difference, even for seasonned C and C++ programmers).

 it's
 strictly about how high the memory cost is and how much CPU it's going
 to take. 

This is a performance issue, not a robustness issue. Wrong qualificative !-)

 Python is well known for being high on memory and C++ being
 compiled can be a lot faster for things.

Even compiled to native code, Python wouldn't probably be much faster - 
it's way too dynamic. Or this would require 30+ years of work (like 
we've seen for Lisp).

If you have performance-critical parts that can't be solved by a 
pure-python solution or a binding to an external lib, then yes, it makes 
sens to recode these parts in a lower-level language. But this is not 
exactly a python front-end for a C++ backend, it's a python program 
with some C or C++ extensions.

My 2 cents...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-13 Thread Paul Boddie
On 13 Mar, 04:33, Grant Edwards [EMAIL PROTECTED] wrote:
 On 2007-03-13, David Cramer [EMAIL PROTECTED] wrote:

  and we already have a lot written in C++.

[...]

 I think you're nuts to decide that you need C++ before you've
 tested a Python implementation, but it's your nickle. :)

I'm imagining that the luxury of throwing away a large amount of
existing code just isn't an option.

Paul

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-13 Thread Lou Pecora
In article [EMAIL PROTECTED],
 Grant Edwards [EMAIL PROTECTED] wrote:

  I'm a Python developer, I don't give a rats ass about what
  people say about C#, Python, or c++, they all have their uses.
  My main reasoning for considering C++ as the backend is some
  things (reading memory for example) are much easier to do in
  C++ than in Python, and we already have a lot written in C++.
^

[cut]

  Anyways, thanks for everyones feedback, we will most likely go
  with a combination of Python and C++.
 
 I think you're nuts to decide that you need C++ before you've
 tested a Python implementation, but it's your nickle. :)

It really sounds like it's the C++ legacy that's driving Mr. Edward's 
decision.  The rest are just arguing points. Which several people have 
jumped at.

-- Lou Pecora  (my views are my own) REMOVE THIS to email me.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-13 Thread Grant Edwards
On 2007-03-13, Dennis Lee Bieber [EMAIL PROTECTED] wrote:
 On Mon, 12 Mar 2007 15:45:30 -, Grant Edwards [EMAIL PROTECTED]
 declaimed the following in comp.lang.python:

 
 IMO, robustness is also a quality of a language.  In language
 like C and C++, it's difficult to write a program that isn't
 full of potential crashes and exploits: buffer overflows,
 broken pointers, memory leaks, etc.  Python eliminates many of
 those sources of problems, and is therefore a more robust
 language.

   And if one doesn't like the dynamic behavior of Python, there is
 always a visit to comp.lang.ada

Or Modula-3.

-- 
Grant Edwards   grante Yow!  I am KING BOMBA of
  at   Sicily!...I will marry
   visi.comLUCILLE BALL next Friday!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-12 Thread Grant Edwards
On 2007-03-11, David Cramer [EMAIL PROTECTED] wrote:
 On Mar 10, 10:52 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:
 David Cramer wrote:
  If you had an application that you were about to begin development on
  which you wanted to be cross platform (at least Mac and Windows),
  would you suggest using c++ and Python?

 I'd strongly consider a pure python solution (I'd choose wxpython),
 but if I needed to code backend stuff in a lower level language I'd
 use C rather than C++.

 Well we want it to be very robust, and python isn't exactly
 the fastest language, or one with the lowest overhead :)

Python is _far_ more robust than C++.

-- 
Grant Edwards   grante Yow!  If Robert Di Niro
  at   assassinates Walter Slezak,
   visi.comwill Jodie Foster marry
   Bonzo??
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-12 Thread Bruno Desthuilliers
Grant Edwards a écrit :
(snip)

 
 Python is _far_ more robust than C++.
 

I wouldn't say so - robustness is a quality of a program, not of a 
language !-)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-12 Thread Grant Edwards
On 2007-03-12, Bruno Desthuilliers [EMAIL PROTECTED] wrote:
 Grant Edwards a écrit :
 (snip)

 Python is _far_ more robust than C++.

 I wouldn't say so - robustness is a quality of a program, not of a 
 language !-)

IMO, robustness is also a quality of a language.  In language
like C and C++, it's difficult to write a program that isn't
full of potential crashes and exploits: buffer overflows,
broken pointers, memory leaks, etc.  Python eliminates many of
those sources of problems, and is therefore a more robust
language.

-- 
Grant Edwards   grante Yow!  Uh-oh!! I forgot
  at   to submit to COMPULSORY
   visi.comURINALYSIS!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-12 Thread Diez B. Roggisch
Bruno Desthuilliers wrote:

 Grant Edwards a écrit :
 (snip)
 
 
 Python is _far_ more robust than C++.
 
 
 I wouldn't say so - robustness is a quality of a program, not of a
 language !-)

Nope. Dealing with dangling references and double frees, complex
copy-semantics that change only by a feeble character or via overloaded and
thus hard to comprehend assignment operators are all properties of C++, and
tremendously afflict robustness IMHO.

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Python in a desktop environment

2007-03-12 Thread Bruno Desthuilliers
Diez B. Roggisch a écrit :
 Bruno Desthuilliers wrote:
 
 Grant Edwards a écrit :
 (snip)

 Python is _far_ more robust than C++.

 I wouldn't say so - robustness is a quality of a program, not of a
 language !-)
 
 Nope. Dealing with dangling references and double frees, complex
 copy-semantics that change only by a feeble character or via overloaded and
 thus hard to comprehend assignment operators are all properties of C++,

Indeed

 and
 tremendously afflict robustness IMHO.

robustness of programs written with this language, yes.

NB : I'm afraid the smiley got lost somewhere between screen and 
readers, so here comes another one !-)
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Python in a desktop environment

2007-03-12 Thread David Cramer
On Mar 12, 9:56 am, Bruno Desthuilliers bruno.
[EMAIL PROTECTED] wrote:
 Diez B. Roggisch a écrit :

  Bruno Desthuilliers wrote:

  Grant Edwards a écrit :
  (snip)

  Python is _far_ more robust than C++.

  I wouldn't say so - robustness is a quality of a program, not of a
  language !-)

  Nope. Dealing with dangling references and double frees, complex
  copy-semantics that change only by a feeble character or via overloaded and
  thus hard to comprehend assignment operators are all properties of C++,

 Indeed

  and
  tremendously afflict robustness IMHO.

 robustness of programs written with this language, yes.

 NB : I'm afraid the smiley got lost somewhere between screen and
 readers, so here comes another one !-)

Everyone seems to have misunderstood what I want. I'm a Python
developer, I don't give a rats ass about what people say about C#,
Python, or c++, they all have their uses. My main reasoning for
considering C++ as the backend is some things (reading memory for
example) are much easier to do in C++ than in Python, and we already
have a lot written in C++.

The argument about robustness, has nothing to do with how nicely
formatted the language is, or how great the tracebacks are, it's
strictly about how high the memory cost is and how much CPU it's going
to take. Python is well known for being high on memory and C++ being
compiled can be a lot faster for things.

Anyways, thanks for everyones feedback, we will most likely go with a
combination of Python and C++.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-12 Thread Grant Edwards
On 2007-03-13, David Cramer [EMAIL PROTECTED] wrote:

 Everyone seems to have misunderstood what I want.

One might suspect that your request was unclear. ;)

 I'm a Python developer, I don't give a rats ass about what
 people say about C#, Python, or c++, they all have their uses.
 My main reasoning for considering C++ as the backend is some
 things (reading memory for example) are much easier to do in
 C++ than in Python, and we already have a lot written in C++.

Reading memory is actually pretty trivial in Python.

 The argument about robustness, has nothing to do with how
 nicely formatted the language is, or how great the tracebacks
 are, it's strictly about how high the memory cost is and how
 much CPU it's going to take.

No, that's not at all what robust means (at least not to
anybody I know).  Robust means that the program is always
well-behaved.  It doesn't crash.  It doesn't leak memory.  It
isn't full of security holes.  It's got nothing to do with
resource usage.

 Python is well known for being high on memory and C++ being
 compiled can be a lot faster for things.

True, but that's nothing to due with robustness.  A fast, small
program that crashes, leaks memory, and gives incorrect results
is not robust.  A large slow program that doesn't crash
regardless of input and produces correct results is robust.

 Anyways, thanks for everyones feedback, we will most likely go
 with a combination of Python and C++.

I think you're nuts to decide that you need C++ before you've
tested a Python implementation, but it's your nickle. :)

-- 
Grant Edwards   grante Yow!  Make me look like
  at   LINDA RONSTADT again!!
   visi.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-11 Thread David Cramer
On Mar 10, 10:52 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 David Cramer wrote:
  If you had an application that you were about to begin development on
  which you wanted to be cross platform (at least Mac and Windows),
  would you suggest using c++ and Python?

 I'd strongly consider a pure python solution (I'd choose wxpython),
 but if I needed to code backend stuff in a lower level language I'd
 use C rather than C++.

Well we want it to be very robust, and python isn't exactly the
fastest language, or one with the lowest overhead :)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-11 Thread Diez B. Roggisch
David Cramer schrieb:
 On Mar 10, 10:52 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:
 David Cramer wrote:
 If you had an application that you were about to begin development on
 which you wanted to be cross platform (at least Mac and Windows),
 would you suggest using c++ and Python?
 I'd strongly consider a pure python solution (I'd choose wxpython),
 but if I needed to code backend stuff in a lower level language I'd
 use C rather than C++.
 
 Well we want it to be very robust, and python isn't exactly the
 fastest language, or one with the lowest overhead :)

Erm, and what has _robustness_ with fast  less overhead to do? It's 
exactly the other way round, a python program is much less likely to 
crash that C/C++, and if so in manners that are much easier to manage 
and fix.

I've done extensive GUI-development with PyQt, and can say that it's a 
very productive and powerful combination. And GUI-code usually isn't 
troublesome performance-wise.

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-11 Thread Duncan Booth
David Cramer [EMAIL PROTECTED] wrote:

 On Mar 10, 10:52 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:
 David Cramer wrote:
  If you had an application that you were about to begin development on
  which you wanted to be cross platform (at least Mac and Windows),
  would you suggest using c++ and Python?

 I'd strongly consider a pure python solution (I'd choose wxpython),
 but if I needed to code backend stuff in a lower level language I'd
 use C rather than C++.
 
 Well we want it to be very robust, and python isn't exactly the
 fastest language, or one with the lowest overhead :)
 
So if you want it to be robust it's a no brainer: Python and no C++ or C.

I'd advise you to start off doing it in pure Python, then when you get it 
working see if it is fast enough, and if not profile it and find the 
bottlenecks. Those bits which really do need speeding up you should then 
rewrite using Pyrex, which won't take long at all since it is basically the 
same syntax. Also see whether Psyco helps.

Python can be slow, but if you leverage the built in functionality 
correctly you'll find it isn't much slower than C/C++ for many tasks, and 
can even be faster than you would get from C/C++ without a spending a very 
long time optimising it (that's because people have already spent a very 
long time optimising Python's builtin functionality).

Even if you do eventually find you have to rewrite parts of the code in 
C/C++ you should first have done what you can to optimise it in Python. 
Usually the best way to speed up something which is too slow is to use a 
different algorithm. That sort of change is comparatively easy to do in 
Python but an expensive programming exercise in C/C++. When you come to 
reimplement it then you'll be converting the already optimised code, which 
in many cases will be much easier than writing it in C/C++ from scratch.

If you look at http://page.mi.fu-berlin.de/~prechelt/Biblio/jccpprtTR.pdf 
you'll see that, at least for that task, the relative runtimes for C/C++ 
and Python widely overlap. Yes, the C/C++ implementation included some very 
fast ones, but they also included slows ones (and only Python of all the 
languages tested had no unusable implementations). OTOH, time to write the 
programs does not overlap. Of course, since that paper was written Python 
has changed a lot.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-11 Thread Hendrik van Rooyen
 David Cramer [EMAIL PROTECTED] wrote:

 If you had an application that you were about to begin development on
 which you wanted to be cross platform (at least Mac and Windows),
 would you suggest using c++ and Python?
 
 I'm asking because we were originally thinking about doing c# but
 after attending PyCon this year I'm reconsidering. We are already
 using Python for the website and I figure a c++ backend w/ a Python
 GUI may work really well, and would be pretty easy to port.
 
 Any opinions?
 
Why drag in the C++ ? 
What do you intend to do in it that you can't do in python?
Seems unnecessarily complex to me.
And on a desktop, speed issues are kind of irrelevant - Python
is snappy enough on modern hardware for most things.

My style would be to have the gui connect via pipes to the
local backend as a separate process, with a third process if there
are any communications needed to off box dbs.   But that is just
the way I think - YMMV

- Hendrik

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-11 Thread ce
On Mar 11, 12:26 pm, David Cramer [EMAIL PROTECTED] wrote:
 On Mar 10, 10:52 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:

  David Cramer wrote:
   If you had an application that you were about to begin development on
   which you wanted to be cross platform (at least Mac and Windows),
   would you suggest using c++ and Python?

  I'd strongly consider a pure python solution (I'd choose wxpython),
  but if I needed to code backend stuff in a lower level language I'd
  use C rather than C++.

 Well we want it to be very robust, and python isn't exactly the
 fastest language, or one with the lowest overhead :)

only one word caught my attention robust.. do u mean python is not
robust???
if this is your feeling, i don't recommend u to reconsider anymore,
turn back to ur previous programming language (what did'ya say it
was??? c# .. i remember one ad. about it's robustness .. a piece of
jelly!)

and by the way if u know something about C++, code the GUI with QT
(which would make it portable), and enjoy a high speed execution :P

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-11 Thread Bruno Desthuilliers
David Cramer a écrit :
 If you had an application that you were about to begin development on
 which you wanted to be cross platform (at least Mac and Windows),
 would you suggest using c++ and Python?
 
 I'm asking because we were originally thinking about doing c# but
 after attending PyCon this year I'm reconsidering. We are already
 using Python for the website and I figure a c++ backend w/ a Python
 GUI may work really well, and would be pretty easy to port.
 
 Any opinions?
 
Yes : forget about the c++ backend.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-11 Thread Bruno Desthuilliers
David Cramer a écrit :
 On Mar 10, 10:52 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:
 
David Cramer wrote:

If you had an application that you were about to begin development on
which you wanted to be cross platform (at least Mac and Windows),
would you suggest using c++ and Python?

I'd strongly consider a pure python solution (I'd choose wxpython),
but if I needed to code backend stuff in a lower level language I'd
use C rather than C++.
 
 
 Well we want it to be very robust,

Which is a pretty good reason to favor Python over C or C++.

 and python isn't exactly the
 fastest language, or one with the lowest overhead :)

It's not exactly one of the slowest languages nor one with the highest 
overhead neither. Chances are you'll have a fully-functional production 
level app in Python *way* before you have a first alpha in C++. If by 
then you *really* have some performance problem, it will be time to port 
the relevant modules to C extensions.
-- 
http://mail.python.org/mailman/listinfo/python-list


Python in a desktop environment

2007-03-10 Thread David Cramer
If you had an application that you were about to begin development on
which you wanted to be cross platform (at least Mac and Windows),
would you suggest using c++ and Python?

I'm asking because we were originally thinking about doing c# but
after attending PyCon this year I'm reconsidering. We are already
using Python for the website and I figure a c++ backend w/ a Python
GUI may work really well, and would be pretty easy to port.

Any opinions?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-10 Thread MonkeeSage
On Mar 10, 9:23 pm, David Cramer [EMAIL PROTECTED] wrote:
 If you had an application that you were about to begin development on
 which you wanted to be cross platform (at least Mac and Windows),
 would you suggest using c++ and Python?

Depending on what exactly you're trying to do, a pure python solution
may be sufficient, though obviously a C/C++ backend would be portable
as well. In terms of GUI; GTK or QT would probably be your best bet
(my personal preference is for pygtk), though Wxidgets may be a viable
option if the others are not (I'm not sure how advanced GTK/QT support
is on OSX). Your question is kind of vague, so this response is vague
as well. More info is needed to answer in a more specific way.

Regards,
Jordan

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python in a desktop environment

2007-03-10 Thread [EMAIL PROTECTED]
David Cramer wrote:
 If you had an application that you were about to begin development on
 which you wanted to be cross platform (at least Mac and Windows),
 would you suggest using c++ and Python?

I'd strongly consider a pure python solution (I'd choose wxpython),
but if I needed to code backend stuff in a lower level language I'd
use C rather than C++.

-- 
http://mail.python.org/mailman/listinfo/python-list