Interpreted vs. compiled languages

Thread Solved

Join Date: Aug 2005
Posts: 148
Reputation: Micko is on a distinguished road 
Solved Threads: 6
Micko Micko is offline Offline
Junior Poster

Interpreted vs. compiled languages

 
0
  #1
Aug 29th, 2005
Hello, I'm learning Python. It is my first interpreted language. I have some experience with C and C++. I must admit that it's very hard for me to accept a concept of interpreted language. For example I write code in C++, compile it, link it and I have .exe file which I can send to my friend who doesn't have any C++ compiler or anything and it works. So I can see with my own eyes (and others as well) product and that is .exe program that can be run on different machines. On the other hand, I wrote simple programs (or scripts!?! - don't know difference) in Python, but whenever I want to see result I need to open Python shell. I simply don't have a feeling that I amde something. How to send Python program to my friend who doesn't have Python installed? Is it possible at all?
I'm sorry if this question sounds stupid to you, but I'm really confused. I know that testing and debugging is easier with intepreted language, but how to make a real program in interpreted language?

If anyone can explaine me this issue, it would be greatly appreciated.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 3,977
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 920
Moderator
vegaseat's Avatar
vegaseat vegaseat is online now Online
DaniWeb's Hypocrite

Re: Interpreted vs. compiled languages

 
0
  #2
Aug 29th, 2005
The Python Shell is only used to test short Python statements. Any regular Python programs are written on the editor of one of the IDEs available.

If your friends have a Unix computer Python is most likely installed. With Windows computers you can encourage your friends to download and install Python or give them an install package on a CD, after all Python is open-source. There is also Py2Exe, a free program to that combines your file with the needed parts of the Python interpreter.
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 215
Reputation: shanenin is an unknown quantity at this point 
Solved Threads: 16
shanenin shanenin is offline Offline
Posting Whiz in Training

Re: Interpreted vs. compiled languages

 
0
  #3
Aug 29th, 2005
the very popular(notorious) program bittorrent is written in python. I wonder if the bittorrent windows executable used Py2Exe.
In a perfect world exceptions would not be needed.
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 3,977
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 920
Moderator
vegaseat's Avatar
vegaseat vegaseat is online now Online
DaniWeb's Hypocrite

Re: Interpreted vs. compiled languages

 
0
  #4
Aug 30th, 2005
The telltale of the product of Py2Exe is that the exe file is accompanied by a runtime package consisting of at least two files one the Library.zip and the other the Python interpreter DLL like Python24.dll. A little similar to the Microsoft .NET languages that need a NET runtime package.
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,039
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 139
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: Interpreted vs. compiled languages

 
0
  #5
Aug 30th, 2005
When Python is installed correctly, Python files should execute just like any other file -- it's just a matter of registering the file extension. It's the same situation as Java.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 138
Reputation: a1eio is an unknown quantity at this point 
Solved Threads: 21
a1eio's Avatar
a1eio a1eio is offline Offline
Junior Poster

Re: Interpreted vs. compiled languages

 
0
  #6
Sep 22nd, 2005
Yea but Micko has a point. it does suck when you want to take a simple short and sweet program you made with python to school or an internet cafe or any other place where you are not allowed to install stuff, i mean py2exe is good but whenever i use it i get a whole load of crap thrown in with the exe and a folder that has 5 or 6 .py files (i know they are needed but it's still anoying), ok it's good if you know where you are going but for quick and easy compilation and running python does lack...a lot
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 146
Reputation: G-Do is an unknown quantity at this point 
Solved Threads: 28
G-Do's Avatar
G-Do G-Do is offline Offline
Junior Poster

Re: Interpreted vs. compiled languages

 
0
  #7
Sep 22nd, 2005
...and that is .exe program that can be run on different machines.

That's not necessarily true. Compiling a C/C++ program does not create a universal executable that can be installed on any machine. Whether the executable will work on your friend's machine depends on (a) what the program does, and (b) what the other machine's architecture is.

This is a larger issue in developing software for general use. If you're writing in a compiled language you're inevitably going to have to deal with a whole lot of architecture-specific compilation issues, which can be a huge pain in the rear, especially after you've just finished coding a large project. Nothing quite takes the wind out of your sails like getting a complex C program to work perfectly on an i386 and then having it consistently and mysteriously screw up on your boss's non-i386 machine.

If you're writing in an interpreted language, on the other hand, the code should, theoretically, be much more portable. Now all the user has to do is download the interpreter, which (again, in theory) ought to be as easy as pie.
Vi veri veniversum vivus vici
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 138
Reputation: a1eio is an unknown quantity at this point 
Solved Threads: 21
a1eio's Avatar
a1eio a1eio is offline Offline
Junior Poster

Re: Interpreted vs. compiled languages

 
0
  #8
Sep 22nd, 2005
Thats a very good point, i never looked at it that way, and i bet that if you use the py2exe to make a 'portable' program because it ships with the python24dll thingy then maybe thats actually a little more multi-system than a bog standard compiled exe. (then again maybe not hehe all speculation)
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 3,977
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 920
Moderator
vegaseat's Avatar
vegaseat vegaseat is online now Online
DaniWeb's Hypocrite

Re: Interpreted vs. compiled languages

 
0
  #9
Sep 22nd, 2005
If you use Windows, you are in luck, you can download Movable Python also called "Python on a Stick" because it is meant to run Python from one of those USB Flash Drives.

Walmart around here sells a 128M USB Flash Drive for less than $20. It's the size of half a finger and is all you need. Install Movable Python on it and whatever program files you have and now you can carry Python with you to your friends Windows computer.

Movable Python is open-source and comes in two flavors, basic and standard. The latest standard version has Python 2.4.1, wxPython, SPE (an IDE), Tkinter, IDLE, Psyco and more. Download from:
http://sourceforge.net/projects/movpy

More info from:
http://www.voidspace.org.uk/python/movpy/index.html
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 138
Reputation: a1eio is an unknown quantity at this point 
Solved Threads: 21
a1eio's Avatar
a1eio a1eio is offline Offline
Junior Poster

Re: Interpreted vs. compiled languages

 
0
  #10
Sep 23rd, 2005
Wehey very nice thats solved my issue
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the Python Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC