I've been following the development of perl6 from its beginnings, read the Apocalypses and Exegesis as they came out, and though I am not a perl guru and did not understand it all, the language looks interesting and one I would like to experiment with.

But I want to start doing real things. Which for me requires gui toolkits.

I have used Tk with perl5 and I am looking at WxWidgets.

WxWidgets (and the more commercial Qt) exist as C++ classes, although WxPerl is a set of wrappers around WxWidgets for perl5.

So how to write an application in perl6 that uses (for the sake of illustration) WxWidgets?

For simplicity, just a small window with "Hello World", a button "cool" that adds text to the window", and a button "Be gone!" to kill the window.

Can, in fact, pugs do the following?

1) Suppose initially, we use WxPerl, taken from cpan?

Presumably, we write a perl6 program that has some perl5 in it that instantiates the objects using WxPerl. Then we switch to perl6 scripting. From what I understand from pugs documentation it is possible to switch from one representation to the other.

How then does perl6 manipulate the scalars which perl5 generates as blessed references?

2) The other possibility is for perl6 to use the WxWidgets classes directly. [ This actually would be useful because there are contributed classes in WxWidgets that have not yet been "wrapped" for perl5 consumption. ]

How do I tell the perl6 (pugs) compiler where the classes reside? How do I get them to instantiate? How do I then manipulate the objects?

From the documentation on perl6, this sort of manipulation of other languages' objects is supposed to be much easier that it was for perl5, viz, no knowledge of XS is required.

Some examples would help me understand how to get perl6 working to do the things I want to do with it.

Richard

Reply via email to