Tangent on embeddability (was: Choosing Perl/Python for my particular niche)
Cameron Laird
claird at lairds.com
Sat Mar 27 10:43:31 EST 2004
In article <roy-3EDA29.08465327032004 at reader1.panix.com>,
Roy Smith <roy at panix.com> wrote:
.
.
.
>2) It's dead simple to embed in a C/C++ application. This is one place
>where it really outshines Python. It's literally two lines of C to get
>a Tcl interpreter up and running. It's equally trivial to extend Tcl by
>providing functions in C. Compare this to the native Python/C
>interface, boost.python, or swig, and you really appreciate the
>difference!
>
>For most general purpose tasks, I reach for Python first. But if I
>needed to provide a quick scripting interface to an existing C library,
>or wanted to embed some easy scriptability into a large C/C++ app, Tcl
>is what I would be looking at.
Me, too, to a large extent. I think you overstate Tcl's
advantage, though, Roy, in a couple of ways. First, I
agree that Tcl is objectively easier and more reliable
in embedding; Python still has blemishes in ease-of-use
and portability in this role. It can be hard getting
all of Python embedded correctly, especially, in my ex-
perience, when working on multiple platforms.
However, Tcl has historically been so easy that it hasn't
bothered documenting the process. Python has a definitive
(if aging) embedding manual that I regard as more inviting
than what Tcl offers.
Also, ctypes, Boost and Pyrex *are* successful, and appear
to me progressing faster than any of their Tcl cousins.
Yet another way to look at the comparison is that a sig-
nificant number of people rely on SWIG, and, to them,
Tcl and Python are indistinguishable.
Follow-ups narrowed. Most of Perl's response to all of
this is, "Wait 'til 6!"
--
Cameron Laird <claird at phaseit.net>
Business: http://www.Phaseit.net
More information about the Python-list
mailing list