Re: Perl or Python for Socket Programming?



Thank you for the answer.

On Jun 9, 12:49 am, Ben Bacarisse <ben.use...@xxxxxxxxx> wrote:
Peyman <peyman.ta...@xxxxxxxxx> writes:
I'm about to start a project which involves transferring bulks of data
over a network and this is actually the main purpose of the project.
Programming languages that I can use are: C/C++, Java, Perl and
Python, but as long as platform indepenency and efficient execution is
needed, C/C++ and Java cannot be considered as the best language.

Them's fight'n words! I would guess that a conforming C compiler
(C90) and a library to open sockets (say POSIX) is available on at
least as many platforms as Perl and Python.[1]

Your program will, unless you work at a research facility with truly
fun kit, will be dominated by the network transfer time. The language
you use will hardly enter into it, but if it did (say because you end
up doing thousands of small transfers and a lot of computing based on
their content) then C will not let you down as far as efficiency
goes.[2]


Well it's not a research environment, but simply the program will run
as a daemon on a maybe-not-so-fast PC and I don't want a end user to
keep arguing about the program CPU usage.

So
which of Perl or Python do you recommend for such purpose?

In the end, you should choose the one you know best. Doing so will
save you more time than almost any other design decision you might
have to make. If you know neither, go for Perl, just because it is
likely to be slightly more widely available.[3]

[1] You don't say what protocol you need to use. The answer could
cause you to have to throw all my remarks into the bin (is there
Python module to do "blue book" FTP over X.25?).


As for the protocol, both UDP and TCP are used.

[2] But overall project and programmer efficiency may not be if you do
not know C.

[3] And because of rule 42 of programming: "No programmer has ever
regretted learning Perl, even if they hate the language design".[4]


The four languages I named above are those that I already know, so
there should not be any problem in using any of them.

[4] What's with all the footnotes?

--
Ben.


.