"Kort, Eric" <[EMAIL PROTECTED]> writes:
> Question: Why program heterogenously (say, with Inline::CPP), and
> not just program in C++ alone?
>
> I argued that (a) it is a matter of preference, do what you want,
> and (b), I just can't believe some things (mostly related to I/O and
> text parsing) are as simple in C++ as Perl, while other things are
> clearly more speedy in C or C++, and (c) if you want a GUI, Perl/TK
> is cross platform and Visual C++ isn't.
>
> I wonder what some of you Inliner's would have to say to a person
> who argues that C++ alone is as good or better than mixing Perl and
> C++ through Inline or other XS technologies?
As a small case-in-point, a previous project, not too large, we
started developing simultaneously in Python and C++. We had the
Python version done first, with C++ optimizations added in towards the
end, to the point where the pure C++ version was cancelled. To boot,
the Python version was faster (as of the last C++ version) because we
were able to better realize the part we optimized. The overall Py
code size was miniscule in comparison to the C++ version. Our
conclusion: there's no reason to avoid developing in a hetergenous
environment, and likely a lot of good reasons for doing so.
Perl would be the same, of course.
There's another case, with less direct comparison, where we replaced
50k lines of C++ code with 3k lines of Python code, and it ran faster
and far more flexibly. It didn't help that the C++ code was
implementing a home-grown language interpreter :-).
-- Ken