Calling (C)Python code from Java: Is it JPype?

Ville Vainio ville at spammers.com
Sat Oct 2 07:12:10 EDT 2004


>>>>> "geiger" == F GEIGER <f.geiger at vol.at> writes:

    >> Why GUI in compiled lang? Typically the time in a GUI is spent in a
    >> GUI library, which is native code.

    geiger> It is not because of the performance. I never had any

Ok - just checking. "Compiled language" is so widely abused term,
typically used in the context of performance. You were looking for the
term "statically typed language".

    geiger> again had missed something. I am willing to give up on
    geiger> flexibilty in the *GUI* part of my app to receive type
    geiger> safety and in consequence compile time error checking.

I'm not big on GUI programming, but for me the problem with GUIs, that
a statically typed language would help you catch, is the large amount
of different methods taking a large variety of parameters. You only
need to get them right once, different data sets don't create too many
different situations that would break the GUI. Or at least those parts
that would be helped by static typing.

    geiger> If anyone could show me a way how I can develop the *GUI*
    geiger> part of may apps in a test driven way, i.e. w/o having to
    geiger> enter data manually all over again, then I could forget
    geiger> about all this.

Is the UI complex? With simple UIs, the part that needs to interface
with the actual UI library is trivial, and generally not worth unit
testing. TDD the "model"/"document" part of the UI. Or just hack
together some kind of simple UI that you can use to test / demo your
app, and put up the time to create a more sophisticated UI that you
test thoroughly when the rest of the stuff works.

    geiger> mostly in the problem domain and not in the lang
    geiger> domain. Ever handled strings, lists etc. in C++ or Java?

Have I ever!

HBufC* concat_stringsL(const TDesC& aS1, const TDesC& aS2)
        {
        HBufR* res = HBufC::NewLC(aS1.Length() + aS2.Length());
        res->Des() = aS1;
        res->Des().Append(aS2);
        return res;
        }

    geiger> you got the point: So many things are just easy to do in
    geiger> Python and I don't want to give up on *that*. OTOH: GUI
    geiger> stuff mostly is a SMOP, nothing special (possiblities in
    geiger> wx are great, though. I can do things here, I couldn't
    geiger> dream of doing it in, say, VB). Here a compiler really
    geiger> could make things easier - for *me* and *my* apps. Again,
    geiger> YMMV.

It can make things easier, but the cross-language interface (esp. as
it's a custom one, not a polished one like, say, wxPython is for
wxWindows/C++) can offset the easiness. 

-- 
Ville Vainio   http://tinyurl.com/2prnb



More information about the Python-list mailing list