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

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.

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?



Relevant Pages

  • Industry profiles: Software tools: Exclusive to comp.databases.pick: Why python? (from 2000)
    ... "My first look at Python was an accident, and I didn't much like what I ... language called SNG for manipulating PNG ... Perl, of course, is the 800-pound gorilla of modern scripting languages. ... The design objective of fetchmailconf ...
  • Re: Forth and Unix -- history
    ... Forth, as a language, gives you all the building blocks. ... So does FORTRAN, so does C, so does PERL, so does Python. ... to interface to some free library written in whatever language. ...
  • Recommend an E-book Meeting the Following Criteria (Newbie, Long)
    ... I know several programming languages namely Java, Perl and C in this order ... Now I'm wondering which Python book I should get as there are so many out ... I'd like to mostly concentrate on language features but some pointers ...
  • Re: Python or PHP?
    ... If it's one of the things for which Python ... every language here and there more ways to do something. ... you make Perl more complicated than it is:-D. ... Not the programmer. ...
  • Re: Ruby vs. PHP
    ... done is checked out which versions of Perl, Python, YARV, Ruby, jRuby ... dynamic language to the seconds for the benchmark with gcc. ... YARV, Python, Perl and PHP have fairly close medians and the boxes are ...