![]() |
C++ vs python
Has anyone had anh experiences with C++ vs python?
Is python any slower? |
Re: C++ vs python
that depends on the task to be performed. python is a high level scripting language, where as C/C++ is a low level true programming language.
with C/C++ you can get down and dirty with cpu registers and do much more along the lines of address spacing with memory allocation, or even direct communication with hardware provided you know how to talk to it. python is an interpreted scripting language. it requires that you install libraries or an interpreter that takes the python instructions and processes it allowing the computer to understand it in a more native fashion. the libraries are often in a language like C/C++/Java. the learning curve for python is no where near as steep as programming languages like C++ and depending on the task, it may be easier to use a scripting language. the per cycle expense of a C++ instruction and a python instruction favors the C++ side because there is no need for interpretation. but the fact that you can write something like a "hello world" app easier in python makes the trade off easier. |
Re: C++ vs python
Thx for the reply, but i know all that. What i'm curious of is overall performance...slow,slower...real slow?
Python is newer than C for me, i need a refresher in both now so now is a good time to choose the language that works best since speed is an issue on embedded devices. Thx again |
Re: C++ vs python
If it's a largely event-driven UI type application, then performance isn't all that much of a consideration between the languages. Most of the time is spent in the idle loop.
Otherwise, the tradeoffs depend in large part on how good a developer you are in either language. |
Re: C++ vs python
Just an example : i 'm developping a small text editor with python syntax highlight and many other things in python. And there is no speed difference between mine and an other source editor writted in c.
Read this example between python/perl/c++ : http://www.strombergers.com/python/ |
Re: C++ vs python
Quote:
|
Re: C++ vs python
You won't notice any real speed differences for basic stuff...i don't think i'd write the next 3rd person shooter in python though.
|
Re: C++ vs python
Quote:
|
Re: C++ vs python
On a 770, the real difference between Python and C apps is in startup time (loading Python itself then the PyGTK library takes a while), but afterwards running speed is generally undistinguishable. This is probably less noticeable on the faster N800.
|
Re: C++ vs python
Shamelessly pimping Squeak as another alternative :-)
|
All times are GMT. The time now is 19:46. |
vBulletin® Version 3.8.8