scripting language newbie - compatibility

Alex Martelli alex at magenta.com
Wed Aug 2 16:36:51 EDT 2000


"Grant Edwards" <ge at nowhere.none> wrote in message
news:_DZh5.3168$6E.904857 at ptah.visi.com...
> In article <QnZh5.35704$NS3.3082323 at news.chello.at>, Kurt Aistinger wrote:
>
> >I recently decided to learn a scripting language like perl, tcl
> >or python and can't decide which I should choose.
>
> I've used all three (albiet Tcl and Perl only briefly before I
> switched to somethign else).  I would recommend Python.  I
> think it's much easier to learn.

I second the motion, although my Perl experience was _very_ long,
and my Tcl one almost as intense although more sporadic.


> >Someone told me that perl is source-compatible, you can take
> >the source from unix, copy it to windows and it runs, which is
> >reallly cool I think. Nevertheless, I think that programs in
> >python are easier to read and to understand and that they're
> >shorter, which makes it more sympathic to me. are
> >python-programs source-compatible, too?
>
> In general, yes -- unless you use a library module that's only
> available for certain platforms.  For example, if you use the
> win32com module to do COM object stuff, your program won't run
> on Unix or MacOS.

Right.  But a plus of Python is that you can also move, if you
want, the *compiled* code -- the foo.pyc file that Python
produces every time it implicity compiles a foo.py source file.
With Perl, which also bytecode-compiles, the bytecodes stay in
memory, and need to be regenerated next time you run the same
program; with Python, they're saved to disk the first time and
only remade if the source file gets modified.

And the compiled form is also platform-independent... so Python
(if you don't use any platform-specific module) is not just
source compatible, but also _binary_-compatible, like Java!
(Without having to _explicitly_ request the compilation like
you have to do in Java...).


Alex






More information about the Python-list mailing list