hsfrey has asked for the wisdom of the Perl Monks concerning the following question:

I'm attempting to use Tkx with Active State perl, but there are several Tk modules (like Tk::Table) that don't seem to have been converted to Tkx.

The respective syntaxes seem similar enough that a perl script should be able to do the translation.

Has such a translator been written? Is it available?

I don't grok either language well enough to try writing it myself.

Yes, I saw the similar all-caps prior question from 5 years ago, but it didn't really answer my question.

  • Comment on Is there a Tk to Tkx translator script?

Replies are listed 'Best First'.
Re: Is there a Tk to Tkx translator script?
by LanX (Saint) on Jul 11, 2016 at 19:37 UTC
    I doubt a translation is easily feasable.

    IIRC (not sure) does tkx provide an abstraction to write TCL semantically in Perl.

    Perl/Tk on the other hand is a OO framework interfacing with the underlying C bindings to the Tk lib, hence bypassing TCL.

    While the latter is the cleaner approach it hasn't been updated to newer versions of Tk, while Tkx doesn't need to, cause TCL commands are generated and send over a bridge.

    If you think a code translation is possible, then I'd rather opt for a new class framework with same interface, but generating TCL like tkx does. (Doesn't such a project already exist?)²

    Keep in mind that TCL is very lisp like, just where in lisp-dogma everything is a list, TCL -dogma makes everything a whitespace separated string.

    Not an expert. .. HTH!

    See also Perl TK

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

    Update

    ²) indeed, Tcl::pTk ! AnoMonk++

Re: Is there a Tk to Tkx translator script? (Tk, Tcl::pTk)
by Anonymous Monk on Jul 11, 2016 at 23:13 UTC
[Crossposted SO] Re: Is there a Tk to Tkx translator script?
by LanX (Saint) on Jul 11, 2016 at 20:22 UTC
      The pedantic sysops at SO blocked the question as "not being about programming". I had hoped that the sysops here would be less pedantic.
        LanX has provided an answer to your question, maybe it would be nice to thank him for that.

        He also said that it is considered polite to inform about cross-posting and gave the sound reasons for that. I don't think this is being pedantic. Especially, please don't do that to someone who has just tried to help you.